patch 'net/mlx5: fix access to flow template operations' has been queued to stable release 22.11.6
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Jun 25 01:59:01 CEST 2024
Hi,
FYI, your patch has been queued to stable release 22.11.6
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/24. 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/739bd81a4664d03fc0357dab0de07e87d8896f4a
Thanks.
Luca Boccassi
---
>From 739bd81a4664d03fc0357dab0de07e87d8896f4a Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Sun, 2 Jun 2024 09:00:49 +0300
Subject: [PATCH] net/mlx5: fix access to flow template operations
[ upstream commit acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 ]
PMD activates HWS template API context during port configuration.
There was no validation that the HWS context was activated before
the PMD tried to process other template function calls.
The patch adds HWS context validation.
Fixes: b401400db24e ("net/mlx5: add port flow configuration")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index c902b35f0b..45709c9fd2 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -56,6 +56,20 @@
#define MLX5_HW_VLAN_PUSH_VID_IDX 1
#define MLX5_HW_VLAN_PUSH_PCP_IDX 2
+static bool
+mlx5_hw_ctx_validate(const struct rte_eth_dev *dev, struct rte_flow_error *error)
+{
+ const struct mlx5_priv *priv = dev->data->dev_private;
+
+ if (!priv->dr_ctx) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "non-template flow engine was not configured");
+ return false;
+ }
+ return true;
+}
+
static int flow_hw_flush_all_ctrl_flows(struct rte_eth_dev *dev);
static int flow_hw_translate_group(struct rte_eth_dev *dev,
const struct mlx5_flow_template_table_cfg *cfg,
@@ -3965,6 +3979,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev,
bool actions_end = false;
int ret;
+ if (!mlx5_hw_ctx_validate(dev, error))
+ return -rte_errno;
/* FDB actions are only valid to proxy port. */
if (attr->transfer && (!priv->sh->config.dv_esw_en || !priv->master))
return rte_flow_error_set(error, EINVAL,
@@ -4717,6 +4733,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
bool items_end = false;
uint32_t tag_bitmap = 0;
+ if (!mlx5_hw_ctx_validate(dev, error))
+ return -rte_errno;
if (!attr->ingress && !attr->egress && !attr->transfer)
return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR, NULL,
"at least one of the direction attributes"
@@ -7975,6 +7993,9 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
bool push = true;
bool aso = false;
+ if (!mlx5_hw_ctx_validate(dev, error))
+ return NULL;
+
if (attr) {
MLX5_ASSERT(queue != MLX5_HW_INV_QUEUE);
if (unlikely(!priv->hw_q[queue].job_idx)) {
--
2.39.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-06-25 00:22:17.404405798 +0100
+++ 0075-net-mlx5-fix-access-to-flow-template-operations.patch 2024-06-25 00:22:13.281187606 +0100
@@ -1 +1 @@
-From acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 Mon Sep 17 00:00:00 2001
+From 739bd81a4664d03fc0357dab0de07e87d8896f4a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
+ drivers/net/mlx5/mlx5_flow_hw.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
@@ -23 +24 @@
-index 53c6cc5961..e97afb0c86 100644
+index c902b35f0b..45709c9fd2 100644
@@ -26,3 +27,3 @@
-@@ -206,6 +206,20 @@ mlx5_destroy_multi_pattern_segment(struct mlx5_multi_pattern_segment *segment);
- static __rte_always_inline enum mlx5_indirect_list_type
- flow_hw_inlist_type_get(const struct rte_flow_action *actions);
+@@ -56,6 +56,20 @@
+ #define MLX5_HW_VLAN_PUSH_VID_IDX 1
+ #define MLX5_HW_VLAN_PUSH_PCP_IDX 2
@@ -44,4 +45,5 @@
- static __rte_always_inline int
- mlx5_multi_pattern_reformat_to_index(enum mlx5dr_action_type type)
- {
-@@ -6399,6 +6413,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev,
+ static int flow_hw_flush_all_ctrl_flows(struct rte_eth_dev *dev);
+ static int flow_hw_translate_group(struct rte_eth_dev *dev,
+ const struct mlx5_flow_template_table_cfg *cfg,
+@@ -3965,6 +3979,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev,
+ bool actions_end = false;
@@ -49 +50,0 @@
- const struct rte_flow_action_ipv6_ext_remove *remove_data;
@@ -56 +57,2 @@
-@@ -7528,6 +7544,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
+@@ -4717,6 +4733,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
+ bool items_end = false;
@@ -58 +59,0 @@
- int ret;
@@ -65 +66,2 @@
-@@ -11259,6 +11277,8 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -7975,6 +7993,9 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+ bool push = true;
@@ -67,10 +68,0 @@
- bool force_job = action->type == RTE_FLOW_ACTION_TYPE_METER_MARK;
-
-+ if (!mlx5_hw_ctx_validate(dev, error))
-+ return NULL;
- if (attr || force_job) {
- job = flow_hw_action_job_init(priv, queue, NULL, user_data,
- NULL, MLX5_HW_Q_JOB_TYPE_CREATE,
-@@ -12541,6 +12561,8 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
- }
- };
@@ -80,3 +72,4 @@
- if (!actions) {
- rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
- NULL, "No action list");
++
+ if (attr) {
+ MLX5_ASSERT(queue != MLX5_HW_INV_QUEUE);
+ if (unlikely(!priv->hw_q[queue].job_idx)) {
More information about the stable
mailing list