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 7D1B5A0540 for ; Wed, 6 Jul 2022 22:36:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77FAB40691; Wed, 6 Jul 2022 22:36:19 +0200 (CEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 5450840691 for ; Wed, 6 Jul 2022 22:36:18 +0200 (CEST) Received: by mail-wm1-f42.google.com with SMTP id l68so9466268wml.3 for ; Wed, 06 Jul 2022 13:36:18 -0700 (PDT) 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=vta1Kjwm7mIzG6i/dYuaI9THAZchE3DByVCBhqdX36A=; b=dVn/+0rOQTvjHnKQbgptNnHKEaDEB3jwSdh+OqfPl1Z2FKm4QPvnKKXJ9UUsBqWd02 ZkDnOZOGWj4dWpKEHbTzjKVqycKXteKDAYvKW+bfQYEwgLGFuCLFvZ0q+hGSTgWFG9Vk 0yUd5g5ZDD4pF2Zm843wx6qordDDJI0pMVqqLTB+p+u26LUbb0hvGYtS0rEEiS3XczPP v5aVEBfg8GcAmgmHfVJmybw1QcqdyeqSAc1Inmgo3XLI3cUCBLBkRlt0mmKZF2mSZYIt 0MeWultFD1IYXLgSQWcGEKo2HrNC1/aMeU+0YRHCMPuLe8gMdE6sOiRQOYtVdYSyLPYG 0hwg== 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=vta1Kjwm7mIzG6i/dYuaI9THAZchE3DByVCBhqdX36A=; b=5PE0Th+7nPzwjDPYQnj8MIKSnrj1dlkXafYGfQ3wm7YIokR3IxQZqBvEW1cciWkbNm sGIctcVssY9Q3yXFaTiUbTmgQ5GMgFeSrz/08rtdRlzuXhomF/9hbduwJgQciU8Aq+Df l8Xb0njJYot6UPrOS++Av3WFt0AKFtUoq8MpRhxbszp/+p8B9zZ9Yi3tAcPZpRU9DpdO qsLxVb1Uvh+0AwKSUSlHjXKJUVKAorwpDJTMu5MtSSkAszh/3CJ2Y76kRK7RmkDAnIoq mQC3c0J4/gUrLbfPyq+Cr97oBQUOeYBrQH5T9CIAqNHPzq7L/31GV4SZjV9wWf3DI0c6 dC8g== X-Gm-Message-State: AJIora/+JqsqgTvI+3JwEPlMGqTBCkLWQ2hZPq4XGf43ERxYQ29xbW7y weDDNIDiDKm7zDHK51an3UVZT4kp79+JlQ== X-Google-Smtp-Source: AGRyM1sMrRMVkRMfCykm49Ymwh2pQ95q8lPW+FzkNiTN6xnPy7p8lEaXch5aiY4gASPcDTM10mINJA== X-Received: by 2002:a05:600c:48a8:b0:3a0:5622:2e20 with SMTP id j40-20020a05600c48a800b003a056222e20mr417423wmp.155.1657139778083; Wed, 06 Jul 2022 13:36:18 -0700 (PDT) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id m2-20020a05600c3b0200b0039c63f4bce0sm23012887wms.12.2022.07.06.13.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 13:36:17 -0700 (PDT) From: luca.boccassi@gmail.com To: Harry van Haaren Cc: Naga Harish K S V , dpdk stable Subject: patch 'service: fix lingering active status' has been queued to stable release 21.11.2 Date: Wed, 6 Jul 2022 21:34:56 +0100 Message-Id: <20220706203506.3422496-21-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220706203506.3422496-1-luca.boccassi@gmail.com> References: <20220628151938.2278711-26-ktraynor@redhat.com> <20220706203506.3422496-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 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/08/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/e46eb5a8dcd55b0499638c51680b0f8b228d2b2f Thanks. Luca Boccassi --- >From e46eb5a8dcd55b0499638c51680b0f8b228d2b2f Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Tue, 5 Jul 2022 13:32:07 +0000 Subject: [PATCH] service: fix lingering active status [ upstream commit 6550113be62d1bd27b2f2dc07d7a888ad9499006 ] This commit fixes an issue where calling rte_service_lcore_stop() would result in a service's "active on lcore" status becoming stale. The stale status would result in rte_service_may_be_active() always returning "1", indicating that the service is not certainly stopped. This is fixed by ensuring the "active on lcore" status of each service is set to 0 when an lcore is stopped. Fixes: e30dd31847d2 ("service: add mechanism for quiescing") Fixes: 8929de043eb4 ("service: retrieve lcore active state") Reported-by: Naga Harish K S V Signed-off-by: Harry van Haaren --- lib/eal/common/rte_service.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c index bd8fb72e78..e76c2baffc 100644 --- a/lib/eal/common/rte_service.c +++ b/lib/eal/common/rte_service.c @@ -764,7 +764,9 @@ rte_service_lcore_stop(uint32_t lcore) return -EALREADY; uint32_t i; - uint64_t service_mask = lcore_states[lcore].service_mask; + struct core_state *cs = &lcore_states[lcore]; + uint64_t service_mask = cs->service_mask; + for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { int32_t enabled = service_mask & (UINT64_C(1) << i); int32_t service_running = rte_service_runstate_get(i); @@ -772,6 +774,11 @@ rte_service_lcore_stop(uint32_t lcore) __atomic_load_n(&rte_services[i].num_mapped_cores, __ATOMIC_RELAXED)); + /* Switch off this core for all services, to ensure that future + * calls to may_be_active() know this core is switched off. + */ + cs->service_active_on_lcore[i] = 0; + /* if the core is mapped, and the service is running, and this * is the only core that is mapped, the service would cease to * run if this core stopped, so fail instead. -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-06 21:07:54.281402516 +0100 +++ 0021-service-fix-lingering-active-status.patch 2022-07-06 21:07:53.555518938 +0100 @@ -1 +1 @@ -From 6550113be62d1bd27b2f2dc07d7a888ad9499006 Mon Sep 17 00:00:00 2001 +From e46eb5a8dcd55b0499638c51680b0f8b228d2b2f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6550113be62d1bd27b2f2dc07d7a888ad9499006 ] + @@ -25 +27 @@ -index ef31b1f63c..d2b7275ac0 100644 +index bd8fb72e78..e76c2baffc 100644 @@ -28 +30 @@ -@@ -758,7 +758,9 @@ rte_service_lcore_stop(uint32_t lcore) +@@ -764,7 +764,9 @@ rte_service_lcore_stop(uint32_t lcore) @@ -39 +41 @@ -@@ -766,6 +768,11 @@ rte_service_lcore_stop(uint32_t lcore) +@@ -772,6 +774,11 @@ rte_service_lcore_stop(uint32_t lcore)