Skip to contentSkip to conversation

vdpa/mlx5: Avoid executing set_vq_ready() if device is reset

PATCH Jason Wang 1 participant 1 message Sep 14, 2021 1 message not in the archive virtio core

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jason Wang

author Acked-by
#1 lore raw
Quoted 7 lines · Eli Cohen

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 9c90709cf8e7 ("vdpa/mlx5: Add multiqueue support")
Quoted 19 lines
---
 drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/vdpa/mlx5/net/mlx5_vnet.c +3 -1
index 64dfd0f500d2..bd56de7484dc 100644
@@ -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;
 
--
Quoted 2 lines

2.32.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization