From: Anatoly Burakov Date: Wed, 18 Jun 2014 14:50:35 +0000 (+0100) Subject: examples/ip_frag: fix socket detection X-Git-Tag: spdx-start~10584 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=324bcf45e51bf372de0b16cdeaa90524eaa00499;p=dpdk.git 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 Acked-by: Thomas Monjalon --- diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index ac575553c4..3172ad5a45 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -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; diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index d612c311b2..d02a969d93 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -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;