* [PATCH] net/mlx5: fix index choosing in TAG modification
@ 2023-11-27 14:50 Michael Baum
2023-11-27 16:01 ` [PATCH v2] " Michael Baum
0 siblings, 1 reply; 3+ messages in thread
From: Michael Baum @ 2023-11-27 14:50 UTC (permalink / raw)
To: dev
Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko, Ori Kam,
Suanming Mou, getelson, stable
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")
Fixes: 04e740e69512 ("net/mlx5: separate registers usage per port")
Cc: getelson@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 115d730317..e168325f2d 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1925,7 +1925,7 @@ mlx5_flow_field_id_to_modify_info
if (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);
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] net/mlx5: fix index choosing in TAG modification
2023-11-27 14:50 [PATCH] net/mlx5: fix index choosing in TAG modification Michael Baum
@ 2023-11-27 16:01 ` Michael Baum
2024-01-07 12:36 ` Raslan Darawsheh
0 siblings, 1 reply; 3+ messages in thread
From: Michael Baum @ 2023-11-27 16:01 UTC (permalink / raw)
To: dev
Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko, Ori Kam,
Suanming Mou, getelson, stable
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")
Fixes: 04e740e69512 ("net/mlx5: separate registers usage per port")
Cc: getelson@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
v2: fix the commit reference format.
drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 115d730317..e168325f2d 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1925,7 +1925,7 @@ mlx5_flow_field_id_to_modify_info
if (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);
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v2] net/mlx5: fix index choosing in TAG modification
2023-11-27 16:01 ` [PATCH v2] " Michael Baum
@ 2024-01-07 12:36 ` Raslan Darawsheh
0 siblings, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2024-01-07 12:36 UTC (permalink / raw)
To: Michael Baum, dev
Cc: Matan Azrad, Slava Ovsiienko, Ori Kam, Suanming Mou,
Gregory Etelson, stable
Hi,
> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Monday, November 27, 2023 6:01 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam
> <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Gregory
> Etelson <getelson@nvidia.com>; stable@dpdk.org
> Subject: [PATCH v2] 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")
>
> Fixes: 04e740e69512 ("net/mlx5: separate registers usage per port")
> Cc: getelson@nvidia.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com>
> ---
> v2: fix the commit reference format.
>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-07 12:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 14:50 [PATCH] net/mlx5: fix index choosing in TAG modification Michael Baum
2023-11-27 16:01 ` [PATCH v2] " Michael Baum
2024-01-07 12:36 ` Raslan Darawsheh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).