summaryrefslogtreecommitdiff
path: root/drivers/vdpa/mlx5/net
diff options
context:
space:
mode:
authorEli Cohen <elic@nvidia.com>2021-06-06 08:31:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-20 17:02:20 +0300
commit228e0a05ac884f3298b107230d5c1c248ea93840 (patch)
tree89bb98339927517edeb9ed1621ccee98bc3bba15 /drivers/vdpa/mlx5/net
parentfa9c2720c8008ac2d227acc0204d5f406103461f (diff)
downloadlinux-228e0a05ac884f3298b107230d5c1c248ea93840.tar.xz
vdp/mlx5: Fix setting the correct dma_device
[ Upstream commit 7d23dcdf213c2e5f097eb7eec3148c26eb01d59f ] 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. In addition, for the sake of consistency, previous references in the code to the dma device are changed to vdev->dma_dev. Fixes: d13a15d544ce5 ("vdpa/mlx5: Use the correct dma device when registering memory") Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20210606053150.170489-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/vdpa/mlx5/net')
-rw-r--r--drivers/vdpa/mlx5/net/mlx5_vnet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index d5ea956a3a3a..85bcbbce1ef9 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -2017,7 +2017,7 @@ static int mlx5v_probe(struct auxiliary_device *adev,
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_mpfs;