patch 'net/mlx5: fix internal HWS pattern template creation' has been queued to stable release 24.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Feb 20 15:56:28 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.5
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/22/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/70cdc04484b37a0b29b2096ec1ad803878c5f735
Thanks.
Luca Boccassi
---
>From 70cdc04484b37a0b29b2096ec1ad803878c5f735 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Mon, 12 Jan 2026 11:24:37 +0200
Subject: [PATCH] net/mlx5: fix internal HWS pattern template creation
[ upstream commit 2269696b023254d3d4c99e3d5d03466a8f47cce3 ]
HWS pattern template creation tries to build a table with
the tested items after basic verifications to check
if the pattern is valid.
Time consumed in that table creation can be critical for applications
that require fast PMD initialization.
The patch separates pattern templates to internal and external.
Internal templates are created by the PMD and are considered safe and
can skip some validations.
Pattern templates provided by applications will be fully validated.
Fixes: a190f25e6a93 ("net/mlx5: improve pattern template validation")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 35 +++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index af5d4293a9..7a3b45ceec 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8881,6 +8881,7 @@ static struct rte_flow_pattern_template *
flow_hw_pattern_template_create(struct rte_eth_dev *dev,
const struct rte_flow_pattern_template_attr *attr,
const struct rte_flow_item items[],
+ bool external,
struct rte_flow_error *error)
{
struct mlx5_priv *priv = dev->data->dev_private;
@@ -9037,9 +9038,11 @@ setup_pattern_template:
}
}
rte_atomic_fetch_add_explicit(&it->refcnt, 1, rte_memory_order_relaxed);
- rc = pattern_template_validate(dev, &it, 1, error);
- if (rc)
- goto error;
+ if (external) {
+ rc = pattern_template_validate(dev, &it, 1, error);
+ if (rc)
+ goto error;
+ }
LIST_INSERT_HEAD(&priv->flow_hw_itt, it, next);
return it;
error:
@@ -9058,6 +9061,16 @@ error:
return NULL;
}
+static struct rte_flow_pattern_template *
+flow_hw_external_pattern_template_create
+ (struct rte_eth_dev *dev,
+ const struct rte_flow_pattern_template_attr *attr,
+ const struct rte_flow_item items[],
+ struct rte_flow_error *error)
+{
+ return flow_hw_pattern_template_create(dev, attr, items, true, error);
+}
+
/**
* Destroy flow item template.
*
@@ -9611,7 +9624,7 @@ flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev, struct rte_flow_
},
};
- return flow_hw_pattern_template_create(dev, &attr, items, error);
+ return flow_hw_pattern_template_create(dev, &attr, items, false, error);
}
static __rte_always_inline uint32_t
@@ -9904,7 +9917,7 @@ flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev,
},
};
- return flow_hw_pattern_template_create(dev, &attr, items, error);
+ return flow_hw_pattern_template_create(dev, &attr, items, false, error);
}
/**
@@ -9958,7 +9971,7 @@ flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev,
},
};
- return flow_hw_pattern_template_create(dev, &attr, items, error);
+ return flow_hw_pattern_template_create(dev, &attr, items, false, error);
}
/**
@@ -9995,7 +10008,7 @@ flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev,
},
};
- return flow_hw_pattern_template_create(dev, &attr, items, error);
+ return flow_hw_pattern_template_create(dev, &attr, items, false, error);
}
/*
@@ -10031,7 +10044,8 @@ flow_hw_create_lacp_rx_pattern_template(struct rte_eth_dev *dev, struct rte_flow
.type = RTE_FLOW_ITEM_TYPE_END,
},
};
- return flow_hw_pattern_template_create(dev, &pa_attr, eth_all, error);
+ return flow_hw_pattern_template_create(dev, &pa_attr, eth_all,
+ false, error);
}
/**
@@ -11242,7 +11256,7 @@ flow_hw_create_ctrl_rx_pattern_template
{ .type = RTE_FLOW_ITEM_TYPE_END }
};
- return flow_hw_pattern_template_create(dev, &attr, items, NULL);
+ return flow_hw_pattern_template_create(dev, &attr, items, false, NULL);
}
int
@@ -15169,6 +15183,7 @@ flow_hw_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
return 0;
}
+
const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = {
.list_create = flow_hw_list_create,
.list_destroy = flow_hw_list_destroy,
@@ -15176,7 +15191,7 @@ const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = {
.info_get = flow_hw_info_get,
.configure = flow_hw_configure,
.pattern_validate = flow_hw_pattern_validate,
- .pattern_template_create = flow_hw_pattern_template_create,
+ .pattern_template_create = flow_hw_external_pattern_template_create,
.pattern_template_destroy = flow_hw_pattern_template_destroy,
.actions_validate = flow_hw_actions_validate,
.actions_template_create = flow_hw_actions_template_create,
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-02-20 14:55:46.524153153 +0000
+++ 0086-net-mlx5-fix-internal-HWS-pattern-template-creation.patch 2026-02-20 14:55:43.324193108 +0000
@@ -1 +1 @@
-From 2269696b023254d3d4c99e3d5d03466a8f47cce3 Mon Sep 17 00:00:00 2001
+From 70cdc04484b37a0b29b2096ec1ad803878c5f735 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2269696b023254d3d4c99e3d5d03466a8f47cce3 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index 2ae857aca3..dc70909cff 100644
+index af5d4293a9..7a3b45ceec 100644
@@ -32 +33 @@
-@@ -9234,6 +9234,7 @@ static struct rte_flow_pattern_template *
+@@ -8881,6 +8881,7 @@ static struct rte_flow_pattern_template *
@@ -40 +41 @@
-@@ -9388,9 +9389,11 @@ setup_pattern_template:
+@@ -9037,9 +9038,11 @@ setup_pattern_template:
@@ -55 +56 @@
-@@ -9409,6 +9412,16 @@ error:
+@@ -9058,6 +9061,16 @@ error:
@@ -72 +73 @@
-@@ -10014,7 +10027,7 @@ flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev, struct rte_flow_
+@@ -9611,7 +9624,7 @@ flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev, struct rte_flow_
@@ -81 +82 @@
-@@ -10306,7 +10319,7 @@ flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev,
+@@ -9904,7 +9917,7 @@ flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev,
@@ -90 +91 @@
-@@ -10360,7 +10373,7 @@ flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev,
+@@ -9958,7 +9971,7 @@ flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev,
@@ -99 +100 @@
-@@ -10397,7 +10410,7 @@ flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev,
+@@ -9995,7 +10008,7 @@ flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev,
@@ -108 +109 @@
-@@ -10433,7 +10446,8 @@ flow_hw_create_lacp_rx_pattern_template(struct rte_eth_dev *dev, struct rte_flow
+@@ -10031,7 +10044,8 @@ flow_hw_create_lacp_rx_pattern_template(struct rte_eth_dev *dev, struct rte_flow
@@ -118 +119 @@
-@@ -11677,7 +11691,7 @@ flow_hw_create_ctrl_rx_pattern_template
+@@ -11242,7 +11256,7 @@ flow_hw_create_ctrl_rx_pattern_template
@@ -127 +128 @@
-@@ -15705,6 +15719,7 @@ flow_hw_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -15169,6 +15183,7 @@ flow_hw_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -135 +136 @@
-@@ -15712,7 +15727,7 @@ const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = {
+@@ -15176,7 +15191,7 @@ const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = {
More information about the stable
mailing list