struct rte_pci_device *pci_dev)
{
if ((eth_dev == NULL) || (pci_dev == NULL)) {
- RTE_PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n",
- eth_dev, pci_dev);
+ RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p",
+ (void *)eth_dev, (void *)pci_dev);
return;
}
eth_dev->data->numa_node = pci_dev->device.numa_node;
}
+static inline int
+eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device) {
+ struct rte_pci_device *pci_dev = bus_device;
+
+ if (!pci_dev)
+ return -ENODEV;
+
+ rte_eth_copy_pci_info(eth_dev, pci_dev);
+
+ return 0;
+}
+
/**
* @internal
* Allocates a new ethdev slot for an ethernet device and returns the pointer
static inline void
rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
{
- /* free ether device */
- rte_eth_dev_release_port(eth_dev);
-
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(eth_dev->data->dev_private);
eth_dev->device = NULL;
eth_dev->intr_handle = NULL;
+
+ /* free ether device */
+ rte_eth_dev_release_port(eth_dev);
}
typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
ret = dev_init(eth_dev);
if (ret)
rte_eth_dev_pci_release(eth_dev);
+ else
+ rte_eth_dev_probing_finish(eth_dev);
return ret;
}