From: Rahul Lakkireddy Date: Fri, 9 Nov 2018 07:56:23 +0000 (+0530) Subject: net/cxgbevf: add PCI uninitialization for VF X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=854f4bf07cd2f857eae1af10a92a01673f262a5b;p=dpdk.git net/cxgbevf: add PCI uninitialization for VF Fixes: 2195df6d11bd ("net/cxgbe: rework ethdev device allocation") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- diff --git a/drivers/net/cxgbe/cxgbevf_ethdev.c b/drivers/net/cxgbe/cxgbevf_ethdev.c index 3b32ca9d44..a6458d533c 100644 --- a/drivers/net/cxgbe/cxgbevf_ethdev.c +++ b/drivers/net/cxgbe/cxgbevf_ethdev.c @@ -177,6 +177,16 @@ out_free_adapter: return err; } +static int eth_cxgbevf_dev_uninit(struct rte_eth_dev *eth_dev) +{ + struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private); + struct adapter *adap = pi->adapter; + + /* Free up other ports and all resources */ + cxgbe_close(adap); + return 0; +} + static int eth_cxgbevf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) { @@ -186,7 +196,7 @@ static int eth_cxgbevf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, static int eth_cxgbevf_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, eth_cxgbevf_dev_uninit); } static struct rte_pci_driver rte_cxgbevf_pmd = {