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 CF2DAA0032 for ; Fri, 18 Feb 2022 13:45:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA40E40141; Fri, 18 Feb 2022 13:45:07 +0100 (CET) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mails.dpdk.org (Postfix) with ESMTP id A51B940141 for ; Fri, 18 Feb 2022 13:45:06 +0100 (CET) Received: by mail-ed1-f54.google.com with SMTP id s24so8863198edr.5 for ; Fri, 18 Feb 2022 04:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bwIAiH9iMXx9kQt7w3je/bhC7O0J5a2PPgfUDIWznBo=; b=EOQPVMd7+aK7uorgmvR+GdDWhS72+SP+l9Y/SSvvFJ6K3WkGQtpZ3Izmt4ARGiNxeB CXAXEMyUHI73wk1d6n1FVIPcAK4W5JRg6S4SNhEi+rPd+lRVjJsGynkCzky/WBa0oHjg P1pr2szlPFB4gAsluai8N0vckOpTw0lFGj2D3GkNhhlnIoBZgW5AdEJk2xCocwu6YPuT ENcbykg+wMDtQ3x8nIhNBte1pj+L+hvB+Dj1r5rlfyAsE4N+gPY93LYY0kLDr6XsApS9 4BrcYgsZngmuGteQSCVKaUs2tFQCYH1olr1tDSYYUO98CDrncYEdKv2mxp31STcOfF0i JqTA== 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=bwIAiH9iMXx9kQt7w3je/bhC7O0J5a2PPgfUDIWznBo=; b=zlhfEk62Ee/ebNHR0TYjeYbeqW2yuQjCCDQTwCTm/ZCmN3XlQ+QL9Ogbs5LQWWiGGX 7WOdJvH403OO4GQzNUoac/vRON8lfNFszmSQgriGQBQpg2giazpl/d+Xr9KSOlIy4R+1 UlbwQ1s9ascttzihXbwkvFhTOwFF+iqM/MikVkoNxryG3+d7x3AiNKybvTpxQ5mJMfkh lmNov6dpCm5HOd/MXKRjy3W3REJxWjRIx/Mw7gFaNkB+OrQq95tFrfwAjzyK50QCOnCi zyNUp51EDoQcA68WgZ7Sbz77UnJ+Ao8LRRF4QdTX7jLM1cd3aLtm0baYCMqlEMPcIIkv jfXg== X-Gm-Message-State: AOAM5338hEbBkOAS22adFIiM/JFnh/FJHP+ZnVmNU2aJd2TDMnYcpPHl taRfxBr6O25ZifQqV51FnIc= X-Google-Smtp-Source: ABdhPJz7V9nwWZ7qvKsYk7aUOgZq7gw8DskFsb+NU6bDx1GQQenBmmHcEyJ+1KaHhgc0RyvBIETQrg== X-Received: by 2002:a05:6402:518b:b0:412:80a3:fb6e with SMTP id q11-20020a056402518b00b0041280a3fb6emr8267934edd.84.1645188306039; Fri, 18 Feb 2022 04:45:06 -0800 (PST) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id s19sm1914393edx.60.2022.02.18.04.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:45:05 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Anatoly Burakov , dpdk stable Subject: patch 'ipc: end multiprocess thread during cleanup' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:39:16 +0000 Message-Id: <20220218123931.1749595-107-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.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 20.11.5 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/20/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/184d1f7ae077a91a0ec4e4bf12b17b1a15bf126d Thanks. Luca Boccassi --- >From 184d1f7ae077a91a0ec4e4bf12b17b1a15bf126d 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 ebd0f6673b..b33d58ea0a 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -282,8 +282,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; } @@ -311,7 +320,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 @@ -385,8 +394,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.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:41.893601203 +0000 +++ 0107-ipc-end-multiprocess-thread-during-cleanup.patch 2022-02-18 12:37:37.842795315 +0000 @@ -1 +1 @@ -From 6e858b4d9244cf53505589673755ab18ac2a4a83 Mon Sep 17 00:00:00 2001 +From 184d1f7ae077a91a0ec4e4bf12b17b1a15bf126d 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 +24 @@ -diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c +diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c @@ -25,2 +26,2 @@ ---- a/lib/eal/common/eal_common_proc.c -+++ b/lib/eal/common/eal_common_proc.c +--- a/lib/librte_eal/common/eal_common_proc.c ++++ b/lib/librte_eal/common/eal_common_proc.c