From: Stephen Hemminger Date: Fri, 2 Aug 2019 02:51:52 +0000 (-0700) Subject: app/testpmd: allow log level on command line X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9201806e9799943b61344305b12c655b153565db;p=dpdk.git app/testpmd: allow log level on command line Since testpmd registers log type after processing command line arguments, it is not possible to do: # testpmd --log-level='testpmd:info' ... Fix this by initializing logtype first. Signed-off-by: Stephen Hemminger --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 518865a7db..159c2ef05b 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3234,15 +3234,15 @@ main(int argc, char** argv) signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); - diag = rte_eal_init(argc, argv); - if (diag < 0) - rte_panic("Cannot init EAL\n"); - testpmd_logtype = rte_log_register("testpmd"); if (testpmd_logtype < 0) rte_panic("Cannot register log type"); rte_log_set_level(testpmd_logtype, RTE_LOG_DEBUG); + diag = rte_eal_init(argc, argv); + if (diag < 0) + rte_panic("Cannot init EAL\n"); + ret = register_eth_event_callback(); if (ret != 0) rte_panic("Cannot register for ethdev events");