git: 4b1469832d8b - stable/15 - e1000: fix data type in MAC hash
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 25 Aug 2026 00:31:34 UTC
The branch stable/15 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=4b1469832d8ba3d2d6b47be4c543e41610c6322d
commit 4b1469832d8ba3d2d6b47be4c543e41610c6322d
Author: Barbara Skobiej <barbara.skobiej@intel.com>
AuthorDate: 2025-02-06 16:08:41 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-25 00:27:15 +0000
e1000: fix data type in MAC hash
DPDK commit message
net/e1000/base: fix data type in MAC hash
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: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Obtained from: DPDK (458734aaac)
(cherry picked from commit a09034d561cbb3792ecc0146b41d4794ab3bda37)
---
sys/dev/e1000/e1000_mac.c | 6 ++++--
sys/dev/e1000/e1000_vf.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c
index a34e2c873a0e..eb2c29d153dc 100644
--- a/sys/dev/e1000/e1000_mac.c
+++ b/sys/dev/e1000/e1000_mac.c
@@ -576,8 +576,10 @@ u32 e1000_hash_mc_addr_generic(struct e1000_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 >>= 8 - bit_shift;
+ hash_value |= (u32)mc_addr[5] << bit_shift;
+ hash_value &= hash_mask;
return hash_value;
}
diff --git a/sys/dev/e1000/e1000_vf.c b/sys/dev/e1000/e1000_vf.c
index 89ce0181faef..5b19375e6034 100644
--- a/sys/dev/e1000/e1000_vf.c
+++ b/sys/dev/e1000/e1000_vf.c
@@ -371,8 +371,10 @@ static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
while (bit_shift < 4 && hash_mask >> bit_shift != 0xFF)
bit_shift++;
- hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
- (((u16) mc_addr[5]) << bit_shift)));
+ hash_value = (u32)mc_addr[4];
+ hash_value >>= 8 - bit_shift;
+ hash_value |= (u32)mc_addr[5] << bit_shift;
+ hash_value &= hash_mask;
return hash_value;
}