From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
To: dev@dpdk.org
Cc: wathsala.vithanage@arm.com, dhruv.tripathi@arm.com, nd@arm.com,
Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
stable@dpdk.org, Nathan Brown <nathan.brown@arm.com>
Subject: [PATCH 2/2] rcu: use correct value of acked token in debug print
Date: Mon, 5 Feb 2024 04:59:49 +0000 [thread overview]
Message-ID: <20240205045949.1085128-2-honnappa.nagarahalli@arm.com> (raw)
In-Reply-To: <20240205045949.1085128-1-honnappa.nagarahalli@arm.com>
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(-)
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
next prev parent reply other threads:[~2024-02-05 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 4:59 [PATCH 1/2] rcu: use atomic operation on acked token Honnappa Nagarahalli
2024-02-05 4:59 ` Honnappa Nagarahalli [this message]
2024-02-18 18:13 ` [PATCH 2/2] rcu: use correct value of acked token in debug print Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240205045949.1085128-2-honnappa.nagarahalli@arm.com \
--to=honnappa.nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=dhruv.tripathi@arm.com \
--cc=nathan.brown@arm.com \
--cc=nd@arm.com \
--cc=stable@dpdk.org \
--cc=wathsala.vithanage@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).