ethdev: decouple from PCI device
[dpdk.git] / drivers / net / thunderx / nicvf_ethdev.c
index df91289..1060319 100644 (file)
@@ -1335,10 +1335,11 @@ static void
 nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
        struct nicvf *nic = nicvf_pmd_priv(dev);
+       struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev->device);
 
        PMD_INIT_FUNC_TRACE();
 
-       dev_info->pci_dev = dev->pci_dev;
+       dev_info->pci_dev = RTE_DEV_TO_PCI(dev->device);
 
        dev_info->min_rx_bufsize = ETHER_MIN_MTU;
        dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
@@ -1347,7 +1348,7 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->max_tx_queues =
                        (uint16_t)MAX_SND_QUEUES_PER_QS * (MAX_SQS_PER_VF + 1);
        dev_info->max_mac_addrs = 1;
-       dev_info->max_vfs = dev->pci_dev->max_vfs;
+       dev_info->max_vfs = pci_dev->max_vfs;
 
        dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
        dev_info->tx_offload_capa =
@@ -1977,7 +1978,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
                }
        }
 
-       pci_dev = eth_dev->pci_dev;
+       pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
        rte_eth_copy_pci_info(eth_dev, pci_dev);
 
        nic->device_id = pci_dev->id.device_id;