[dpdk-dev,v3] app/testpmd: initialize port_numa and ring_numa
Checks
Commit Message
Previous numa_support = 0 by default, it need to add --numa to testpmd
command line to enable numa, so port_numa and ring_numa were initialized
at function launch_args_parse(), now testpmd change numa_support = 1 as
default, so port_numa and ring_numa also need to initialize by default,
otherwise port->socket_id will be probed to wrong value.
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
---
app/test-pmd/parameters.c | 6 +-----
app/test-pmd/testpmd.c | 6 ++++++
2 files changed, 7 insertions(+), 5 deletions(-)
@@ -665,12 +665,8 @@ launch_args_parse(int argc, char** argv)
parse_fwd_portmask(optarg);
if (!strcmp(lgopts[opt_idx].name, "no-numa"))
numa_support = 0;
- if (!strcmp(lgopts[opt_idx].name, "numa")) {
+ if (!strcmp(lgopts[opt_idx].name, "numa"))
numa_support = 1;
- 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);
- }
if (!strcmp(lgopts[opt_idx].name, "mp-anon")) {
mp_anon = 1;
}
@@ -543,6 +543,12 @@ init_config(void)
fwd_lcores[lc_id]->cpuid_idx = lc_id;
}
+ 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);
+ }
+
/*
* Create pools of mbuf.
* If NUMA support is disabled, create a single pool of mbuf in