From: Houssem Bouhlel Date: Mon, 25 Oct 2021 14:24:14 +0000 (+0200) Subject: bus/pci: fix selection of default device NUMA node X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=3a05b98dd6d72851d4a8819dbffcd52aaf98a2b1 bus/pci: fix selection of default device NUMA node There can be dev binding issue when no hugepages are allocated for socket 0. To avoid this, set device numa node value based on the first lcore instead of 0. Signed-off-by: Houssem Bouhlel Signed-off-by: Olivier Matz --- diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 3406e03b29..9bffdf1ecd 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -166,6 +166,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev) { int ret; + unsigned socket_id; bool already_probed; struct rte_pci_addr *loc; @@ -194,7 +195,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, if (rte_socket_count() > 1) RTE_LOG(INFO, EAL, "Device %s is not NUMA-aware, defaulting socket to 0\n", dev->name); - dev->device.numa_node = 0; + socket_id = rte_lcore_to_socket_id(rte_get_next_lcore(-1, 0, 0)); + dev->device.numa_node = socket_id; } already_probed = rte_dev_is_probed(&dev->device);