All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
@ 2020-09-07  7:51 Eli Cohen
  2020-09-07 10:53   ` Jason Wang
  2020-09-07 11:34   ` Michael S. Tsirkin
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Cohen @ 2020-09-07  7:51 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Cindy Lu, virtualization, netdev

If the memory map changes before the driver status is
VIRTIO_CONFIG_S_DRIVER_OK, don't attempt to create resources because it
may fail. For example, if the VQ is not ready there is no point in
creating resources.

Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Eli Cohen <elic@nvidia.com>
---
 drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 9df69d5efe8c..c89cd48a0aab 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -1645,6 +1645,9 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_net *ndev, struct vhost_iotlb *
 	if (err)
 		goto err_mr;
 
+	if (!(ndev->mvdev.status & VIRTIO_CONFIG_S_DRIVER_OK))
+		return 0;
+
 	restore_channels_info(ndev);
 	err = setup_driver(ndev);
 	if (err)
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-09  2:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-07  7:51 [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK Eli Cohen
2020-09-07 10:53 ` Jason Wang
2020-09-07 10:53   ` Jason Wang
2020-09-07 11:03   ` Eli Cohen
2020-09-09  2:06     ` Jason Wang
2020-09-09  2:06       ` Jason Wang
2020-09-07 11:34 ` Michael S. Tsirkin
2020-09-07 11:34   ` Michael S. Tsirkin
2020-09-07 11:43   ` Eli Cohen
2020-09-08 12:04     ` Michael S. Tsirkin
2020-09-08 12:04       ` Michael S. Tsirkin

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.