patch 'vdpa/mlx5: fix interrupt trash that leads to crash' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:01:37 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/23/22. 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://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/e8971ff299aa5167879e6c995b6da935e62194ee

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From e8971ff299aa5167879e6c995b6da935e62194ee Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl at nvidia.com>
Date: Sun, 8 May 2022 17:25:48 +0300
Subject: [PATCH] vdpa/mlx5: fix interrupt trash that leads to crash
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 66a439c5d7c166347adc799fcc928058e16ac23d ]

Disable interrupt unregister timeout to avoid invalid FD caused
interrupt thread segment fault.

Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell")

Signed-off-by: Xueming Li <xuemingl at nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
index 3d19cf5edb..c8c615054a 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
@@ -17,7 +17,7 @@
 
 
 static void
-mlx5_vdpa_virtq_handler(void *cb_arg)
+mlx5_vdpa_virtq_kick_handler(void *cb_arg)
 {
 	struct mlx5_vdpa_virtq *virtq = cb_arg;
 	struct mlx5_vdpa_priv *priv = virtq->priv;
@@ -55,19 +55,16 @@ static int
 mlx5_vdpa_virtq_unset(struct mlx5_vdpa_virtq *virtq)
 {
 	unsigned int i;
-	int retries = MLX5_VDPA_INTR_RETRIES;
 	int ret = -EAGAIN;
 
-	if (virtq->intr_handle.fd != -1) {
-		while (retries-- && ret == -EAGAIN) {
+	if (virtq->intr_handle.fd >= 0) {
+		while (ret == -EAGAIN) {
 			ret = rte_intr_callback_unregister(&virtq->intr_handle,
-							mlx5_vdpa_virtq_handler,
-							virtq);
+					mlx5_vdpa_virtq_kick_handler, virtq);
 			if (ret == -EAGAIN) {
-				DRV_LOG(DEBUG, "Try again to unregister fd %d "
-					"of virtq %d interrupt, retries = %d.",
+				DRV_LOG(DEBUG, "Try again to unregister fd %d of virtq %hu interrupt",
 					virtq->intr_handle.fd,
-					(int)virtq->index, retries);
+					virtq->index);
 				usleep(MLX5_VDPA_INTR_RETRIES_USEC);
 			}
 		}
@@ -340,7 +337,7 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
 	} else {
 		virtq->intr_handle.type = RTE_INTR_HANDLE_EXT;
 		if (rte_intr_callback_register(&virtq->intr_handle,
-					       mlx5_vdpa_virtq_handler,
+					       mlx5_vdpa_virtq_kick_handler,
 					       virtq)) {
 			virtq->intr_handle.fd = -1;
 			DRV_LOG(ERR, "Failed to register virtq %d interrupt.",
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:50.740757735 +0800
+++ 0031-vdpa-mlx5-fix-interrupt-trash-that-leads-to-crash.patch	2022-06-21 15:37:49.007784479 +0800
@@ -1 +1 @@
-From 66a439c5d7c166347adc799fcc928058e16ac23d Mon Sep 17 00:00:00 2001
+From e8971ff299aa5167879e6c995b6da935e62194ee Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 66a439c5d7c166347adc799fcc928058e16ac23d ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -15,2 +17,2 @@
- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 20 ++++++++------------
- 1 file changed, 8 insertions(+), 12 deletions(-)
+ drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
@@ -19 +21 @@
-index 3416797d28..2e517beda2 100644
+index 3d19cf5edb..c8c615054a 100644
@@ -31 +33 @@
-@@ -59,20 +59,16 @@ static int
+@@ -55,19 +55,16 @@ static int
@@ -38 +40 @@
--	if (rte_intr_fd_get(virtq->intr_handle) != -1) {
+-	if (virtq->intr_handle.fd != -1) {
@@ -40 +42 @@
-+	if (rte_intr_fd_get(virtq->intr_handle) >= 0) {
++	if (virtq->intr_handle.fd >= 0) {
@@ -42 +44 @@
- 			ret = rte_intr_callback_unregister(virtq->intr_handle,
+ 			ret = rte_intr_callback_unregister(&virtq->intr_handle,
@@ -48,4 +50 @@
--				"of virtq %d interrupt, retries = %d.",
--				rte_intr_fd_get(virtq->intr_handle),
--				(int)virtq->index, retries);
--
+-					"of virtq %d interrupt, retries = %d.",
@@ -53 +52,2 @@
-+					rte_intr_fd_get(virtq->intr_handle),
+ 					virtq->intr_handle.fd,
+-					(int)virtq->index, retries);
@@ -58,4 +58,4 @@
-@@ -359,7 +355,7 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
- 			goto error;
- 
- 		if (rte_intr_callback_register(virtq->intr_handle,
+@@ -340,7 +337,7 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
+ 	} else {
+ 		virtq->intr_handle.type = RTE_INTR_HANDLE_EXT;
+ 		if (rte_intr_callback_register(&virtq->intr_handle,
@@ -65 +65 @@
- 			rte_intr_fd_set(virtq->intr_handle, -1);
+ 			virtq->intr_handle.fd = -1;


More information about the stable mailing list