DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix memory management for released offloaded tunnels.
@ 2020-11-25  8:26 Gregory Etelson
  2020-11-25  9:44 ` [dpdk-dev] [PATCH v2] " Gregory Etelson
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Etelson @ 2020-11-25  8:26 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, thomas, Viacheslav Ovsiienko, Shahaf Shuler

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

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);
-- 
2.29.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH v2] net/mlx5: fix memory management for released offloaded tunnels.
  2020-11-25  8:26 [dpdk-dev] [PATCH] net/mlx5: fix memory management for released offloaded tunnels Gregory Etelson
@ 2020-11-25  9:44 ` Gregory Etelson
  2020-11-25 12:53   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Etelson @ 2020-11-25  9:44 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, thomas, Viacheslav Ovsiienko, Shahaf Shuler

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

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);
-- 
2.29.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix memory management for released offloaded tunnels.
  2020-11-25  9:44 ` [dpdk-dev] [PATCH v2] " Gregory Etelson
@ 2020-11-25 12:53   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2020-11-25 12:53 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: dev, matan, rasland, Viacheslav Ovsiienko, asafp

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-25 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  8:26 [dpdk-dev] [PATCH] net/mlx5: fix memory management for released offloaded tunnels Gregory Etelson
2020-11-25  9:44 ` [dpdk-dev] [PATCH v2] " Gregory Etelson
2020-11-25 12:53   ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git