patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: stable@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 22.11 v2 5/7] net/nfp: fix device close
Date: Thu,  7 Mar 2024 19:20:21 +0800	[thread overview]
Message-ID: <20240307112023.1867765-6-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240307112023.1867765-1-chaoyong.he@corigine.com>

[ upstream commit 243bbfa0f92f57851ae9369133256a622c79a2a0 ]

Close interface use "rte_eth_dev_destroy()" to destroy representor.
The "rte_eth_dev_destroy()" will call "rte_eth_dev_release_port()" but
the "rte_eth_dev_close()" also calls "rte_eth_dev_release_port()".
This will cause Segmentation fault.

Remove the "rte_eth_dev_destroy()" in nfp representor close interface.

Fixes: 7c596721ae5f ("net/nfp: fix resource leak for flower firmware")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index b3359d3..ac092c2 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -547,13 +547,13 @@ nfp_flower_repr_free(struct nfp_flower_representor *repr,
 {
 	switch (repr_type) {
 	case NFP_REPR_TYPE_PHYS_PORT:
-		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_repr_uninit);
+		nfp_flower_repr_uninit(repr->eth_dev);
 		break;
 	case NFP_REPR_TYPE_PF:
-		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_pf_repr_uninit);
+		nfp_flower_pf_repr_uninit(repr->eth_dev);
 		break;
 	case NFP_REPR_TYPE_VF:
-		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_repr_uninit);
+		nfp_flower_repr_uninit(repr->eth_dev);
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported repr port type.");
-- 
2.39.1


  parent reply	other threads:[~2024-03-07 11:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 11:20 [PATCH 22.11 v2 0/7] backport patch series from NFP PMD Chaoyong He
2024-03-07 11:20 ` [PATCH 22.11 v2 1/7] net/nfp: fix resource leak for CoreNIC firmware Chaoyong He
2024-03-07 11:20 ` [PATCH 22.11 v2 2/7] net/nfp: fix resource leak for flower firmware Chaoyong He
2024-03-07 11:20 ` [PATCH 22.11 v2 3/7] net/nfp: fix resource leak for exit of CoreNIC firmware Chaoyong He
2024-03-07 11:20 ` [PATCH 22.11 v2 4/7] net/nfp: fix resource leak for exit of flower firmware Chaoyong He
2024-03-07 11:20 ` Chaoyong He [this message]
2024-03-07 11:20 ` [PATCH 22.11 v2 6/7] net/nfp: fix device resource freeing Chaoyong He
2024-03-07 11:20 ` [PATCH 22.11 v2 7/7] net/nfp: free switch domain ID on close Chaoyong He
2024-03-07 12:45 ` [PATCH 22.11 v2 0/7] backport patch series from NFP PMD Luca Boccassi

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=20240307112023.1867765-6-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=stable@dpdk.org \
    /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).