[2/2] rcu: use correct value of acked token in debug print

Message ID 20240205045949.1085128-2-honnappa.nagarahalli@arm.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers
Series [1/2] rcu: use atomic operation on acked token |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Honnappa Nagarahalli Feb. 5, 2024, 4:59 a.m. UTC
  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 <nathan.brown@arm.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Nathan Brown <nathan.brown@arm.com>
---
 lib/rcu/rte_rcu_qsbr.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon Feb. 18, 2024, 6:13 p.m. UTC | #1
05/02/2024 05:59, Honnappa Nagarahalli:
> 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 <nathan.brown@arm.com>
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Nathan Brown <nathan.brown@arm.com>

We trust you about RCU :)

Series applied, thanks.
  

Patch

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;
 	}