DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <matan@nvidia.com>, <rasland@nvidia.com>,
	<thomas@monjalon.net>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	"Shahaf Shuler" <shahafs@nvidia.com>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix memory management for released offloaded tunnels.
Date: Wed, 25 Nov 2020 10:26:43 +0200	[thread overview]
Message-ID: <20201125082643.7375-1-getelson@nvidia.com> (raw)

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


             reply	other threads:[~2020-11-25  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  8:26 Gregory Etelson [this message]
2020-11-25  9:44 ` [dpdk-dev] [PATCH v2] " Gregory Etelson
2020-11-25 12:53   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125082643.7375-1-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).