DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: gaetan.rivet@6wind.com, ferruh.yigit@intel.com,
	arybchenko@solarflare.com, wisamm@mellanox.com,
	ophirmu@mellanox.com
Subject: [dpdk-dev] [PATCH] devargs: fix freeing during device removal
Date: Thu, 18 Oct 2018 02:19:49 +0200	[thread overview]
Message-ID: <20181018001949.17443-1-thomas@monjalon.net> (raw)

After calling unplug function of a bus, the device is expected
to be freed. It is too late for getting devargs to remove.
Anyway, the buses which implement unplug are already freeing
the devargs, except the PCI bus.
So the call to rte_devargs_remove() is removed from EAL and
added in PCI.

Fixes: 2effa126fbd8 ("devargs: simplify parameters of removal function")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/pci/pci_common.c           | 1 +
 lib/librte_eal/common/eal_common_dev.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 41f8fc27e..feb79803c 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -522,6 +522,7 @@ pci_unplug(struct rte_device *dev)
 	ret = rte_pci_detach_dev(pdev);
 	if (ret == 0) {
 		rte_pci_remove_device(pdev);
+		rte_devargs_remove(dev->devargs);
 		free(pdev);
 	}
 	return ret;
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 0c873bfe0..8b0844af1 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -372,8 +372,6 @@ local_dev_remove(struct rte_device *dev)
 		return ret;
 	}
 
-	rte_devargs_remove(dev->devargs);
-
 	return 0;
 }
 
-- 
2.19.0

             reply	other threads:[~2018-10-18  0:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18  0:19 Thomas Monjalon [this message]
2018-10-19 20: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=20181018001949.17443-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=gaetan.rivet@6wind.com \
    --cc=ophirmu@mellanox.com \
    --cc=wisamm@mellanox.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).