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 759EA45D18; Sat, 16 Nov 2024 02:12:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B87A2406BA; Sat, 16 Nov 2024 02:12:41 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 0C3A1402BB for ; Sat, 16 Nov 2024 02:12:40 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-71e592d7f6eso126873b3a.3 for ; Fri, 15 Nov 2024 17:12:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731719560; x=1732324360; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ro5mDjG6KhYvNUivzkWchhd7rYhW2ZfNebiBvV+TXIU=; b=ZnU+luSVmY3tYN1IJOLcwf5fXSsUXqptKiX7In5G+t/QjnUzKVIjum7WXh/tiifQ2g 3747+J+Tq5uSFfKEVHtZpmmeE2GRu/v1x81op1hN1ZVycwYWiGrbSKqyOthOVNOX6Isi ifcBn368Iah16bw61O8I+P6uVctRgxcyrg89JJeEBSJws4ZxkXWHf90jQrccH86n8PkJ VgseUb4QiXapzoeL3Rhyi3wbi2I+TFnkmrgSsQ9X0k6/uQ4LCOEL+gWt74IvSStC3O+J RPV8e04cz5PK/SR52IAs+LHw3KXlrH/31G5bmt3UBlndFApESqfWfMDP10IznOa7rRER Mfyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731719560; x=1732324360; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ro5mDjG6KhYvNUivzkWchhd7rYhW2ZfNebiBvV+TXIU=; b=xC5ZIi8IdQVwvJfU6nljuqXkDhgKnisgssnCpfN0yhPw0DFF7nUHmX9/sPxcKAV59c SjT5oJIPO+98R7iJ7bZPfO+Bq2aK9BWHcSFF71ET9kRzbMfxlfnEzi7awtP7AvXjFW4u xCW600dtVxlb6RSGzDsn0pat7Sz28pyeGgRZS8lk7d3URagm6migk+l7HxyKElhtMppu cOYAkNQzb/TzdZoVa6RiCb084Lofxvnc60rNxEOtJWhDz+3ZyHIhaTIM1dAq1F/3qBZY hDMRftELHAanvFX/k+YUCTNcCPif5UciFjBY3FnMNhym+ZDijPYey5MEMxsGB62pjpAm oofQ== X-Gm-Message-State: AOJu0Yzag+jSrtlSS3ak4b61lg4LPTdbGin9cDlmL5RHuIi63qD0fLqa tufEJrKq+3TKV9KaT58U2U/cPZclyWLB/jG+HHyFHSaR0mBHgLIAYc1MtKAGLPQwfyCJRn+lw4O w X-Google-Smtp-Source: AGHT+IGn9Oern3OLPkgb6cItLgX9bu5igHyv4y8HDqHFdqCIHwCS88AOAphpTJytN8ATzpsIVOcAFg== X-Received: by 2002:a17:90b:3b84:b0:2e2:a8dd:9bb5 with SMTP id 98e67ed59e1d1-2ea154e16aamr6984892a91.12.1731719559875; Fri, 15 Nov 2024 17:12:39 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211d0f51fe0sm18509015ad.233.2024.11.15.17.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 17:12:39 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , yipeng1.wang@intel.com, stable@dpdk.org, Sameh Gobriel , Pablo de Lara Subject: [PATCH] member: fix choice of bucket for displacement Date: Fri, 15 Nov 2024 17:12:29 -0800 Message-ID: <20241116011229.46694-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 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 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 --- 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