2015-08-27 16:40, Bernard Iremonger: > add dev_flags to rte_eth_dev, add macros for dev_flags. > add numa_node to rte_eth_dev_data. > use dev_type to distinguish between vdev's and pdev's. > remove unused RTE_ETH_DEV_MAX. > > Signed-off-by: Bernard Iremonger <bernard.iremonger at intel.com> [...] > @@ -424,7 +425,10 @@ rte_eth_dev_socket_id(uint8_t port_id) > { > if (!rte_eth_dev_is_valid_port(port_id)) > return -1; > - return rte_eth_devices[port_id].pci_dev->numa_node; > + if (rte_eth_devices[port_id].dev_type == RTE_ETH_DEV_PCI) > + return rte_eth_devices[port_id].pci_dev->numa_node; > + else > + return rte_eth_devices[port_id].data->numa_node;
Clearly not the way to go. We should remove the special cases (PCI, PDEV, VDEV) instead of adding more checks.