net/mlx5: fix incorrect set VLAN ID action offset

Message ID 1582121717-53976-1-git-send-email-suanmingm@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix incorrect set VLAN ID action offset |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation fail apply issues
ci/travis-robot warning Travis build: failed

Commit Message

Suanming Mou Feb. 19, 2020, 2:15 p.m. UTC
  Currently, the set VLAN ID header modify action has already got the
action pointer with offset from the header modify action array, but
the configuration saves the detail to the memory of action with the
offset again. It causes double offset to set the VLAN ID action to
the wrong place in the header modify array.

Remove the offset when get the action pointer to fix that issue.

Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN header")
Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Matan Azrad Feb. 20, 2020, 8:57 a.m. UTC | #1
From: Suanming Mou
> Currently, the set VLAN ID header modify action has already got the action
> pointer with offset from the header modify action array, but the
> configuration saves the detail to the memory of action with the offset again.
> It causes double offset to set the VLAN ID action to the wrong place in the
> header modify array.
> 
> Remove the offset when get the action pointer to fix that issue.
> 
> Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN
> header")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
> Acked-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
  
Raslan Darawsheh Feb. 20, 2020, 11:25 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@mellanox.com>
> Sent: Wednesday, February 19, 2020 4:15 PM
> To: Slava Ovsiienko <viacheslavo@mellanox.com>; Matan Azrad
> <matan@mellanox.com>; Dekel Peled <dekelp@mellanox.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@mellanox.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix incorrect set VLAN ID action offset
> 
> Currently, the set VLAN ID header modify action has already got the
> action pointer with offset from the header modify action array, but
> the configuration saves the detail to the memory of action with the
> offset again. It causes double offset to set the VLAN ID action to
> the wrong place in the header modify array.
> 
> Remove the offset when get the action pointer to fix that issue.
> 
> Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN
> header")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
> Acked-by: Dekel Peled <dekelp@mellanox.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 359a037..5950274 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -637,7 +637,7 @@ struct field_modify_info modify_tcp[] = {
>  	const struct rte_flow_action_of_set_vlan_vid *conf =
>  		(const struct rte_flow_action_of_set_vlan_vid *)(action-
> >conf);
>  	int i = resource->actions_num;
> -	struct mlx5_modification_cmd *actions = &resource->actions[i];
> +	struct mlx5_modification_cmd *actions = resource->actions;
>  	struct field_modify_info *field = modify_vlan_out_first_vid;
> 
>  	if (i >= MLX5_MAX_MODIFY_NUM)
> --
> 1.8.3.1


Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 359a037..5950274 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -637,7 +637,7 @@  struct field_modify_info modify_tcp[] = {
 	const struct rte_flow_action_of_set_vlan_vid *conf =
 		(const struct rte_flow_action_of_set_vlan_vid *)(action->conf);
 	int i = resource->actions_num;
-	struct mlx5_modification_cmd *actions = &resource->actions[i];
+	struct mlx5_modification_cmd *actions = resource->actions;
 	struct field_modify_info *field = modify_vlan_out_first_vid;
 
 	if (i >= MLX5_MAX_MODIFY_NUM)