[2/2] examples/performance-thread: init timer subsystem

Message ID 1563205172-352-3-git-send-email-erik.g.carrillo@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series fix segfault seen with performance-thread example |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Carrillo, Erik G July 15, 2019, 3:39 p.m. UTC
  The timer subsystem should be initialized in the l3fwd-thread app before
the L-thread subsystem can be used.

Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Cc: ian.betts@intel.com

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
---
 examples/performance-thread/l3fwd-thread/main.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index dd46895..c4065e8 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -40,6 +40,7 @@ 
 #include <rte_udp.h>
 #include <rte_string_fns.h>
 #include <rte_pause.h>
+#include <rte_timer.h>
 
 #include <cmdline_parse.h>
 #include <cmdline_parse_etheraddr.h>
@@ -3497,6 +3498,10 @@  main(int argc, char **argv)
 	argc -= ret;
 	argv += ret;
 
+	ret = rte_timer_subsystem_init();
+	if (ret < 0)
+		rte_exit(EXIT_FAILURE, "Failed to initialize timer subystem\n");
+
 	/* pre-init dst MACs for all ports to 02:00:00:00:00:xx */
 	for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) {
 		dest_eth_addr[portid] = RTE_ETHER_LOCAL_ADMIN_ADDR +