summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2014-04-30 15:16:16 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-04-30 22:59:17 +0200
commit5886ae07d211e4b5e49806dd183812beb31c67ad (patch)
treec6b980f0857cf0b285a5b149c5ddb4a7467ee16e
parent20a0286fd2c0f03bfe06ae419c128b648f5bf9bf (diff)
downloaddpdk-5886ae07d211e4b5e49806dd183812beb31c67ad.zip
dpdk-5886ae07d211e4b5e49806dd183812beb31c67ad.tar.gz
dpdk-5886ae07d211e4b5e49806dd183812beb31c67ad.tar.xz
app/testpmd: fix crash of tx_first mode with numa
When NUMA is enabled, the mbuf pool pointer of per-core fwd_lcores structure is not set, causing a crash when accessing to mbp for txonly burst. Initialize fwd_lcore after allocating NUMA memory pools. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
-rw-r--r--app/test-pmd/testpmd.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 97229a5..9c56914 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -552,15 +552,6 @@ init_config(void)
mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool,
socket_num);
}
- /*
- * Records which Mbuf pool to use by each logical core, if needed.
- */
- for (lc_id = 0; lc_id < nb_lcores; lc_id++) {
- mbp = mbuf_pool_find(rte_lcore_to_socket_id(lc_id));
- if (mbp == NULL)
- mbp = mbuf_pool_find(0);
- fwd_lcores[lc_id]->mbp = mbp;
- }
/* Configuration of Ethernet ports. */
ports = rte_zmalloc("testpmd: ports",
@@ -609,6 +600,17 @@ init_config(void)
}
}
init_port_config();
+
+ /*
+ * Records which Mbuf pool to use by each logical core, if needed.
+ */
+ for (lc_id = 0; lc_id < nb_lcores; lc_id++) {
+ mbp = mbuf_pool_find(rte_lcore_to_socket_id(lc_id));
+ if (mbp == NULL)
+ mbp = mbuf_pool_find(0);
+ fwd_lcores[lc_id]->mbp = mbp;
+ }
+
/* Configuration of packet forwarding streams. */
if (init_fwd_streams() < 0)
rte_exit(EXIT_FAILURE, "FAIL from init_fwd_streams()\n");