vdp/mlx5: Fix setting the correct dma_device
authorEli Cohen <elic@nvidia.com>
Sun, 6 Jun 2021 05:31:50 +0000 (08:31 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 3 Jul 2021 08:50:57 +0000 (04:50 -0400)
commit7d23dcdf213c2e5f097eb7eec3148c26eb01d59f
tree4ebc8fd04fd85cee032e015c11bb5c6a57dabbcf
parente13cd45d352dedac53529fb49e7d7e293f74fb90
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.

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>
drivers/vdpa/mlx5/core/mr.c
drivers/vdpa/mlx5/net/mlx5_vnet.c