patch 'net/mlx5: fix default memzone requirements in HWS' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Feb 26 14:09:54 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/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/bd350da9155d34b6598d9fac545beea0535abb03
Thanks.
Kevin
---
>From bd350da9155d34b6598d9fac545beea0535abb03 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Mon, 12 Jan 2026 11:24:36 +0200
Subject: [PATCH] net/mlx5: fix default memzone requirements in HWS
[ upstream commit 0da95cc8c246d41d916c53bd397f942c63214634 ]
Commit [1] has changed the default behavior of flow engine selection
in mlx5 PMD to accommodate for new NIC generations.
Whenever underlying device does not support SWS (e.g., ConnectX-9
or untrusted VFs/SFs) and device does support HWS,
default flow engine would be HWS (dv_flow_en=2) which also supports
sync flow API.
This behavior change had consequence in memory usage whenever
SFs are probed by DPDK. In default HWS configuration supporting
sync flow API (i.e. without calling rte_flow_configure())
mlx5 PMD allocated 4 rte_ring objects per port:
- indir_iq and indir_cq - For handling indirect action completions.
- flow_transfer_pending and flow_transfer_completed - For handling
template table resizing.
This has not happened previously with SWS as default flow engine.
Since a dedicated memzone is allocated for each rte_ring object,
this lead to exhaustion of default memzone limit
on setups with ~1K SFs to probe.
It resulted in the following error on port start:
EAL: memzone_reserve_aligned_thread_unsafe():
Number of requested memzone segments exceeds maximum 2560
RING: Cannot reserve memory
mlx5_net: Failed to start port 998 mlx5_core.sf.998:
fail to configure port
Since template table resizing is allowed if and only if
async flow API was configured, 2 of the aforementioned rings
are never used in the default sync flow API configuration.
This patch removes allocation of flow_transfer_pending and
flow_transfer_completed rings in default sync flow API configuration
of mlx5 PMD to reduce memzone usage and allow DPDK probing
to succeed on setups with ~1K SFs to probe.
[1] commit d1ac7b6c64d9
("net/mlx5: update flow devargs handling for future HW")
Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable reconfigure")
Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 86 ++++++++++++++++++++++++++-------
1 file changed, 68 insertions(+), 18 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 31886219b8..24d1eba02f 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4407,4 +4407,7 @@ mlx5_hw_pull_flow_transfer_comp(struct rte_eth_dev *dev,
struct rte_ring *ring = priv->hw_q[queue].flow_transfer_completed;
+ if (ring == NULL)
+ return 0;
+
size = RTE_MIN(rte_ring_count(ring), n_res);
for (i = 0; i < size; i++) {
@@ -4638,6 +4641,7 @@ __flow_hw_push_action(struct rte_eth_dev *dev,
mlx5_hw_push_queue(hw_q->indir_iq, hw_q->indir_cq);
- mlx5_hw_push_queue(hw_q->flow_transfer_pending,
- hw_q->flow_transfer_completed);
+ if (hw_q->flow_transfer_pending != NULL && hw_q->flow_transfer_completed != NULL)
+ mlx5_hw_push_queue(hw_q->flow_transfer_pending,
+ hw_q->flow_transfer_completed);
if (!priv->shared_host) {
if (priv->hws_ctpool)
@@ -11932,4 +11936,58 @@ mlx5_hwq_ring_create(uint16_t port_id, uint32_t queue, uint32_t size, const char
}
+static int
+flow_hw_queue_setup_rings(struct rte_eth_dev *dev,
+ uint16_t queue,
+ uint32_t queue_size,
+ bool nt_mode)
+{
+ struct mlx5_priv *priv = dev->data->dev_private;
+
+ /* HWS queue info container must be already allocated. */
+ MLX5_ASSERT(priv->hw_q != NULL);
+
+ /* Notice ring name length is limited. */
+ priv->hw_q[queue].indir_cq = mlx5_hwq_ring_create
+ (dev->data->port_id, queue, queue_size, "indir_act_cq");
+ if (!priv->hw_q[queue].indir_cq) {
+ DRV_LOG(ERR, "port %u failed to allocate indir_act_cq ring for HWS",
+ dev->data->port_id);
+ return -ENOMEM;
+ }
+
+ priv->hw_q[queue].indir_iq = mlx5_hwq_ring_create
+ (dev->data->port_id, queue, queue_size, "indir_act_iq");
+ if (!priv->hw_q[queue].indir_iq) {
+ DRV_LOG(ERR, "port %u failed to allocate indir_act_iq ring for HWS",
+ dev->data->port_id);
+ return -ENOMEM;
+ }
+
+ /*
+ * Sync flow API does not require rings used for table resize handling,
+ * because these rings are only used through async flow APIs.
+ */
+ if (nt_mode)
+ return 0;
+
+ priv->hw_q[queue].flow_transfer_pending = mlx5_hwq_ring_create
+ (dev->data->port_id, queue, queue_size, "tx_pending");
+ if (!priv->hw_q[queue].flow_transfer_pending) {
+ DRV_LOG(ERR, "port %u failed to allocate tx_pending ring for HWS",
+ dev->data->port_id);
+ return -ENOMEM;
+ }
+
+ priv->hw_q[queue].flow_transfer_completed = mlx5_hwq_ring_create
+ (dev->data->port_id, queue, queue_size, "tx_done");
+ if (!priv->hw_q[queue].flow_transfer_completed) {
+ DRV_LOG(ERR, "port %u failed to allocate tx_done ring for HWS",
+ dev->data->port_id);
+ return -ENOMEM;
+ }
+
+ return 0;
+}
+
static int
flow_hw_validate_attributes(const struct rte_flow_port_attr *port_attr,
@@ -12100,20 +12158,6 @@ __flow_hw_configure(struct rte_eth_dev *dev,
for (j = 0; j < _queue_attr[i]->size; j++)
priv->hw_q[i].job[j] = &job[j];
- /* Notice ring name length is limited. */
- priv->hw_q[i].indir_cq = mlx5_hwq_ring_create
- (dev->data->port_id, i, _queue_attr[i]->size, "indir_act_cq");
- if (!priv->hw_q[i].indir_cq)
- goto err;
- priv->hw_q[i].indir_iq = mlx5_hwq_ring_create
- (dev->data->port_id, i, _queue_attr[i]->size, "indir_act_iq");
- if (!priv->hw_q[i].indir_iq)
- goto err;
- priv->hw_q[i].flow_transfer_pending = mlx5_hwq_ring_create
- (dev->data->port_id, i, _queue_attr[i]->size, "tx_pending");
- if (!priv->hw_q[i].flow_transfer_pending)
- goto err;
- priv->hw_q[i].flow_transfer_completed = mlx5_hwq_ring_create
- (dev->data->port_id, i, _queue_attr[i]->size, "tx_done");
- if (!priv->hw_q[i].flow_transfer_completed)
+
+ if (flow_hw_queue_setup_rings(dev, i, _queue_attr[i]->size, nt_mode) < 0)
goto err;
}
@@ -15490,4 +15534,10 @@ flow_hw_update_resized(struct rte_eth_dev *dev, uint32_t queue,
MLX5_ASSERT(hw_flow->flags & MLX5_FLOW_HW_FLOW_FLAG_MATCHER_SELECTOR);
+ /*
+ * Update resized can be called only through async flow API.
+ * These rings are allocated if and only if async flow API was configured.
+ */
+ MLX5_ASSERT(priv->hw_q[queue].flow_transfer_completed != NULL);
+ MLX5_ASSERT(priv->hw_q[queue].flow_transfer_pending != NULL);
/**
* mlx5dr_matcher_resize_rule_move() accepts original table matcher -
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-02-26 10:16:51.438004812 +0000
+++ 0112-net-mlx5-fix-default-memzone-requirements-in-HWS.patch 2026-02-26 10:16:47.128460011 +0000
@@ -1 +1 @@
-From 0da95cc8c246d41d916c53bd397f942c63214634 Mon Sep 17 00:00:00 2001
+From bd350da9155d34b6598d9fac545beea0535abb03 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0da95cc8c246d41d916c53bd397f942c63214634 ]
+
@@ -48 +49,0 @@
-Cc: stable at dpdk.org
@@ -56 +57 @@
-index 22cc7efe65..2ae857aca3 100644
+index 31886219b8..24d1eba02f 100644
@@ -59 +60 @@
-@@ -4489,4 +4489,7 @@ mlx5_hw_pull_flow_transfer_comp(struct rte_eth_dev *dev,
+@@ -4407,4 +4407,7 @@ mlx5_hw_pull_flow_transfer_comp(struct rte_eth_dev *dev,
@@ -67 +68 @@
-@@ -4720,6 +4723,7 @@ __flow_hw_push_action(struct rte_eth_dev *dev,
+@@ -4638,6 +4641,7 @@ __flow_hw_push_action(struct rte_eth_dev *dev,
@@ -77 +78 @@
-@@ -12014,4 +12018,58 @@ mlx5_hwq_ring_create(uint16_t port_id, uint32_t queue, uint32_t size, const char
+@@ -11932,4 +11936,58 @@ mlx5_hwq_ring_create(uint16_t port_id, uint32_t queue, uint32_t size, const char
@@ -136 +137 @@
-@@ -12182,20 +12240,6 @@ __flow_hw_configure(struct rte_eth_dev *dev,
+@@ -12100,20 +12158,6 @@ __flow_hw_configure(struct rte_eth_dev *dev,
@@ -159 +160 @@
-@@ -15572,4 +15616,10 @@ flow_hw_update_resized(struct rte_eth_dev *dev, uint32_t queue,
+@@ -15490,4 +15534,10 @@ flow_hw_update_resized(struct rte_eth_dev *dev, uint32_t queue,
More information about the stable
mailing list