aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Cohen <[email protected]>2021-09-09 09:37:38 +0300
committerMichael S. Tsirkin <[email protected]>2021-09-14 18:10:43 -0400
commit759be8993b1b40e05b8908583336b8e230e67b08 (patch)
tree9558cc954ec8d299513315a374b2061d4fd2240f
parentef12e4bf4276a07fd350179fa63d0d337ea0a867 (diff)
vdpa/mlx5: Avoid executing set_vq_ready() if device is reset
Avoid executing set_vq_ready() if the device has been reset. In such case, the features are cleared and cannot be used in conditional statements. Such reference happens is the function ctrl_vq_idx(). Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Eli Cohen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
-rw-r--r--drivers/vdpa/mlx5/net/mlx5_vnet.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 64dfd0f500d2..bd56de7484dc 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -1714,6 +1714,9 @@ static void mlx5_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready
struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
struct mlx5_vdpa_virtqueue *mvq;
+ if (!mvdev->actual_features)
+ return;
+
if (!is_index_valid(mvdev, idx))
return;