DPDK patches and discussions
 help / color / mirror / Atom feed
From: William Tu <u9012063@gmail.com>
To: dev@dpdk.org, i.maximets@samsung.com
Subject: [dpdk-dev] [PATCH] net/af_xdp: fix failure on rte_dev_remove
Date: Fri, 31 May 2019 09:52:42 -0700	[thread overview]
Message-ID: <1559321562-39928-1-git-send-email-u9012063@gmail.com> (raw)

When users call rte_eth_dev_close() and rte_dev_remove(), the af_xdp
pmd return -1 (EPERM) due to eth_dev == NULL.

Since the af_xdp pmd driver advertises RTE_ETH_DEV_CLOSE_REMOVE, all
the resources are freed on rte_eth_dev_close().  rte_dev_remove() tries
to detach device and subsequently calls rte_pmd_af_xdp_remove() that tries
to free already freed resources and fails. Fix it by return success.

Fixes: f1debd77efaf6 ("net/af_xdp: introduce AF_XDP PMD")
Reported-at: https://patchwork.ozlabs.org/patch/1106528/
Signed-off-by: William Tu <u9012063@gmail.com>
Suggested-by: Ilya Maximets <i.maximets@samsung.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 35c72272c919..3dcc3628c5d0 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -944,7 +944,7 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev)
 	/* find the ethdev entry */
 	eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(dev));
 	if (eth_dev == NULL)
-		return -1;
+		return 0;
 
 	eth_dev_close(eth_dev);
 	rte_eth_dev_release_port(eth_dev);
-- 
2.7.4


             reply	other threads:[~2019-05-31 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 16:52 William Tu [this message]
2019-06-01 16:13 ` Ye Xiaolong
2019-06-05 15:29   ` Ferruh Yigit
2019-06-06 12:18     ` David Marchand

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=1559321562-39928-1-git-send-email-u9012063@gmail.com \
    --to=u9012063@gmail.com \
    --cc=dev@dpdk.org \
    --cc=i.maximets@samsung.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).