net/mlx5: fix memory management for released offloaded tunnels.
Checks
Commit Message
PMD tunnel offload object can be referenced by application
tunnel_decap_set or tunnel_match commands, when these commands request
private tunnel items or actions and flow rules related to that tunnel.
PMD keeps tunnel offload object as long as there is an active
reference to that tunnel.
PMD releases tunnel offload object after the last reference resumes.
The patch removes tunnel offload object from search database before
it's memory released.
Fixes: bc1d90a3cf6f ("net/mlx5: fix build with Direct Verbs disabled")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 1 +
1 file changed, 1 insertion(+)
@@ -7423,6 +7423,7 @@ mlx5_flow_tunnel_free(struct rte_eth_dev *dev,
DRV_LOG(DEBUG, "port %u release pmd tunnel id=0x%x",
dev->data->port_id, tunnel->tunnel_id);
+ LIST_REMOVE(tunnel, chain);
mlx5_hlist_destroy(tunnel->groups);
ipool = priv->sh->ipool[MLX5_IPOOL_TUNNEL_ID];
mlx5_ipool_free(ipool, tunnel->tunnel_id);