app/testpmd: fix NUMA structures initialization
[dpdk.git] / app / test-pmd / testpmd.c
index dfe6442..dd216f6 100644 (file)
@@ -529,6 +529,13 @@ init_config(void)
        uint8_t port_per_socket[RTE_MAX_NUMA_NODES];
 
        memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
+
+       if (numa_support) {
+               memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+               memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+               memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
+       }
+
        /* Configuration of logical cores. */
        fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
                                sizeof(struct fwd_lcore *) * nb_lcores,
@@ -971,7 +978,8 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
                }
 #endif
 #ifdef RTE_LIBRTE_LATENCY_STATS
-               if (latencystats_lcore_id == rte_lcore_id())
+               if (latencystats_enabled != 0 &&
+                               latencystats_lcore_id == rte_lcore_id())
                        rte_latencystats_update();
 #endif
 
@@ -1779,7 +1787,7 @@ rmv_event_callback(void *arg)
        if (da->type == RTE_DEVTYPE_VIRTUAL)
                snprintf(name, sizeof(name), "%s", da->virt.drv_name);
        else if (da->type == RTE_DEVTYPE_WHITELISTED_PCI)
-               rte_eal_pci_device_name(&da->pci.addr, name, sizeof(name));
+               rte_pci_device_name(&da->pci.addr, name, sizeof(name));
        printf("removing device %s\n", name);
        rte_eal_dev_detach(name);
        dev->state = RTE_ETH_DEV_UNUSED;
@@ -2238,8 +2246,13 @@ main(int argc, char** argv)
                rte_panic("Empty set of forwarding logical cores - check the "
                          "core mask supplied in the command parameters\n");
 
-       /* Bitrate stats disabled by default */
+       /* Bitrate/latency stats disabled by default */
+#ifdef RTE_LIBRTE_BITRATE
        bitrate_enabled = 0;
+#endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+       latencystats_enabled = 0;
+#endif
 
        argc -= diag;
        argv += diag;