DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix crash when using set fwd tx_first with NUMA
@ 2014-04-30 13:16 David Marchand
  2014-04-30 21:15 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2014-04-30 13:16 UTC (permalink / raw)
  To: dev

From: Adrien Mazarguil <adrien.mazarguil@6wind.com>

When NUMA is enabled, the per-core fwd_lcore structure mbuf pool pointer
is not set, causing a crash.

Initialize fwd_lcore after allocating NUMA memory pools.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 app/test-pmd/testpmd.c |   20 +++++++++++---------
 1 file 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");
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-30 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 13:16 [dpdk-dev] [PATCH] app/testpmd: fix crash when using set fwd tx_first with NUMA David Marchand
2014-04-30 21:15 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).