patch 'net/nfp: fix shifts in BAR size calculation' has been queued to stable release 25.11.3
Kevin Traynor
ktraynor at redhat.com
Thu Jul 30 11:16:20 CEST 2026
Hi,
FYI, your patch has been queued to stable release 25.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/04/26. 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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/ef5452286f697999be3b01ea958656d89f881311
Thanks.
Kevin
---
>From ef5452286f697999be3b01ea958656d89f881311 Mon Sep 17 00:00:00 2001
From: Alexey Simakov <bigalex934 at gmail.com>
Date: Tue, 7 Jul 2026 17:01:11 +0300
Subject: [PATCH] net/nfp: fix shifts in BAR size calculation
[ upstream commit 82fc03073c1b899290fd03cced628939e22117ad ]
The literal '1' is a signed 32-bit int. Shifting it by bar->bitsize
is undefined behavior when bitsize >= 31, and sign-extends when
bitsize == 31 (producing a wrong upper-bound check). BAR aperture
sizes from hardware can exceed this range.
Fix by using RTE_BIT64() which produces a 64-bit unsigned value,
matching the type of the operands (uint64_t base, uint64_t offset).
Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Fixes: 1fbe51cd9c3a ("net/nfp: extend usage of BAR from 8 to 24")
Signed-off-by: Alexey Simakov <bigalex934 at gmail.com>
---
drivers/net/nfp/nfpcore/nfp6000_pcie.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/nfp/nfpcore/nfp6000_pcie.c b/drivers/net/nfp/nfpcore/nfp6000_pcie.c
index 83b7116097..e03c4776d0 100644
--- a/drivers/net/nfp/nfpcore/nfp6000_pcie.c
+++ b/drivers/net/nfp/nfpcore/nfp6000_pcie.c
@@ -56,9 +56,9 @@
#define NFP_PCI_MIN_MAP_SIZE 0x080000 /* 512K */
-#define NFP_PCIE_P2C_FIXED_SIZE(bar) (1 << (bar)->bitsize)
-#define NFP_PCIE_P2C_BULK_SIZE(bar) (1 << (bar)->bitsize)
+#define NFP_PCIE_P2C_FIXED_SIZE(bar) RTE_BIT64((bar)->bitsize)
+#define NFP_PCIE_P2C_BULK_SIZE(bar) RTE_BIT64((bar)->bitsize)
#define NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(bar, x) ((x) << ((bar)->bitsize - 2))
#define NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(bar, x) ((x) << ((bar)->bitsize - 4))
-#define NFP_PCIE_P2C_GENERAL_SIZE(bar) (1 << ((bar)->bitsize - 4))
+#define NFP_PCIE_P2C_GENERAL_SIZE(bar) RTE_BIT64(((bar)->bitsize - 4))
#define NFP_PCIE_P2C_EXPBAR_OFFSET(bar_index) ((bar_index) * 4)
@@ -444,5 +444,5 @@ matching_bar_exist(struct nfp_bar *bar,
bar_action == action &&
bar->base <= offset &&
- (bar->base + (1 << bar->bitsize)) >= (offset + size))
+ (bar->base + RTE_BIT64(bar->bitsize)) >= (offset + size))
return true;
--
2.55.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-30 10:16:02.696302874 +0100
+++ 0041-net-nfp-fix-shifts-in-BAR-size-calculation.patch 2026-07-30 10:16:01.482194170 +0100
@@ -1 +1 @@
-From 82fc03073c1b899290fd03cced628939e22117ad Mon Sep 17 00:00:00 2001
+From ef5452286f697999be3b01ea958656d89f881311 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 82fc03073c1b899290fd03cced628939e22117ad ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list