Skip to content

Commit 1897f0b

Browse files
elic307imstsirkin
authored andcommitted
vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
set_map() is used by mlx5 vdpa to create a memory region based on the address map passed by the iotlb argument. If we get successive calls, we will destroy the current memory region and build another one based on the new address mapping. We also need to setup the hardware resources since they depend on the memory region. If these calls happen before DRIVER_OK, It means that driver VQs may also not been setup and we may not create them yet. In this case we want to avoid setting up the other resources and defer this till we get DRIVER OK. Fixes: 1a86b37 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20200908123346.GA169007@mtl-vdi-166.wap.labs.mlnx Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 4ce1cf7 commit 1897f0b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,9 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_net *ndev, struct vhost_iotlb *
16581658
if (err)
16591659
goto err_mr;
16601660

1661+
if (!(ndev->mvdev.status & VIRTIO_CONFIG_S_DRIVER_OK))
1662+
return 0;
1663+
16611664
restore_channels_info(ndev);
16621665
err = setup_driver(ndev);
16631666
if (err)

0 commit comments

Comments
 (0)