From: Leon Romanovsky <leon@kernel.org> To: Jason Wang <jasowang@redhat.com> Cc: Eli Cohen <elic@nvidia.com>, mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vdp/mlx5: Fix setting the correct dma_device Date: Fri, 4 Jun 2021 18:57:39 +0300 [thread overview] Message-ID: <YLpNc5WsBWQ5f4cl@unreal> (raw) In-Reply-To: <864e8d21-22d4-7735-817b-f88ec0126f87@redhat.com> 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") Thanks > > > > Signed-off-by: Eli Cohen <elic@nvidia.com> > > > 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
WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org> To: Jason Wang <jasowang@redhat.com> Cc: Eli Cohen <elic@nvidia.com>, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, mst@redhat.com Subject: Re: [PATCH] vdp/mlx5: Fix setting the correct dma_device Date: Fri, 4 Jun 2021 18:57:39 +0300 [thread overview] Message-ID: <YLpNc5WsBWQ5f4cl@unreal> (raw) In-Reply-To: <864e8d21-22d4-7735-817b-f88ec0126f87@redhat.com> 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") Thanks > > > > Signed-off-by: Eli Cohen <elic@nvidia.com> > > > 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 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-06-04 15:57 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-03 11:22 [PATCH] vdp/mlx5: Fix setting the correct dma_device Eli Cohen 2021-06-04 2:35 ` Jason Wang 2021-06-04 2:35 ` Jason Wang 2021-06-04 15:57 ` Leon Romanovsky [this message] 2021-06-04 15:57 ` Leon Romanovsky 2021-06-07 2:30 ` Jason Wang 2021-06-07 2:30 ` Jason Wang 2021-06-07 5:51 ` Leon Romanovsky 2021-06-07 5:51 ` Leon Romanovsky
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YLpNc5WsBWQ5f4cl@unreal \ --to=leon@kernel.org \ --cc=elic@nvidia.com \ --cc=jasowang@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=mst@redhat.com \ --cc=virtualization@lists.linux-foundation.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.