patch 'ipc: end multiprocess thread during cleanup' has been queued to stable release 19.11.12

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Fri Feb 25 18:15:42 CET 2022


Hi,

FYI, your patch has been queued to stable release 19.11.12

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/27/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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/e24d07f803c29ad22afdf4dfc5cfb2cdfc080e48

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From e24d07f803c29ad22afdf4dfc5cfb2cdfc080e48 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Sat, 13 Nov 2021 09:22:54 -0800
Subject: [PATCH] ipc: end multiprocess thread during cleanup

[ upstream commit 6e858b4d9244cf53505589673755ab18ac2a4a83 ]

When rte_eal_cleanup is called, all control threads should exit.
For the mp thread, this best handled by closing the mp_socket
and letting the thread see that.

This also fixes potential problems where the mp_socket gets
another hard error, and the thread runs away repeating itself
by reading the same error.

Fixes: 85d6815fa6d0 ("eal: close multi-process socket during cleanup")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/common/eal_common_proc.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index ac2ddb01a5..d88a1ebafb 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -277,8 +277,17 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
 	msgh.msg_control = control;
 	msgh.msg_controllen = sizeof(control);
 
+retry:
 	msglen = recvmsg(mp_fd, &msgh, 0);
+
+	/* zero length message means socket was closed */
+	if (msglen == 0)
+		return 0;
+
 	if (msglen < 0) {
+		if (errno == EINTR)
+			goto retry;
+
 		RTE_LOG(ERR, EAL, "recvmsg failed, %s\n", strerror(errno));
 		return -1;
 	}
@@ -306,7 +315,7 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
 		RTE_LOG(ERR, EAL, "invalid received data length\n");
 		return -1;
 	}
-	return 0;
+	return msglen;
 }
 
 static void
@@ -378,8 +387,13 @@ mp_handle(void *arg __rte_unused)
 	struct sockaddr_un sa;
 
 	while (mp_fd >= 0) {
-		if (read_msg(&msg, &sa) == 0)
-			process_msg(&msg, &sa);
+		int ret;
+
+		ret = read_msg(&msg, &sa);
+		if (ret <= 0)
+			break;
+
+		process_msg(&msg, &sa);
 	}
 
 	return NULL;
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.124739834 +0100
+++ 0049-ipc-end-multiprocess-thread-during-cleanup.patch	2022-02-25 16:58:44.292990460 +0100
@@ -1 +1 @@
-From 6e858b4d9244cf53505589673755ab18ac2a4a83 Mon Sep 17 00:00:00 2001
+From e24d07f803c29ad22afdf4dfc5cfb2cdfc080e48 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6e858b4d9244cf53505589673755ab18ac2a4a83 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
- lib/eal/common/eal_common_proc.c | 20 +++++++++++++++++---
+ lib/librte_eal/common/eal_common_proc.c | 20 +++++++++++++++++---
@@ -23,5 +24,5 @@
-diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
-index ebd0f6673b..b33d58ea0a 100644
---- a/lib/eal/common/eal_common_proc.c
-+++ b/lib/eal/common/eal_common_proc.c
-@@ -282,8 +282,17 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
+diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
+index ac2ddb01a5..d88a1ebafb 100644
+--- a/lib/librte_eal/common/eal_common_proc.c
++++ b/lib/librte_eal/common/eal_common_proc.c
+@@ -277,8 +277,17 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
@@ -45 +46 @@
-@@ -311,7 +320,7 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
+@@ -306,7 +315,7 @@ read_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
@@ -54 +55 @@
-@@ -385,8 +394,13 @@ mp_handle(void *arg __rte_unused)
+@@ -378,8 +387,13 @@ mp_handle(void *arg __rte_unused)


More information about the stable mailing list