From nobody Tue Aug 25 00:42:42 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hTTX24GLXz6pNP7 for ; Tue, 25 Aug 2026 00:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hTTX23W4Dz3FsZ for ; Tue, 25 Aug 2026 00:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787618562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1jSbRcnJvUpsL24otzmzplTJRCDhQrB9iuGJ+7ptStw=; b=qKh7/7bLTdUgMYqErG2Wepeh3MO6RE6ZPV+wF/MI/ap5/QLagEmNa7Jh1MC/go9yuT19mH Uiddi2qSPw626Ag+wI05jUrPesMPjbVf5oaBFd0JZaTMi+MD5gy3uPTM7AfIeW21KY3rlk LLiwaX3PE2JBTIS5GWcScQUVblcR/Uj8/GxRFg1TSF4/9fyEIq3NQtaEfLqxC9F3It6Yf5 LDRQMnGymCundqScwTEBDH1aAhgoxN/baS41aJzyFWjBRX6rb3U99eBvukFnIkn+TqIc5B 3xZLy0iG2DREyai7KkThXyzHFWSpz6ByknPuy49Y6QVtKT2DABEWziOb0jeqzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787618562; a=rsa-sha256; cv=none; b=pb0cBkaeqj9n8o/v8NNx3YMFuuKkbdlG5Id1mt7jdCFDbfRhkZLUo72Ug3yHKXyEqLLmxw lF65jsKZWP5MJ2FCzVnt2y/Z+aJr/e36nh8tiqxdWDKk6Tm8AMjRNRqlSp2c3aZgmnIysH vYf/uWB0+d+TjqT9PXYVjseKmujt3upgwsl8OTAZcXM/lEzTeEbzLcIADjVr7rPR/ZEfrq eApluhhl5BSMF3V2LAufdI4K2czBoW62y+r4q6ec0ZcQ1v/KzMm3P0uWZ3dx/cg4BzTlR4 HotAnBPXQhiDTbeGVAzc46SKUf3DIJvMmrrrVnhLskWe8uQl+JQwy3ATg4+qcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787618562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1jSbRcnJvUpsL24otzmzplTJRCDhQrB9iuGJ+7ptStw=; b=VFAogoho3UBFi9mBgoEiEI4YOZzO1+bvqc2hTacj1/idSbTGRSypXwHqSQinXD4uOp+e6W 9+5uhZW1ete8z5R6rHqI0AaNcoqofrTQR2xt9+YlJzuTLdRhrWhrMQiT1la0Uyixl6nMMz asDpT+7pm8w2tKm7izF4HmCfKg3ETe7NCE4ndwvgtGOFCpRIqNk2le4lHzqbHwNpA5BjFx KgziK+D4+d7xMAuKyfPfhpDMbqx2ouHpHrwkSaDk+9fQ6AGfBQJakOg9zmBBOAHrxKPJn8 bUi6aZeFTe+u2D3jM5IThuNXXyOyqs5DS2bR/iA+0914s7G0xcKp2dCTUs/OhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hTTX22H58zCL7 for ; Tue, 25 Aug 2026 00:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40623 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Aug 2026 00:42:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Aleksandr Loktionov From: Kevin Bowling Subject: git: 1e53317f0058 - stable/14 - e1000: fix MAC address hash bit shift List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e53317f00587b08c047dbb99d7f0c17687cdeb7 Auto-Submitted: auto-generated Date: Tue, 25 Aug 2026 00:42:42 +0000 Message-Id: <6a8ce502.40623.78ca2a96@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1e53317f00587b08c047dbb99d7f0c17687cdeb7 commit 1e53317f00587b08c047dbb99d7f0c17687cdeb7 Author: Aleksandr Loktionov AuthorDate: 2025-02-06 16:08:40 +0000 Commit: Kevin Bowling CommitDate: 2026-08-25 00:39:02 +0000 e1000: fix MAC address hash bit shift DPDK commit message net/e1000/base: fix MAC address hash bit shift In e1000_hash_mc_addr_generic() the expression: "mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]" shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Aleksandr Loktionov Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson Obtained from: DPDK (1749e662f6) (cherry picked from commit e7ffea395ee8add21b2cce0806285131e12cc454) --- sys/dev/e1000/e1000_mac.c | 4 ++-- sys/dev/e1000/e1000_vf.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index 23cc89f92c6e..a34e2c873a0e 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -523,7 +523,7 @@ int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr) { u32 hash_value, hash_mask; - u8 bit_shift = 0; + u8 bit_shift = 1; DEBUGFUNC("e1000_hash_mc_addr_generic"); @@ -533,7 +533,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr) /* For a mc_filter_type of 0, bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ - while (hash_mask >> bit_shift != 0xFF) + while (bit_shift < 4 && hash_mask >> bit_shift != 0xFF) bit_shift++; /* The portion of the address that is used for the hash table diff --git a/sys/dev/e1000/e1000_vf.c b/sys/dev/e1000/e1000_vf.c index 9bcd2798e486..89ce0181faef 100644 --- a/sys/dev/e1000/e1000_vf.c +++ b/sys/dev/e1000/e1000_vf.c @@ -357,7 +357,7 @@ static int e1000_rar_set_vf(struct e1000_hw *hw, u8 *addr, static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) { u32 hash_value, hash_mask; - u8 bit_shift = 0; + u8 bit_shift = 1; DEBUGFUNC("e1000_hash_mc_addr_generic"); @@ -368,7 +368,7 @@ static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) * The bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ - while (hash_mask >> bit_shift != 0xFF) + while (bit_shift < 4 && hash_mask >> bit_shift != 0xFF) bit_shift++; hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |