[v1,1/1] net/mlx5: fix port id / push VLAN actions index incorrect

Message ID 20210316120517.683168-1-lizh@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series [v1,1/1] net/mlx5: fix port id / push VLAN actions index incorrect |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Li Zhang March 16, 2021, 12:05 p.m. UTC
  When using port id or push VLAN action index to find
the action in cache, it will fail to find actions.
The root cause is the index is not saved in cache when
creating the port id action or push vlan action.
To fix these issues, update the index in cache when creating.

Fixes: 0fd5f82aaa0 ("net/mlx5: make port ID action cache thread safe")
Fixes: 3422af2af2e ("net/mlx5: make push VLAN action cache thread safe")
Cc: stable@dpdk.org

Signed-off-by: Li Zhang <lizh@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Slava Ovsiienko March 16, 2021, 12:21 p.m. UTC | #1
> -----Original Message-----
> From: Li Zhang <lizh@nvidia.com>
> Sent: Tuesday, March 16, 2021 14:05
> To: dev@dpdk.org; Ori Kam <orika@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Suanming
> Mou <suanmingm@nvidia.com>
> Cc: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Raslan
> Darawsheh <rasland@nvidia.com>; stable@dpdk.org
> Subject: [PATCH v1 1/1] net/mlx5: fix port id / push VLAN actions index
> incorrect
> 
> When using port id or push VLAN action index to find the action in cache, it
> will fail to find actions.
> The root cause is the index is not saved in cache when creating the port id
> action or push vlan action.
> To fix these issues, update the index in cache when creating.
> 
> Fixes: 0fd5f82aaa0 ("net/mlx5: make port ID action cache thread safe")
> Fixes: 3422af2af2e ("net/mlx5: make push VLAN action cache thread safe")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  
Raslan Darawsheh March 17, 2021, 4:16 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Li Zhang <lizh@nvidia.com>
> Sent: Tuesday, March 16, 2021 2:05 PM
> To: dev@dpdk.org; Ori Kam <orika@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Suanming
> Mou <suanmingm@nvidia.com>
> Cc: NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Raslan
> Darawsheh <rasland@nvidia.com>; stable@dpdk.org
> Subject: [PATCH v1 1/1] net/mlx5: fix port id / push VLAN actions index
> incorrect
> 
> When using port id or push VLAN action index to find
> the action in cache, it will fail to find actions.
> The root cause is the index is not saved in cache when
> creating the port id action or push vlan action.
> To fix these issues, update the index in cache when creating.
> 
> Fixes: 0fd5f82aaa0 ("net/mlx5: make port ID action cache thread safe")
> Fixes: 3422af2af2e ("net/mlx5: make push VLAN action cache thread safe")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Li Zhang <lizh@nvidia.com>

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 1a74d5ac2b..23e5849783 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -3612,6 +3612,7 @@  flow_dv_port_id_create_cb(struct mlx5_cache_list *list,
 				   "cannot create action");
 		return NULL;
 	}
+	cache->idx = idx;
 	return &cache->entry;
 }
 
@@ -3703,6 +3704,7 @@  flow_dv_push_vlan_create_cb(struct mlx5_cache_list *list,
 				   "cannot create push vlan action");
 		return NULL;
 	}
+	cache->idx = idx;
 	return &cache->entry;
 }