DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	yipeng1.wang@intel.com, stable@dpdk.org,
	Sameh Gobriel <sameh.gobriel@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [PATCH] member: fix choice of bucket for displacement
Date: Fri, 15 Nov 2024 17:12:29 -0800	[thread overview]
Message-ID: <20241116011229.46694-1-stephen@networkplumber.org> (raw)

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


                 reply	other threads:[~2024-11-16  1:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20241116011229.46694-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=sameh.gobriel@intel.com \
    --cc=stable@dpdk.org \
    --cc=yipeng1.wang@intel.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).