net/cxgbevf: add PCI uninitialization for VF
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 9 Nov 2018 07:56:23 +0000 (13:26 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 13 Nov 2018 23:35:53 +0000 (00:35 +0100)
Fixes: 2195df6d11bd ("net/cxgbe: rework ethdev device allocation")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/cxgbevf_ethdev.c

index 3b32ca9..a6458d5 100644 (file)
@@ -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 = {