DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] member: fix choice of bucket for displacement
@ 2024-11-16  1:12 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2024-11-16  1:12 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, yipeng1.wang, stable, Sameh Gobriel, Pablo de Lara

Because of misuse of & vs && operator, the member code would
always use the primary bucket.

Fixes: 904ec78a239c ("member: implement HT mode")
Cc: yipeng1.wang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/member/rte_member_ht.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/member/rte_member_ht.c b/lib/member/rte_member_ht.c
index 357097ff4b..738471b378 100644
--- a/lib/member/rte_member_ht.c
+++ b/lib/member/rte_member_ht.c
@@ -494,7 +494,7 @@ rte_member_add_ht(const struct rte_member_setsum *ss,
 		return ret;
 
 	/* Random pick prim or sec for recursive displacement */
-	uint32_t select_bucket = (tmp_sig && 1U) ? prim_bucket : sec_bucket;
+	uint32_t select_bucket = (tmp_sig & 1U) ? prim_bucket : sec_bucket;
 	if (ss->cache) {
 		ret = evict_from_bucket();
 		buckets[select_bucket].sigs[ret] = tmp_sig;
-- 
2.45.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-16  1:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-16  1:12 [PATCH] member: fix choice of bucket for displacement Stephen Hemminger

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).