From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70C71A034C for ; Fri, 25 Feb 2022 18:18:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B79541148; Fri, 25 Feb 2022 18:18:13 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id C062941148 for ; Fri, 25 Feb 2022 18:18:12 +0100 (CET) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 24E153FE4B for ; Fri, 25 Feb 2022 17:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645809491; bh=v4TNbmAGQMFVVLju6sonJIaBxf2mNidebfh78EpYH4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tLYiExAF9FZbWxDCu1i0GORnfbYs/07+eGy3jHxYibnSm8yURxgaFwNyznIblHakG yMsu57ZkJk+OxigHcDFmwtaTH4GEw2YgghapSU/MtBKipu8sv4jUiy7xeCdne+DCTC aUGEhkbPijiMYW0mvavW63Gtmp4o2MHKIpmuHfEBjSl8k9rZIN/lx2WT8N0zzNaXqY S3eFtakrxs0xVKF6wwhEjMblfHdH9t2RgiH32DAiuZmIvzX67HgRPgO+nqmqEFSTTy k0v53AnBgNX277wKgRYmDLvzq1HoK0AUCV2R/RHnhGK3G1Wp8vlKRaUM8a0h4FAKSP SvtkT3zyEBXpg== Received: by mail-wm1-f72.google.com with SMTP id w3-20020a7bc743000000b0037c5168b3c4so1834335wmk.7 for ; Fri, 25 Feb 2022 09:18:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v4TNbmAGQMFVVLju6sonJIaBxf2mNidebfh78EpYH4Y=; b=Oi1LlTOtJ9x2mQICRlhxmepIYlB4Ofpbm92DKpM/dwibpj+tiqyeVO7VY+Y7H63oOw RfmXaxCGTZgR1YUuUFNkg7FDpeEq1ROL5Kl64r6WCqOyjrrfzsHUbU+6a9SKTKAO4JHq ukYvRUptepy5EeuUI5wcZiKtYl78PUYS7o37UyVPHqR3dQiRztTASlObHv0Xvx0uVg1D nbCNU3F3zQt6jJrun/EQNMhaNDDHp5uonmbFVljjV8Gfehcch6/JMiWTAIdK31eNKw44 a7G4laN/6/sKerL/1o9PPwxId/k7waFXklLcquaaiZf4e2j4DDoHgPzGQbsFwPbS+CYL s0PQ== X-Gm-Message-State: AOAM532mfCzC22YsusS9oV1/5pv3gYCbnw0AlDdpwF6XNm87I+2Czx4L SBfq/KQCk6YVVvBT9kUlyF1ek6oxnMLJTpzyi+tnu+pGDk1juKYQ+4jbKftbgojFue/eBG0Ewk6 JyxO3g76yev2DNcrRvQ18uKFr X-Received: by 2002:adf:e344:0:b0:1ed:9ce7:2d33 with SMTP id n4-20020adfe344000000b001ed9ce72d33mr6611898wrj.289.1645809490146; Fri, 25 Feb 2022 09:18:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXQWjkXG3vdLYobm9Q7A0xtmEOqpFftiNQ50WmRg5EjA8TVVotvUizn90lzKat71gn+Uqssg== X-Received: by 2002:adf:e344:0:b0:1ed:9ce7:2d33 with SMTP id n4-20020adfe344000000b001ed9ce72d33mr6611881wrj.289.1645809489935; Fri, 25 Feb 2022 09:18:09 -0800 (PST) Received: from Keschdeichel.fritz.box (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id s11-20020a5d69cb000000b001ef5b49d68esm3039655wrw.37.2022.02.25.09.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 09:18:09 -0800 (PST) From: christian.ehrhardt@canonical.com To: Stephen Hemminger Cc: Anatoly Burakov , dpdk stable Subject: patch 'ipc: end multiprocess thread during cleanup' has been queued to stable release 19.11.12 Date: Fri, 25 Feb 2022 18:15:42 +0100 Message-Id: <20220225171550.3499040-49-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> References: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- >From e24d07f803c29ad22afdf4dfc5cfb2cdfc080e48 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger 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 Acked-by: Anatoly Burakov --- 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@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)