examples/ip_frag: fix socket detection

Make everything NUMA-related depend on lcore sockets, not device
sockets. This is because the init_mem() function allocates all data
structures based on NUMA nodes of the lcores in the coremask. Therefore,
when no cores are on socket 0, but there are devices on socket 0, it may
lead to segmentation faults.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit is contained in:
Anatoly Burakov 2014-06-18 15:50:35 +01:00 committed by Thomas Monjalon
parent eaa8d3bf6d
commit 324bcf45e5
2 changed files with 2 additions and 2 deletions

View File

@ -911,7 +911,7 @@ MAIN(int argc, char **argv)
qconf = &lcore_queue_conf[rx_lcore_id];
}
socket = rte_eth_dev_socket_id(portid);
socket = (int) rte_lcore_to_socket_id(rx_lcore_id);
if (socket == SOCKET_ID_ANY)
socket = 0;

View File

@ -1118,7 +1118,7 @@ MAIN(int argc, char **argv)
qconf = &lcore_queue_conf[rx_lcore_id];
}
socket = rte_eth_dev_socket_id(portid);
socket = rte_lcore_to_socket_id(portid);
if (socket == SOCKET_ID_ANY)
socket = 0;