app/testpmd: fix numa socket detection
authorStephen Hurd <shurd@broadcom.com>
Wed, 13 Jan 2016 22:23:36 +0000 (14:23 -0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sat, 5 Mar 2016 19:09:31 +0000 (20:09 +0100)
Previously, max_socket was set to the highest numbered socket with
an enabled lcore.  The intent is to set it to the highest socket
regardless of it being enabled.

Fixes: 7acf894d07d1 ("app/testpmd: detect numa socket count")

Signed-off-by: Stephen Hurd <shurd@broadcom.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test-pmd/testpmd.c

index 1319917..269ef81 100644 (file)
@@ -354,17 +354,17 @@ set_default_fwd_lcores_config(void)
 
        nb_lc = 0;
        for (i = 0; i < RTE_MAX_LCORE; i++) {
-               if (! rte_lcore_is_enabled(i))
-                       continue;
-               if (i == rte_get_master_lcore())
-                       continue;
-               fwd_lcores_cpuids[nb_lc++] = i;
                sock_num = rte_lcore_to_socket_id(i) + 1;
                if (sock_num > max_socket) {
                        if (sock_num > RTE_MAX_NUMA_NODES)
                                rte_exit(EXIT_FAILURE, "Total sockets greater than %u\n", RTE_MAX_NUMA_NODES);
                        max_socket = sock_num;
                }
+               if (!rte_lcore_is_enabled(i))
+                       continue;
+               if (i == rte_get_master_lcore())
+                       continue;
+               fwd_lcores_cpuids[nb_lc++] = i;
        }
        nb_lcores = (lcoreid_t) nb_lc;
        nb_cfg_lcores = nb_lcores;