Skip to contentSkip to conversation

vdpa/mlx5: workaround queue stop with traffic

PATCH Applied Matan Azrad 3 participants 3 messages Nov 22, 2021 – Jan 27, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vdpa/mlx5: workaround queue stop with traffic

When the event thread polls traffic and a virtq is stopping, the FW loses synchronization in the virtq indexes.

It causes LM failure on synchronization between the HOST indexes to the GUEST indexes.

Unset the event thread before the queue stop in the LM process.

Fixes 31b9c29c86af ("vdpa/mlx5: support close and config operations")
---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +2 -2
index b9e84dd9bf..8dfaba791d 100644
@@ -250,10 +250,10 @@ mlx5_vdpa_dev_close(int vid)
 		DRV_LOG(ERR, "Invalid vDPA device: %s.", vdev->device->name);
 		return -1;
 	}
-	if (priv->configured)
-		ret |= mlx5_vdpa_lm_log(priv);
 	mlx5_vdpa_err_event_unset(priv);
 	mlx5_vdpa_cqe_event_unset(priv);
+	if (priv->configured)
+		ret |= mlx5_vdpa_lm_log(priv);
 	mlx5_vdpa_steer_unset(priv);
 	mlx5_vdpa_virtqs_release(priv);
 	mlx5_vdpa_event_qp_global_release(priv);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Matan Azrad

When the event thread polls traffic and a virtq is stopping, the FW loses synchronization in the virtq indexes.

It causes LM failure on synchronization between the HOST indexes to the GUEST indexes.

Unset the event thread before the queue stop in the LM process.

Fixes 31b9c29c86af ("vdpa/mlx5: support close and config operations")
---
  drivers/vdpa/mlx5/mlx5_vdpa.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vdpa/mlx5/mlx5_vdpa.c +0 -0
index b9e84dd9bf..8dfaba791d 100644
@@ -250,10 +250,10 @@ mlx5_vdpa_dev_close(int vid)
  		DRV_LOG(ERR, "Invalid vDPA device: %s.", vdev->device->name);
  		return -1;

drivers/vdpa/mlx5/mlx5_vdpa.c mlx5_vdpa_dev_close(int vid) · line 259

Quoted 10 lines
drivers/vdpa/mlx5/mlx5_vdpa.c +2 -2
  	}
-	if (priv->configured)
-		ret |= mlx5_vdpa_lm_log(priv);
  	mlx5_vdpa_err_event_unset(priv);
  	mlx5_vdpa_cqe_event_unset(priv);
+	if (priv->configured)
+		ret |= mlx5_vdpa_lm_log(priv);
  	mlx5_vdpa_steer_unset(priv);
  	mlx5_vdpa_virtqs_release(priv);
  	mlx5_vdpa_event_qp_global_release(priv);

Thanks,
Maxime

Applied
#2 lore raw
In reply to Matan Azrad
Quoted 15 lines

-----Original Message-----
From: Matan Azrad <[email protected]>
Sent: Monday, November 22, 2021 9:13 PM
To: Maxime Coquelin <[email protected]>
Cc: [email protected]; [email protected]; Xueming Li <[email protected]>
Subject: [PATCH] vdpa/mlx5: workaround queue stop with traffic

When the event thread polls traffic and a virtq is stopping, the FW loses synchronization in the virtq indexes.

It causes LM failure on synchronization between the HOST indexes to the GUEST indexes.

Unset the event thread before the queue stop in the LM process.

Quoted 8 lines
Fixes 31b9c29c86af ("vdpa/mlx5: support close and config operations")

---
--
2.25.1

Applied to next-virtio/main, thanks