[dpdk-dev] [RFC PATCH 1/6] librte_ether: add fields from rte_pci_driver to rte_eth_dev and rte_eth_dev_data.

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Aug 31 16:07:51 CEST 2015


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.


More information about the dev mailing list