[v2] net/mlx5: fix memory management for released offloaded tunnels.

Message ID 20201125094427.7975-1-getelson@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] net/mlx5: fix memory management for released offloaded tunnels. |

Checks

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

Commit Message

Gregory Etelson Nov. 25, 2020, 9:44 a.m. UTC
  PMD did not remove tunnel offload object from tunnels database before
it released the object memory. As the result, the tunnels database
become corrupted and subsequent search operations triggered PMD crash.
The patch removes tunnel offload object from the tunnels database when
the object is not in-use by PMD any more.

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(+)
  

Comments

Thomas Monjalon Nov. 25, 2020, 12:53 p.m. UTC | #1
25/11/2020 10:44, Gregory Etelson:
> PMD did not remove tunnel offload object from tunnels database before
> it released the object memory. As the result, the tunnels database
> become corrupted and subsequent search operations triggered PMD crash.
> The patch removes tunnel offload object from the tunnels database when
> the object is not in-use by PMD any more.
> 
> 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>

Applied, thanks
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 642516ad4b..52ade39a42 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -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);