From 324bcf45e51bf372de0b16cdeaa90524eaa00499 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Wed, 18 Jun 2014 15:50:35 +0100 Subject: [PATCH] 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 --- examples/ip_fragmentation/main.c | 2 +- examples/ip_reassembly/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1