examples/ip_frag: fix socket detection
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 18 Jun 2014 14:50:35 +0000 (15:50 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 26 Jun 2014 20:51:58 +0000 (22:51 +0200)
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>
examples/ip_fragmentation/main.c
examples/ip_reassembly/main.c

index ac57555..3172ad5 100644 (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;
 
index d612c31..d02a969 100644 (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;