patch 'net/igc/base: fix MAC address hash bit shift' has been queued to stable release 23.11.4

Xueming Li xuemingl at nvidia.com
Tue Feb 18 13:34:50 CET 2025


Hi,

FYI, your patch has been queued to stable release 23.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
Please shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a9583ad550e01cef45cf1e0b18c36665f8a964fe

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From a9583ad550e01cef45cf1e0b18c36665f8a964fe Mon Sep 17 00:00:00 2001
From: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
Date: Thu, 6 Feb 2025 16:08:34 +0000
Subject: [PATCH] net/igc/base: fix MAC address hash bit shift
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit bccccacfb6f6f2e84a24c6733c7e3d4af05f73b5 ]

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: 8cb7c57d9b3c ("net/igc: support device initialization")

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/igc/base/igc_mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/igc/base/igc_mac.c b/drivers/net/igc/base/igc_mac.c
index 3cd6506e5e..c69f8ac73b 100644
--- a/drivers/net/igc/base/igc_mac.c
+++ b/drivers/net/igc/base/igc_mac.c
@@ -486,7 +486,7 @@ static int igc_rar_set_generic(struct igc_hw *hw, u8 *addr, u32 index)
 u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr)
 {
 	u32 hash_value, hash_mask;
-	u8 bit_shift = 0;
+	u8 bit_shift = 1;

 	DEBUGFUNC("igc_hash_mc_addr_generic");

@@ -496,7 +496,7 @@ u32 igc_hash_mc_addr_generic(struct igc_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 (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;

 	/* The portion of the address that is used for the hash table
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-18 19:39:02.673692295 +0800
+++ 0055-net-igc-base-fix-MAC-address-hash-bit-shift.patch	2025-02-18 19:39:00.648244044 +0800
@@ -1 +1 @@
-From bccccacfb6f6f2e84a24c6733c7e3d4af05f73b5 Mon Sep 17 00:00:00 2001
+From a9583ad550e01cef45cf1e0b18c36665f8a964fe Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit bccccacfb6f6f2e84a24c6733c7e3d4af05f73b5 ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
- drivers/net/intel/igc/base/igc_mac.c | 4 ++--
+ drivers/net/igc/base/igc_mac.c | 4 ++--
@@ -24 +26 @@
-diff --git a/drivers/net/intel/igc/base/igc_mac.c b/drivers/net/intel/igc/base/igc_mac.c
+diff --git a/drivers/net/igc/base/igc_mac.c b/drivers/net/igc/base/igc_mac.c
@@ -26,2 +28,2 @@
---- a/drivers/net/intel/igc/base/igc_mac.c
-+++ b/drivers/net/intel/igc/base/igc_mac.c
+--- a/drivers/net/igc/base/igc_mac.c
++++ b/drivers/net/igc/base/igc_mac.c


More information about the stable mailing list