patch 'vdpa/mlx5: fix unregister kick handler order' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:21:47 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/15/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=9e7a4f889b0ca1755be668113f3ae991927c38a0

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 9e7a4f889b0ca1755be668113f3ae991927c38a0 Mon Sep 17 00:00:00 2001
From: Yajun Wu <yajunw at nvidia.com>
Date: Tue, 8 Aug 2023 19:32:21 +0800
Subject: [PATCH] vdpa/mlx5: fix unregister kick handler order
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 72ec059a1ca91c52c6139cfc32133d643f709986 ]

The mlx5_vdpa_virtq_kick_handler function may still be running and waiting
on virtq->virtq_lock while mlx5_vdpa_cqe_event_unset function is trying to
re-initialize the virtq->virtq_lock.

This causes mlx5_vdpa_virtq_kick_handler thread can't be wake up and can't
be unregister. Following print may loop forever when calling
rte_vhost_driver_unregister(socket_path):

    mlx5_vdpa: Try again to unregister fd 154 of virtq 11 interrupt
    mlx5_vdpa: Try again to unregister fd 154 of virtq 11 interrupt
    ...

The fix is to move mlx5_vdpa_virtq_unregister_intr_handle before
mlx5_vdpa_cqe_event_unset.

Fixes: 057f7d208499 ("vdpa/mlx5: optimize datapath-control synchronization")

Signed-off-by: Yajun Wu <yajunw at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa.c         | 1 +
 drivers/vdpa/mlx5/mlx5_vdpa_cthread.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 026daa3f24..8bcbedd071 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -282,6 +282,7 @@ _internal_mlx5_vdpa_dev_close(struct mlx5_vdpa_priv *priv,
 	int ret = 0;
 	int vid = priv->vid;

+	mlx5_vdpa_virtq_unreg_intr_handle_all(priv);
 	mlx5_vdpa_cqe_event_unset(priv);
 	if (priv->state == MLX5_VDPA_STATE_CONFIGURED) {
 		ret |= mlx5_vdpa_lm_log(priv);
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c b/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
index 6e6624e5a3..1d84e422d4 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_cthread.c
@@ -190,7 +190,6 @@ mlx5_vdpa_c_thread_handle(void *arg)
 			pthread_mutex_unlock(&virtq->virtq_lock);
 			break;
 		case MLX5_VDPA_TASK_DEV_CLOSE_NOWAIT:
-			mlx5_vdpa_virtq_unreg_intr_handle_all(priv);
 			pthread_mutex_lock(&priv->steer_update_lock);
 			mlx5_vdpa_steer_unset(priv);
 			pthread_mutex_unlock(&priv->steer_update_lock);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:37.217768600 +0800
+++ 0078-vdpa-mlx5-fix-unregister-kick-handler-order.patch	2023-10-22 22:17:34.296723700 +0800
@@ -1 +1 @@
-From 72ec059a1ca91c52c6139cfc32133d643f709986 Mon Sep 17 00:00:00 2001
+From 9e7a4f889b0ca1755be668113f3ae991927c38a0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 72ec059a1ca91c52c6139cfc32133d643f709986 ]
@@ -22 +24,0 @@
-Cc: stable at dpdk.org
@@ -33 +35 @@
-index 01a5877d08..f900384aeb 100644
+index 026daa3f24..8bcbedd071 100644
@@ -45 +47 @@
-index 1a5fd3eb17..68ed841efc 100644
+index 6e6624e5a3..1d84e422d4 100644
@@ -48 +50 @@
-@@ -189,7 +189,6 @@ mlx5_vdpa_c_thread_handle(void *arg)
+@@ -190,7 +190,6 @@ mlx5_vdpa_c_thread_handle(void *arg)


More information about the stable mailing list