Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3006598pxj; Sun, 6 Jun 2021 22:55:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztolVdEP1SNFnEE4JQFmGnBLUHzp5ApZSA/O59ZbiNKTxtwvBHrCrDB5vbdmqWNWswbZdT X-Received: by 2002:a05:6402:342:: with SMTP id r2mr18548104edw.69.1623045325260; Sun, 06 Jun 2021 22:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623045325; cv=none; d=google.com; s=arc-20160816; b=IY+vNDffvh3kxHZLMEHks9no7zstF33SBHachteXLIeHOt4qFsB5posGub5a6e6e3g aYtozjZfM2XamUekSt1IaJm+LPOfkLNtHXV6BjP7WSNUx9tpyXQ0SKwSVwkzP3w+2Mae C6V9OWEivh+T0xcq0J+9WXrOoIr+qZTVfCp0VBBa7HXGdkC95TIFEVnBSVp8RIpIoe96 ewUq5P1XM5Wchk9xuU6ggan7cY4zu5m6wVmjURYSeS6bFviN/Q3LwPPmcROFmpezxyEu Nw37uO68jhYAHm6V71wgp0W5f2PshOv0FosQaT0xfRiDvqAEZd3DNF7vzY2ENWvJJEr3 HgzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=p9Wyz6KVB+BYTinTmvpICZbmHU+fbNVe76fbC1E+cdY=; b=cCYV7ou9pfKSo1voD0LMFZfs1dEFu7IBfwVUR9eswyEsy3lAd4dXzr9G9IP+vUXKFq YWrD+AqfsDqnKwGCNNzBYpN2wLYIIG5lQHCvTkkUlwgDyIGxjT1NQCeiN3cIVEqbHZXs hq2RYggvePbGvGZlOh90zDsjUUjqSyq2o0/qh1WISiCaLrmVtS2KQcTZaxWQdLSTaRdW aQFWtsnJQlyktO+Bj4TZcVi5o071n7hwqd/AHfZstd/zKqrtqM2A3GPCfiPF4bqeCYqs tg5XcPIw8bl5WGN+o67ldCU4pr1E7o0q4thOwQU0bA7qGdCfN1bxdv5uID6sx9GPSoMD A53w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RHM8rB/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si10888680ejy.213.2021.06.06.22.55.02; Sun, 06 Jun 2021 22:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RHM8rB/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbhFGFxz (ORCPT + 99 others); Mon, 7 Jun 2021 01:53:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:53738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhFGFxz (ORCPT ); Mon, 7 Jun 2021 01:53:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C840E6121D; Mon, 7 Jun 2021 05:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623045124; bh=a4Lg+JUPxxsJc/eOTxfRRMHpv5LjKRVeKemBpbGWIDM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RHM8rB/mlV328H1xAE61n5jsu0XfeToCJbIOMtvG/VU2srJ6FQVAGeF5KV1VZq7q9 trPVnOCbCfDHXN06WSjktBmAI7j9G3R+6A4v7HMJGydwzj4qnsWOl0LhVROIIiNkj8 6v8V8DfhFpDWeUDmimOUU6hduL1KByIPOwok5ulFwyCbFMWFW2ck4y9B11WEgdddrd LDX/cW4G/bln15fenJ1ef7oUzeWV2QvXe0GZB6ctRsOoGnEOdPAFnf3/j0U9oQkizD shLELQ82kWJlWhFkQYaNGuTE4FuOWHIWX3XhXp/fCAIluryxWgYSu3Lj4i/Sveja2r c8VvkRzbouW6Q== Date: Mon, 7 Jun 2021 08:51:59 +0300 From: Leon Romanovsky To: Jason Wang Cc: Eli Cohen , mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vdp/mlx5: Fix setting the correct dma_device Message-ID: References: <20210603112215.69259-1-elic@nvidia.com> <864e8d21-22d4-7735-817b-f88ec0126f87@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 10:30:42AM +0800, Jason Wang wrote: > > 在 2021/6/4 下午11:57, Leon Romanovsky 写道: > > On Fri, Jun 04, 2021 at 10:35:59AM +0800, Jason Wang wrote: > > > 在 2021/6/3 下午7:22, Eli Cohen 写道: > > > > Before SF support was introduced, the DMA device was equal to > > > > mdev->device which was in essence equal to pdev->dev; > > > > With SF introduction this is no longer true. It has already been > > > > handled for vhost_vdpa since the reference to the dma device can from > > > > within mlx5_vdpa. With virtio_vdpa this broke. To fix this we set the > > > > real dma device when initializing the device. > > > > > > > > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") > > > > > > Note sure this is correct, according to the commit log it should be the > > > patch that introduces the SF or aux bus support for vDPA. > > Where did you see that? > > > > git log -p drivers/vdpa/mlx5/net/mlx5_vnet.c > > > > ... > > + mvdev->vdev.dma_dev = mdev->device; > > + err = mlx5_vdpa_alloc_resources(&ndev->mvdev); > > ... > > comes from commit 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") > > > If I read the commit log and code correctly: > > " > > With SF introduction this is no longer true. > > " > > It works before SF is introduced. Yes, you are right, sorry for the noise. > > Thanks > > > > > > Thanks > > > > > > > > > Signed-off-by: Eli Cohen > > > > > > Patch looks correct. > > > > > > Thanks > > > > > > > > > > --- > > > > drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > > > > index bc33f2c523d3..a4ff158181e0 100644 > > > > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > > > > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > > > > @@ -2046,7 +2046,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name) > > > > if (err) > > > > goto err_mtu; > > > > - mvdev->vdev.dma_dev = mdev->device; > > > > + mvdev->vdev.dma_dev = &mdev->pdev->dev; > > > > err = mlx5_vdpa_alloc_resources(&ndev->mvdev); > > > > if (err) > > > > goto err_mtu; > > > _______________________________________________ > > > Virtualization mailing list > > > Virtualization@lists.linux-foundation.org > > > https://lists.linuxfoundation.org/mailman/listinfo/virtualization >