From nobody Tue Aug 11 20:59:53 2026 X-Original-To: dev-commits-src-main@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 4hKPBx59hfz6X1MG for ; Tue, 11 Aug 2026 20:59:53 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hKPBx3cz4z4CB4 for ; Tue, 11 Aug 2026 20:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786481993; 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=NbHrmC7VR7za3qVGHbUAwr/061YRfM373Lv/3CSUm0M=; b=wT36r9mS4u2GQqvuljmf7e09c0DmLlv/fDOYPgTOdka+4HA6FoWH2+PYREUr3q+byY7ps4 LO+Sfl5XyktLaaiP1sv8ArKlqgiufwb5k27AzpI/8CNinLEYLaLD1LMlQGz1r5Sagk4qVb /E1kSgxJydZXCpGVxoPlHwHyh33S5l4gcp5y9KlOHw/EuunB3sOUevvZ4a3i0QOkPQ0uQ2 Mkvc9SAlEw1mq1EkrRFMz/Zcq+WpKTRW9gBUTIetqjZDaufT2P0aOFel5++EEb1+GqCn7L 4AAGBiLmhSyV/qR1R7VBTuiIw4EuVVGMQSFowGYZH8oKiZ9e3/bBPWmGgb2aag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786481993; a=rsa-sha256; cv=none; b=mOtQ1PNZHGaFf7fSWrEo1fUOXmPCTkfuKmktIFDP+PCgz8Z7rRCPE4/7TU6d5vQ51wQdzu iNa6MJlU433NaLc15g7q118VtKiu5nIRcGp0UwuNsBONXqbjTXO2jZkFWc3AaaIWGZRm/6 dAranbymF/CkCWFUs0XAyGafYs9LIVCnOv9R9N5xSfmJ3Up4kDVAszvlSqRrJ6HGTXc58p YqxY0ZyPo5Q6tk35sFKLza9hd9c5oYD/y0mpB6MaUqgH6QHngjZXh9eT+k1atADQ/q0DIz qnSDnkdx0FecAC9kNprFEJZDSvox2JVpp8Erh8Gk9gIbTMw12kv7DYl8tMpP8g== 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=1786481993; 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=NbHrmC7VR7za3qVGHbUAwr/061YRfM373Lv/3CSUm0M=; b=A6xp97nhEJZsdUBlHjEmguIL6SBFaioiyy7zS/bruQ2QODvD36wX4FZnhhSAfyd0Lfs+1G Xf9Ff1GCSBF+Y+lD/d87LASpnjVqJAv6EX9ROyR9YTUPkwi5oGoASAIoAfpko/tyVkzFgZ Y+UF3DoTBnRiMGCvT/eZ5L8bAe68b21dD5J3zfbx0ytcf21mmiWn1cHpPErdwSGop93fYh T7iORjR20qusCjRRuJOrFq3NkXpOW7moB+NhMPx7wFeMn2ofxsTGUFICBUhwXhLhqd2/Tx W22yF/3ghWf+C2jRsADXj376htGX03u1E1uElOfeGV8PiVfJgLvnZlfuVvN/iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hKPBx2K3pz19m6 for ; Tue, 11 Aug 2026 20:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 382d3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 11 Aug 2026 20:59:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Aleksandr Loktionov From: Kevin Bowling Subject: git: e7ffea395ee8 - main - e1000: fix MAC address hash bit shift List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e7ffea395ee8add21b2cce0806285131e12cc454 Auto-Submitted: auto-generated Date: Tue, 11 Aug 2026 20:59:53 +0000 Message-Id: <6a7b8d49.382d3.340d3a6@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e7ffea395ee8add21b2cce0806285131e12cc454 commit e7ffea395ee8add21b2cce0806285131e12cc454 Author: Aleksandr Loktionov AuthorDate: 2025-02-06 16:08:40 +0000 Commit: Kevin Bowling CommitDate: 2026-08-11 20:59:31 +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) MFC after: 2 weeks --- 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 2394c240d18d..a2c19c980f34 100644 --- a/sys/dev/e1000/e1000_vf.c +++ b/sys/dev/e1000/e1000_vf.c @@ -359,7 +359,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"); @@ -370,7 +370,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)) |