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 6E4AAA0540 for ; Thu, 7 Jul 2022 09:59:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69107406B4; Thu, 7 Jul 2022 09:59:51 +0200 (CEST) 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 8FA14406B4 for ; Thu, 7 Jul 2022 09:59:49 +0200 (CEST) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.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 5C9313F6FC for ; Thu, 7 Jul 2022 07:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657180789; bh=4xf4LHa7nGw8dVAnfiGSeMWeA8Dpo2tlzwtB+1ejB6A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=td8IRv/fM45dg9Uwi80L0pdT2asu59pOxeyPJ1AYILlOONzKXXWrxwEvwIwT53UYL Yjd/v6QQyGpgD3vHb4Soio4hWxoWUld9a+pSdeCAMJJTCKP6C/z5huIzswGn37U95B aF0h50F8YGjLcip/o25/9g5FV26eRghfDCTEGM94EBPk5evG+pcQK2s8JSycnBapb0 XI80Y9JLsu+u0QQOICtt7quDuK5svIGc0u6sCpbITTis2puPPAEnmAscXvldJZTjUm MXXeX22fIbJFPT5NKfYIEZhvMOJWBsdpzLjD1YZHw4ImPBa/YEaY1AqESXYoJ/n1wM gEsrXwQxjExkQ== Received: by mail-ej1-f72.google.com with SMTP id x2-20020a1709065ac200b006d9b316257fso4430733ejs.12 for ; Thu, 07 Jul 2022 00:59:49 -0700 (PDT) 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=4xf4LHa7nGw8dVAnfiGSeMWeA8Dpo2tlzwtB+1ejB6A=; b=vKgftl981aeNOAArP/dgV6DDhqZ2uySGxhddN6fgw5L7sGtp3s0cp53PFt0lhY6YqB KoG3NLz/nky5AygfZ5TudJmri3fK1TO3gy3aXH9X3Qtl3srdVAbswOe072C9PRXzzDhK 9sXV5f80XRJjQizstkGZQXr8ukX9o3V32dWhY4inoaii33uyJrc+CDpnCsNP/S+Gn5CF AqChHM3Pp8HdKzpej8lWXIwK1EKzLgNkzq9BMPlcKP7+Y3byjEItS9Rd3BzgD6wB0qfN qdZuBy1bU7SNP7dJYRJRa+waEiHj9Z3jh+ne7+e78jX+7rjbV4DL8QAS/u1MiMEZjeUA CnUg== X-Gm-Message-State: AJIora8wHdP02WCacsmHp0L7Kd7xmS9/tCLSDtHLwEYjf7RIpcr7NUE8 rv5uX8Lg5zGWuRuT7Tv/c5xTz015ISh0Lb4yMNPStk3dmxkqEij+sxUybRIyN89ZxyDVbBK6UKE mKdu5f/BfyxvBFpohqBJg3/+a X-Received: by 2002:aa7:cdcd:0:b0:43a:31e:114 with SMTP id h13-20020aa7cdcd000000b0043a031e0114mr35900327edw.231.1657180788803; Thu, 07 Jul 2022 00:59:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1viUzZZNg/geAWz+VogXRR0InJQADthGMYrKorDMjMRhTzoyGoxy3Wqc5pM/+jPCUDzKMChRA== X-Received: by 2002:aa7:cdcd:0:b0:43a:31e:114 with SMTP id h13-20020aa7cdcd000000b0043a031e0114mr35900306edw.231.1657180788616; Thu, 07 Jul 2022 00:59:48 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2a02:6d40:3a4f:7b00:c19b:938e:7c97:afe2]) by smtp.gmail.com with ESMTPSA id t23-20020a170906609700b006fed062c68esm18454842ejj.182.2022.07.07.00.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 00:59:48 -0700 (PDT) From: christian.ehrhardt@canonical.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 19.11.13 Date: Thu, 7 Jul 2022 09:55:21 +0200 Message-Id: <20220707075522.194223-86-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220707075522.194223-1-christian.ehrhardt@canonical.com> References: <20220707075522.194223-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.13 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/09/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/3d3bcdcee414581a2eb959c14157f82684973295 Thanks. Christian Ehrhardt --- >From 3d3bcdcee414581a2eb959c14157f82684973295 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/librte_eal/common/rte_service.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index 8fcccac85c..d11027fcba 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -708,13 +708,20 @@ 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); int32_t only_core = (1 == rte_atomic32_read(&rte_services[i].num_mapped_cores)); + /* 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.37.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-07 09:54:14.662698591 +0200 +++ 0086-service-fix-lingering-active-status.patch 2022-07-07 09:54:11.029825012 +0200 @@ -1 +1 @@ -From 6550113be62d1bd27b2f2dc07d7a888ad9499006 Mon Sep 17 00:00:00 2001 +From 3d3bcdcee414581a2eb959c14157f82684973295 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6550113be62d1bd27b2f2dc07d7a888ad9499006 ] + @@ -21 +23 @@ - lib/eal/common/rte_service.c | 9 ++++++++- + lib/librte_eal/common/rte_service.c | 9 ++++++++- @@ -24,5 +26,5 @@ -diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c -index ef31b1f63c..d2b7275ac0 100644 ---- a/lib/eal/common/rte_service.c -+++ b/lib/eal/common/rte_service.c -@@ -758,7 +758,9 @@ rte_service_lcore_stop(uint32_t lcore) +diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c +index 8fcccac85c..d11027fcba 100644 +--- a/lib/librte_eal/common/rte_service.c ++++ b/lib/librte_eal/common/rte_service.c +@@ -708,13 +708,20 @@ rte_service_lcore_stop(uint32_t lcore) @@ -39,3 +41,2 @@ -@@ -766,6 +768,11 @@ rte_service_lcore_stop(uint32_t lcore) - __atomic_load_n(&rte_services[i].num_mapped_cores, - __ATOMIC_RELAXED)); + int32_t only_core = (1 == + rte_atomic32_read(&rte_services[i].num_mapped_cores));