summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Gupta <agupta3@marvell.com>2019-08-05 13:30:44 +0530
committerKevin Traynor <ktraynor@redhat.com>2019-09-13 10:37:20 +0100
commit7f160ae926dbe9c13b9260fce88bb05eeaf9a94c (patch)
treea937e1d27ef1b2656da438547fc2f9c4c4ddc636
parentd01a762140c036c6c62b48011f83496323a07a50 (diff)
downloaddpdk-stable-7f160ae926dbe9c13b9260fce88bb05eeaf9a94c.zip
dpdk-stable-7f160ae926dbe9c13b9260fce88bb05eeaf9a94c.tar.gz
dpdk-stable-7f160ae926dbe9c13b9260fce88bb05eeaf9a94c.tar.xz
net/thunderx: fix crash on detach
[ upstream commit 230dce6461b92f36c819f1cf29c0c0e0f8d11ea8 ] Fix the PCIe detach segfault by releasing eth_dev resources by adding nicvf cleanup support on PCI detach. Fixes: fdf91e0f2fac ("drivers/net: do not use ethdev driver") Signed-off-by: Amit Gupta <agupta3@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
-rw-r--r--drivers/net/thunderx/nicvf_ethdev.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 8f5664d..ae5a33e 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -2083,6 +2083,16 @@ kvlist_free:
return ret;
}
static int
+nicvf_eth_dev_uninit(struct rte_eth_dev *dev)
+{
+ PMD_INIT_FUNC_TRACE();
+
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ nicvf_dev_close(dev);
+
+ return 0;
+}
+static int
nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
{
int ret;
@@ -2255,7 +2265,7 @@ static int nicvf_eth_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev)
{
- return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
+ return rte_eth_dev_pci_generic_remove(pci_dev, nicvf_eth_dev_uninit);
}
static struct rte_pci_driver rte_nicvf_pmd = {