patch 'net/igc/base: fix data type in MAC hash' has been queued to stable release 22.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Feb 17 18:04:18 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/19/25. So 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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/377f2051765cc29b2afe80d6f73bab72a11c925a

Thanks.

Luca Boccassi

---
>From 377f2051765cc29b2afe80d6f73bab72a11c925a Mon Sep 17 00:00:00 2001
From: Barbara Skobiej <barbara.skobiej at intel.com>
Date: Thu, 6 Feb 2025 16:08:35 +0000
Subject: [PATCH] net/igc/base: fix data type in MAC hash

[ upstream commit cad5c51ec3a0e965d6d4bb98166890499597f23a ]

One of the bit shifts in MAC hash calculation triggers a static analysis
warning about a potential overflow. Fix the data type to avoid this.

Fixes: 8cb7c57d9b3c ("net/igc: support device initialization")

Signed-off-by: Barbara Skobiej <barbara.skobiej 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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/igc/base/igc_mac.c b/drivers/net/igc/base/igc_mac.c
index c69f8ac73b..cfb74a6443 100644
--- a/drivers/net/igc/base/igc_mac.c
+++ b/drivers/net/igc/base/igc_mac.c
@@ -539,8 +539,10 @@ u32 igc_hash_mc_addr_generic(struct igc_hw *hw, u8 *mc_addr)
 		break;
 	}
 
-	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
-				  (((u16)mc_addr[5]) << bit_shift)));
+	hash_value = (u32)mc_addr[4];
+	hash_value = hash_value >> (8 - bit_shift);
+	hash_value |= (((u32)mc_addr[5]) << bit_shift);
+	hash_value &= hash_mask;
 
 	return hash_value;
 }
-- 
2.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-17 16:13:18.451798931 +0000
+++ 0045-net-igc-base-fix-data-type-in-MAC-hash.patch	2025-02-17 16:13:16.842441592 +0000
@@ -1 +1 @@
-From cad5c51ec3a0e965d6d4bb98166890499597f23a Mon Sep 17 00:00:00 2001
+From 377f2051765cc29b2afe80d6f73bab72a11c925a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cad5c51ec3a0e965d6d4bb98166890499597f23a ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -16 +17 @@
- drivers/net/intel/igc/base/igc_mac.c | 6 ++++--
+ drivers/net/igc/base/igc_mac.c | 6 ++++--
@@ -19 +20 @@
-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
@@ -21,2 +22,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