* Copy pci device info to the Ethernet device data. * Shared memory (eth_dev->data) only updated by primary process, so it is safe * to call this function from both primary and secondary processes. * * @param eth_dev * The *eth_dev* pointer is the address of the *rte_eth_dev* structure. * @param pci_dev * The *pci_dev* pointer is the address of the *rte_pci_device* structure. */
| 27 | * The *pci_dev* pointer is the address of the *rte_pci_device* structure. |
| 28 | */ |
| 29 | static inline void |
| 30 | rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, |
| 31 | struct rte_pci_device *pci_dev) |
| 32 | { |
| 33 | if ((eth_dev == NULL) || (pci_dev == NULL)) { |
| 34 | RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p\n", |
| 35 | (void *)eth_dev, (void *)pci_dev); |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | eth_dev->intr_handle = pci_dev->intr_handle; |
| 40 | |
| 41 | if (rte_eal_process_type() == RTE_PROC_PRIMARY) { |
| 42 | eth_dev->data->dev_flags = 0; |
| 43 | if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) |
| 44 | eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; |
| 45 | if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV) |
| 46 | eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV; |
| 47 | |
| 48 | eth_dev->data->numa_node = pci_dev->device.numa_node; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | static inline int |
| 53 | eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device) |
no test coverage detected