patch 'net/mlx5: fix crash in non-template metadata split' has been queued to stable release 24.11.2
Kevin Traynor
ktraynor at redhat.com
Thu Feb 13 10:58:40 CET 2025
Hi,
FYI, your patch has been queued to stable release 24.11.2
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/17/25. 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/f00e13b2b500eb17b3f25cba1aa78e49c3a0ebc5
Thanks.
Kevin
---
>From f00e13b2b500eb17b3f25cba1aa78e49c3a0ebc5 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Tue, 28 Jan 2025 09:54:04 +0200
Subject: [PATCH] net/mlx5: fix crash in non-template metadata split
[ upstream commit 51470cd861f952d79970972d8c3f1929ddc298f3 ]
For switch dev mode, there is a rule split in case of using mark action.
First rule will have the mark action, tag it with rule ID number
and jump to the second rule that matches the tag and perform
the rest of the actions (like RSS or queue).
First, fix the crash when accessing RSS queue[0] instead of
queue index, same as for queue action handling for
hairpin RX queue check.
Second, set tag action is not supported in HWS,
so, replaced set tag action with modify field action.
Used same tag index for both action and matching.
Fixes: 821a6a5cc495 ("net/mlx5: add metadata split for compatibility")
Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Bing Zhao <bingz at nvidia.com>
---
drivers/net/mlx5/mlx5_nta_split.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_nta_split.c b/drivers/net/mlx5/mlx5_nta_split.c
index b26f305bca..6a85ab7fd1 100644
--- a/drivers/net/mlx5/mlx5_nta_split.c
+++ b/drivers/net/mlx5/mlx5_nta_split.c
@@ -14,4 +14,6 @@
#ifdef HAVE_MLX5_HWS_SUPPORT
+#define BITS_PER_BYTE 8
+
/*
* Generate new actions lists for prefix and suffix flows.
@@ -45,9 +47,8 @@ mlx5_flow_nta_split_qrss_actions_prep(struct rte_eth_dev *dev,
{
struct mlx5_priv *priv = dev->data->dev_private;
- struct mlx5_rte_flow_action_set_tag *set_tag;
+ struct rte_flow_action_modify_field *set_tag;
struct rte_flow_action_jump *jump;
const int qrss_idx = qrss - actions;
uint32_t flow_id = 0;
- int ret = 0;
/* Allocate the new subflow ID and used to be matched later. */
@@ -68,14 +69,14 @@ mlx5_flow_nta_split_qrss_actions_prep(struct rte_eth_dev *dev,
actions_n++;
set_tag = (void *)(prefix_act + actions_n);
- /* Reuse ASO reg, should always succeed. Consider to use REG_C_6. */
- ret = flow_hw_get_reg_id_by_domain(dev, RTE_FLOW_ITEM_TYPE_METER_COLOR,
- MLX5DR_TABLE_TYPE_NIC_RX, 0);
- MLX5_ASSERT(ret != (int)REG_NON);
- set_tag->id = (enum modify_reg)ret;
/* Internal SET_TAG action to set flow ID. */
- set_tag->data = flow_id;
+ set_tag->operation = RTE_FLOW_MODIFY_SET;
+ set_tag->width = sizeof(flow_id) * BITS_PER_BYTE;
+ set_tag->src.field = RTE_FLOW_FIELD_VALUE;
+ memcpy(&set_tag->src.value, &flow_id, sizeof(flow_id));
+ set_tag->dst.field = RTE_FLOW_FIELD_TAG;
+ set_tag->dst.tag_index = RTE_PMD_MLX5_LINEAR_HASH_TAG_INDEX;
/* Construct new actions array and replace QUEUE/RSS action. */
prefix_act[qrss_idx] = (struct rte_flow_action) {
- .type = (enum rte_flow_action_type)MLX5_RTE_FLOW_ACTION_TYPE_TAG,
+ .type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
.conf = set_tag,
};
@@ -133,6 +134,7 @@ mlx5_flow_nta_split_qrss_items_prep(struct rte_eth_dev *dev,
q_tag_spec->data = qrss_id;
q_tag_spec->id = (enum modify_reg)
- flow_hw_get_reg_id_by_domain(dev, RTE_FLOW_ITEM_TYPE_METER_COLOR,
- MLX5DR_TABLE_TYPE_NIC_RX, 0);
+ flow_hw_get_reg_id_by_domain(dev, RTE_FLOW_ITEM_TYPE_TAG,
+ MLX5DR_TABLE_TYPE_NIC_RX,
+ RTE_PMD_MLX5_LINEAR_HASH_TAG_INDEX);
MLX5_ASSERT(q_tag_spec->id != REG_NON);
}
@@ -212,10 +214,10 @@ mlx5_flow_nta_split_metadata(struct rte_eth_dev *dev,
} else if (action_flags & MLX5_FLOW_ACTION_RSS) {
rss = (const struct rte_flow_action_rss *)actions->conf;
- if (mlx5_rxq_is_hairpin(dev, rss->queue[0]))
+ if (mlx5_rxq_is_hairpin(dev, rss->queue_num))
return 0;
}
/* The prefix and suffix flows' actions. */
pefx_act_size = sizeof(struct rte_flow_action) * (actions_n + 1) +
- sizeof(struct rte_flow_action_set_tag) +
+ sizeof(struct rte_flow_action_modify_field) +
sizeof(struct rte_flow_action_jump);
sfx_act_size = sizeof(struct rte_flow_action) * 2;
--
2.48.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-12 17:29:42.342156631 +0000
+++ 0073-net-mlx5-fix-crash-in-non-template-metadata-split.patch 2025-02-12 17:29:34.452946538 +0000
@@ -1 +1 @@
-From 51470cd861f952d79970972d8c3f1929ddc298f3 Mon Sep 17 00:00:00 2001
+From f00e13b2b500eb17b3f25cba1aa78e49c3a0ebc5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 51470cd861f952d79970972d8c3f1929ddc298f3 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list