net/mlx5: fix index choosing in TAG modification
PATCH 1/1 net/mlx5: fix index choosing in TAG modification
When MPLS modification support was added [1], the "tag_index" field was added into "rte_flow_action_modify_data" structure.
As part of this change, the "RTE_FLOW_FIELD_TAG" type moved to use it for tag array instead of using "level" field.
Using "level" is still supported for backwards compatibility when "tag_index" field is zero.
The "mlx5_flow_field_id_to_modify_info()" function calls "flow_hw_get_reg_id()" function with "level" without checking first whether "tag_index" field is valid.
This patch calls first to "flow_tag_index_get()" function to get the index before sending it to "flow_hw_get_reg_id()" function.
[1] c23626f27b09 ("ethdev: add MPLS header modification")
--- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -1925,7 +1925,7 @@ mlx5_flow_field_id_to_modify_infoif (priv->sh->config.dv_flow_en ==2 ) reg =flow_hw_get_reg_id (dev,RTE_FLOW_ITEM_TYPE_TAG , - data->level); + tag_index);else reg =mlx5_flow_get_reg_id (dev,MLX5_APP_TAG , tag_index, error);
Signature · 1 line
2.25.1
PATCH v2 1/1 net/mlx5: fix index choosing in TAG modification
When MPLS modification support was added [1], the "tag_index" field was added into "rte_flow_action_modify_data" structure.
As part of this change, the "RTE_FLOW_FIELD_TAG" type moved to use it for tag array instead of using "level" field.
Using "level" is still supported for backwards compatibility when "tag_index" field is zero.
The "mlx5_flow_field_id_to_modify_info()" function calls "flow_hw_get_reg_id()" function with "level" without checking first whether "tag_index" field is valid.
This patch calls first to "flow_tag_index_get()" function to get the index before sending it to "flow_hw_get_reg_id()" function.
[1] commit c23626f27b09 ("ethdev: add MPLS header modification")
---
v2: fix the commit reference format.
drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -1925,7 +1925,7 @@ mlx5_flow_field_id_to_modify_infoif (priv->sh->config.dv_flow_en ==2 ) reg =flow_hw_get_reg_id (dev,RTE_FLOW_ITEM_TYPE_TAG , - data->level); + tag_index);else reg =mlx5_flow_get_reg_id (dev,MLX5_APP_TAG , tag_index, error);
Signature · 1 line
2.25.1
Hi,
Quoted 26 lines
-----Original Message-----
From: Michael Baum <[email protected]>
Sent: Monday, November 27, 2023 6:01 PM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Gregory Etelson <[email protected]>; [email protected]
Subject: [PATCH v2] net/mlx5: fix index choosing in TAG modificationWhen MPLS modification support was added [1], the "
tag_index" field was added into "rte_flow_action_modify_data" structure.
As part of this change, the "RTE_FLOW_FIELD_TAG" type moved to use it for tag array instead of using "level" field.
Using "level" is still supported for backwards compatibility when "tag_index" field is zero.The "
mlx5_flow_field_id_to_modify_info()" function calls "flow_hw_get_reg_id()" function with "level" without checking first whether "tag_index" field is valid.This patch calls first to "
flow_tag_index_get()" function to get the index before sending it to "flow_hw_get_reg_id()" function.[1] commit
c23626f27b09("ethdev: add MPLS header modification")
Quoted 9 lines
Fixes 04e740e69512 ("net/mlx5: separate registers usage per port")Signed-off-by Michael Baum <[email protected]>Acked-by Ori Kam <[email protected]>---
v2: fix the commit reference format.
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh