patch 'net/mana: fix MR length truncation for chunks over 4GB' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Oct 27 12:48:28 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/082c580e61399476d19714ce576d8d564930f7d7
Thanks.
Luca Boccassi
---
>From 082c580e61399476d19714ce576d8d564930f7d7 Mon Sep 17 00:00:00 2001
From: Rita Ruvinsky <rita.ruvinsky at weka.io>
Date: Thu, 6 Aug 2026 20:26:39 +0300
Subject: [PATCH] net/mana: fix MR length truncation for chunks over 4GB
[ upstream commit bf745d7703065e7dd6c6e90a4d5af288bc7618a9 ]
mana_range.len is a uint32_t, so a mempool chunk of 4GB or more
truncates modulo 2^32 -- exactly 4GB becomes 0, 15GB becomes 3GB.
The guard against priv->max_mr_size cannot catch this because it
compares the already-truncated value, and the device advertises
max_mr_size as UINT64_MAX. ibv_reg_mr() then fails with EINVAL on a
zero length, or silently registers a region far shorter than the pool,
so lookups for buffers past that boundary never find an MR and no Rx
WQE can be posted.
Widen the length to uint64_t through the MR path, including the
multi-process request that forwards it to the primary process.
Fixes: 0f5db3c68ba7 ("net/mana: implement memory registration")
Signed-off-by: Rita Ruvinsky <rita.ruvinsky at weka.io>
Reviewed-by: Long Li <longli at microsoft.com>
---
.mailmap | 4 ++++
drivers/net/mana/mana.h | 4 ++--
drivers/net/mana/mp.c | 4 ++--
drivers/net/mana/mr.c | 11 ++++++-----
4 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/.mailmap b/.mailmap
index 9c407d9ff2e..850881d0d66 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1346,6 +1346,10 @@ Richard Walsh <richard.walsh at intel.com>
Rich Lane <rich.lane at bigswitch.com>
Ricky Li <ricky.li at intel.com>
R Mohamed Shah <mohamedshah.r at amd.com>
+Riley Fletcher <rileyf at linux.ibm.com>
+Rita Ruvinsky <rita.ruvinsky at weka.io>
+Rob Miller <rob.miller at broadcom.com>
+Rob Scheepens <rob.scheepens at nutanix.com>
Robert Konklewski <robertx.konklewski at intel.com>
Robert Malz <robertx.malz at intel.com>
Robert Sanford <rsanford at akamai.com> <rsanford2 at gmail.com> <rsanford at prolexic.com>
diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index bd5bd02484e..6e5f8164515 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -552,7 +552,7 @@ struct mana_mp_param {
/* MANA_MP_REQ_CREATE_MR */
uintptr_t addr;
- uint32_t len;
+ uint64_t len;
};
#define MANA_MP_NAME "net_mana_mp"
@@ -561,7 +561,7 @@ int mana_mp_init_secondary(void);
void mana_mp_uninit_primary(void);
void mana_mp_uninit_secondary(void);
int mana_mp_req_verbs_cmd_fd(struct rte_eth_dev *dev);
-int mana_mp_req_mr_create(struct mana_priv *priv, uintptr_t addr, uint32_t len);
+int mana_mp_req_mr_create(struct mana_priv *priv, uintptr_t addr, uint64_t len);
void mana_mp_req_on_rxtx(struct rte_eth_dev *dev, enum mana_mp_req_type type);
diff --git a/drivers/net/mana/mp.c b/drivers/net/mana/mp.c
index 72417fc0c74..25d96c7b07c 100644
--- a/drivers/net/mana/mp.c
+++ b/drivers/net/mana/mp.c
@@ -17,7 +17,7 @@ extern struct mana_shared_data *mana_shared_data;
* Process MR request from secondary process.
*/
static int
-mana_mp_mr_create(struct mana_priv *priv, uintptr_t addr, uint32_t len)
+mana_mp_mr_create(struct mana_priv *priv, uintptr_t addr, uint64_t len)
{
struct ibv_mr *ibv_mr;
int ret;
@@ -265,7 +265,7 @@ exit:
* Request the primary process to register a MR.
*/
int
-mana_mp_req_mr_create(struct mana_priv *priv, uintptr_t addr, uint32_t len)
+mana_mp_req_mr_create(struct mana_priv *priv, uintptr_t addr, uint64_t len)
{
struct rte_mp_msg mp_req = {0};
struct rte_mp_msg *mp_res;
diff --git a/drivers/net/mana/mr.c b/drivers/net/mana/mr.c
index c4045141bc8..7405755df80 100644
--- a/drivers/net/mana/mr.c
+++ b/drivers/net/mana/mr.c
@@ -13,7 +13,8 @@
struct mana_range {
uintptr_t start;
uintptr_t end;
- uint32_t len;
+ /* 64-bit: a mempool chunk can be 4GB or more, which overflows uint32_t. */
+ uint64_t len;
};
void
@@ -47,13 +48,13 @@ mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv,
for (i = 0; i < pool->nb_mem_chunks; i++) {
if (ranges[i].len > priv->max_mr_size) {
- DP_LOG(ERR, "memory chunk size %u exceeding max MR",
+ DP_LOG(ERR, "memory chunk size %" PRIu64 " exceeding max MR",
ranges[i].len);
return -ENOMEM;
}
DP_LOG(DEBUG,
- "registering memory chunk start 0x%" PRIxPTR " len %u",
+ "registering memory chunk start 0x%" PRIxPTR " len %" PRIu64,
ranges[i].start, ranges[i].len);
if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
@@ -62,7 +63,7 @@ mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv,
ranges[i].len);
if (ret) {
DP_LOG(ERR,
- "MR failed start 0x%" PRIxPTR " len %u",
+ "MR failed start 0x%" PRIxPTR " len %" PRIu64,
ranges[i].start, ranges[i].len);
return ret;
}
@@ -98,7 +99,7 @@ mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv,
return ret;
}
} else {
- DP_LOG(ERR, "MR failed at 0x%" PRIxPTR " len %u",
+ DP_LOG(ERR, "MR failed at 0x%" PRIxPTR " len %" PRIu64,
ranges[i].start, ranges[i].len);
return -errno;
}
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-10-27 11:43:54.316630211 +0000
+++ 0014-net-mana-fix-MR-length-truncation-for-chunks-over-4G.patch 2026-10-27 11:43:53.502059077 +0000
@@ -1 +1 @@
-From bf745d7703065e7dd6c6e90a4d5af288bc7618a9 Mon Sep 17 00:00:00 2001
+From 082c580e61399476d19714ce576d8d564930f7d7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bf745d7703065e7dd6c6e90a4d5af288bc7618a9 ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
- .mailmap | 1 +
+ .mailmap | 4 ++++
@@ -29 +30 @@
- 4 files changed, 11 insertions(+), 9 deletions(-)
+ 4 files changed, 14 insertions(+), 9 deletions(-)
@@ -32 +33 @@
-index 194ca853b9f..bbe3d013d20 100644
+index 9c407d9ff2e..850881d0d66 100644
@@ -35,2 +36,2 @@
-@@ -1419,6 +1419,7 @@ Richard Houldsworth <richard.houldsworth at amd.com> <rhouldsworth at solarflare.com>
- Richard Walsh <richard.walsh at intel.com>
+@@ -1346,6 +1346,10 @@ Richard Walsh <richard.walsh at intel.com>
+ Rich Lane <rich.lane at bigswitch.com>
@@ -38 +39,2 @@
- Riley Fletcher <rileyf at linux.ibm.com>
+ R Mohamed Shah <mohamedshah.r at amd.com>
++Riley Fletcher <rileyf at linux.ibm.com>
@@ -40,2 +42,2 @@
- Rob Miller <rob.miller at broadcom.com>
- Rob Scheepens <rob.scheepens at nutanix.com>
++Rob Miller <rob.miller at broadcom.com>
++Rob Scheepens <rob.scheepens at nutanix.com>
@@ -42,0 +45,2 @@
+ Robert Malz <robertx.malz at intel.com>
+ Robert Sanford <rsanford at akamai.com> <rsanford2 at gmail.com> <rsanford at prolexic.com>
@@ -44 +48 @@
-index a7b301484aa..79879b76266 100644
+index bd5bd02484e..6e5f8164515 100644
@@ -47 +51 @@
-@@ -602,7 +602,7 @@ struct mana_mp_param {
+@@ -552,7 +552,7 @@ struct mana_mp_param {
@@ -56 +60 @@
-@@ -611,7 +611,7 @@ int mana_mp_init_secondary(void);
+@@ -561,7 +561,7 @@ int mana_mp_init_secondary(void);
@@ -62 +65,0 @@
- int mana_map_doorbell_secondary(struct rte_eth_dev *eth_dev, int fd);
@@ -64 +67,2 @@
- int mana_mp_req_on_rxtx(struct rte_eth_dev *dev, enum mana_mp_req_type type);
+ void mana_mp_req_on_rxtx(struct rte_eth_dev *dev, enum mana_mp_req_type type);
+
@@ -66 +70 @@
-index 1670f1ea9cc..f278bcdce5e 100644
+index 72417fc0c74..25d96c7b07c 100644
@@ -69 +73 @@
-@@ -20,7 +20,7 @@ extern struct mana_shared_data *mana_shared_data;
+@@ -17,7 +17,7 @@ extern struct mana_shared_data *mana_shared_data;
@@ -78 +82 @@
-@@ -331,7 +331,7 @@ exit:
+@@ -265,7 +265,7 @@ exit:
@@ -88 +92 @@
-index 8914f4cf045..0ce1a76ed57 100644
+index c4045141bc8..7405755df80 100644
More information about the stable
mailing list