pci: separate detaching ethernet ports from PCI devices
[dpdk.git] / drivers / net / bnxt / bnxt_ethdev.c
index 778323b..eead73b 100644 (file)
@@ -303,7 +303,7 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
        struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
        uint16_t max_vnics, i, j, vpool, vrxq;
 
-       dev_info->pci_dev = eth_dev->pci_dev;
+       dev_info->pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
 
        /* MAC Specifics */
        dev_info->max_mac_addrs = MAX_NUM_MAC_ADDR;
@@ -1014,7 +1014,7 @@ static bool bnxt_vf_pciid(uint16_t id)
 static int bnxt_init_board(struct rte_eth_dev *eth_dev)
 {
        struct bnxt *bp = eth_dev->data->dev_private;
-       struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+       struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
        int rc;
 
        /* enable device (incl. PCI PM wakeup), and bus-mastering */
@@ -1048,7 +1048,7 @@ init_err_disable:
 static int
 bnxt_dev_init(struct rte_eth_dev *eth_dev)
 {
-       struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+       struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
        static int version_printed;
        struct bnxt *bp;
        int rc;
@@ -1057,6 +1057,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
                RTE_LOG(INFO, PMD, "%s", bnxt_version);
 
        rte_eth_copy_pci_info(eth_dev, pci_dev);
+       eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
        bp = eth_dev->data->dev_private;
 
        if (bnxt_vf_pciid(pci_dev->id.device_id))
@@ -1168,7 +1169,7 @@ static struct eth_driver bnxt_rte_pmd = {
        .pci_drv = {
                    .id_table = bnxt_pci_id_map,
                    .drv_flags = RTE_PCI_DRV_NEED_MAPPING |
-                           RTE_PCI_DRV_DETACHABLE | RTE_PCI_DRV_INTR_LSC,
+                           RTE_PCI_DRV_INTR_LSC,
                    .probe = rte_eth_dev_pci_probe,
                    .remove = rte_eth_dev_pci_remove
                    },