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 1046143A70; Mon, 5 Feb 2024 06:00:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C7FE0402DD; Mon, 5 Feb 2024 06:00:30 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id C1770400D6; Mon, 5 Feb 2024 06:00:28 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ABF1D1FB; Sun, 4 Feb 2024 21:01:10 -0800 (PST) Received: from ampere-altra-2-1.usa.Arm.com (ampere-altra-2-1.usa.arm.com [10.118.91.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3BF0A3F5A1; Sun, 4 Feb 2024 21:00:28 -0800 (PST) From: Honnappa Nagarahalli To: dev@dpdk.org Cc: wathsala.vithanage@arm.com, dhruv.tripathi@arm.com, nd@arm.com, Honnappa Nagarahalli , stable@dpdk.org, Nathan Brown Subject: [PATCH 2/2] rcu: use correct value of acked token in debug print Date: Mon, 5 Feb 2024 04:59:49 +0000 Message-Id: <20240205045949.1085128-2-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240205045949.1085128-1-honnappa.nagarahalli@arm.com> References: <20240205045949.1085128-1-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Debug print should use acked token value that was used for comparison. Fixes: bf386ae377aa ("rcu: add additional debug logs") Cc: stable@dpdk.org Reported-by: Nathan Brown Signed-off-by: Honnappa Nagarahalli Reviewed-by: Nathan Brown --- lib/rcu/rte_rcu_qsbr.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index f6a3731308..a7d6e63560 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -664,17 +664,20 @@ __rte_rcu_qsbr_check_all(struct rte_rcu_qsbr *v, uint64_t t, bool wait) static __rte_always_inline int rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait) { + uint64_t acked_token; + RTE_ASSERT(v != NULL); /* Check if all the readers have already acknowledged this token */ - if (likely(t <= rte_atomic_load_explicit(&v->acked_token, - rte_memory_order_relaxed))) { + acked_token = rte_atomic_load_explicit(&v->acked_token, + rte_memory_order_relaxed); + if (likely(t <= acked_token)) { __RTE_RCU_DP_LOG(DEBUG, "%s: check: token = %" PRIu64 ", wait = %d", __func__, t, wait); __RTE_RCU_DP_LOG(DEBUG, "%s: status: least acked token = %" PRIu64, - __func__, v->acked_token); + __func__, acked_token); return 1; } -- 2.34.1