net/mlx5: fix flow actions index in cache
authorLi Zhang <lizh@nvidia.com>
Tue, 16 Mar 2021 12:05:17 +0000 (14:05 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Tue, 23 Mar 2021 12:52:29 +0000 (13:52 +0100)
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: 0fd5f82aaa07 ("net/mlx5: make port ID action cache thread safe")
Fixes: 3422af2af2e4 ("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>
drivers/net/mlx5/mlx5_flow_dv.c

index 1a74d5a..23e5849 100644 (file)
@@ -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;
 }