Skip to content

Commit

Permalink
vdpa/mlx5: Avoid executing set_vq_ready() if device is reset
Browse files Browse the repository at this point in the history
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: 5289373 ("vdpa/mlx5: Add multiqueue support")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210909063738.46970-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
Eli Cohen authored and Michael S. Tsirkin committed Sep 14, 2021
1 parent ef12e4b commit 759be89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/vdpa/mlx5/net/mlx5_vnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 759be89

Please sign in to comment.