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 8BC0D45D18 for ; Sat, 16 Nov 2024 02:12:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77959402A7; Sat, 16 Nov 2024 02:12:41 +0100 (CET) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id E11E7402A7 for ; Sat, 16 Nov 2024 02:12:40 +0100 (CET) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-71e4244fdc6so151719b3a.0 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=WLGDtmvITmjbLyPdkICqDb+JCo8hqXWGM8Bk60IHr9u4LEoHdbryBXMn9BvLLl5O1s Pjn/DVk4LRcL+PLJGZKx00Kwk1yN5xIGzvFhy6rQC/fQnDrnnMt+qgFQj80rmbo+3sHI wPSODMOSI7/RZiph1lKaOD7N1C+KmIlSqxYVJpb0xw9VJIVhuOc6CLp7CXr+oculwtvZ k+D2BqAzZp1HjgrqYMURqITUTdgj3RxuRQCG4FmubGaBUHjmECoczdejuDYHoHQfa5JE NeTRKmeeVxudc62iXpOHd4XfSiLiKH9dTRxwlUnkgHxjQvMX9QafBWKWutBS8Qa6L8+/ 0Lkw== X-Forwarded-Encrypted: i=1; AJvYcCXtkz10kbb/+IdK7gB7qyLJNljuzkDSYDZ1mjDaS9GLkxNc6WtKJyoFml2ndVuHNEjvacJ1e5M=@dpdk.org X-Gm-Message-State: AOJu0Yw9HDtv1/ZVXJiwglSj4jHewzaOL0ey7cyd6cOyP8liEXI0PKOR YRdoKSFfYSuQ76fvLpMediMoTMwE1R8IdeZ1VhZ3q364a/qU4W3FtxVMX2a5tbc= 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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