vdp/mlx5: Fix setting the correct dma_device
Subsystems (2)
PATCH 1/1 vdp/mlx5: Fix setting the correct dma_device
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.
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/net/mlx5_vnet.c +1 -1
@@ -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;
Signature · 1 line
2.31.1
Quoted 8 lines · Eli Cohen
Before SF support was introduced, the DMA device was equal to
mdev->devicewhich was in essence equal topdev->dev;
With SF introduction this is no longer true. It has already been handled forvhost_vdpasince the reference to the dma device can from withinmlx5_vdpa. Withvirtio_vdpathis 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.
Quoted 1 line
Signed-off-by Eli Cohen <[email protected]>
Patch looks correct.
Thanks
Quoted 17 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +1
-1@@ -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;
Quoted 9 lines · Jason Wang
Quoted 7 lines · Eli Cohen
Before SF support was introduced, the DMA device was equal to
mdev->devicewhich was in essence equal topdev->dev;
With SF introduction this is no longer true. It has already been handled forvhost_vdpasince the reference to the dma device can from withinmlx5_vdpa. Withvirtio_vdpathis broke. To fix this we set the real dma device when initializing the device.
Quoted 5 lines
Quoted 1 line
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
Quoted 31 lines
Quoted 3 lines
Signed-off-by Eli Cohen <[email protected]>Patch looks correct.
Thanks
Quoted 9 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +0
-0drivers/vdpa/mlx5/net/mlx5_vnet.c static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name) · line 2051
Quoted 7 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +1
-1@@ -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
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 18 lines · Leon Romanovsky
Quoted 8 lines · Jason Wang
Quoted 7 lines · Eli Cohen
Before SF support was introduced, the DMA device was equal to
mdev->devicewhich was in essence equal topdev->dev;
With SF introduction this is no longer true. It has already been handled forvhost_vdpasince the reference to the dma device can from withinmlx5_vdpa. Withvirtio_vdpathis broke. To fix this we set the real dma device when initializing the device.Quoted 4 lines
Quoted 1 line
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...
Review
Quoted 4 lines
(quoted diff) +2
-0+ 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.
Thanks
Quoted 31 lines
Thanks
Quoted 28 lines
Quoted 2 lines
Signed-off-by Eli Cohen <[email protected]>Patch looks correct.
Thanks
Quoted 9 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +0
-0drivers/vdpa/mlx5/net/mlx5_vnet.c static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name) · line 2051
Quoted 7 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +1
-1@@ -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
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 28 lines · Jason Wang
Quoted 18 lines · Leon Romanovsky
Quoted 8 lines · Jason Wang
Quoted 7 lines · Eli Cohen
Before SF support was introduced, the DMA device was equal to
mdev->devicewhich was in essence equal topdev->dev;
With SF introduction this is no longer true. It has already been handled forvhost_vdpasince the reference to the dma device can from withinmlx5_vdpa. Withvirtio_vdpathis broke. To fix this we set the real dma device when initializing the device.Quoted 4 lines
Quoted 1 line
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...
Review
Quoted 4 lines
(quoted diff) +2
-0+ 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:
Quoted 7 lines
"
With SF introduction this is no longer true.
"
It works before SF is introduced.
Yes, you are right, sorry for the noise.
Quoted 36 lines
Thanks
Quoted 31 lines
Thanks
Quoted 28 lines
Quoted 2 lines
Signed-off-by Eli Cohen <[email protected]>Patch looks correct.
Thanks
Quoted 9 lines
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vdpa/mlx5/net/mlx5_vnet.c +0
-0drivers/vdpa/mlx5/net/mlx5_vnet.c static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name) · line 2051
Quoted 7 lines
drivers/vdpa/mlx5/net/mlx5_vnet.c +1
-1@@ -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
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization