From: Anatoly Burakov Date: Mon, 14 May 2018 15:46:42 +0000 (+0100) Subject: app/testpmd: fix initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4aa0d0121a3a1c542dce35194b8704bb2358c06b;p=dpdk.git app/testpmd: fix initialization Patch adding configurable locking has reshuffled some init stages, but did not put them back in correct order. Fix order of init by moving everything that was before arguments parsing into correct places. Fixes: e505d84c64ab ("app/testpmd: make locking memory configurable") Reported-by: Thomas Monjalon Signed-off-by: Anatoly Burakov Tested-by: Ali Alnubani Acked-by: Konstantin Ananyev --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 02a28199b3..f79ed1efbd 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2646,6 +2646,23 @@ main(int argc, char** argv) rte_panic("Cannot register log type"); rte_log_set_level(testpmd_logtype, RTE_LOG_DEBUG); +#ifdef RTE_LIBRTE_PDUMP + /* initialize packet capture framework */ + rte_pdump_init(NULL); +#endif + + nb_ports = (portid_t) rte_eth_dev_count_avail(); + if (nb_ports == 0) + TESTPMD_LOG(WARNING, "No probed ethernet devices\n"); + + /* allocate port structures, and init them */ + init_port(); + + set_def_fwd_config(); + if (nb_lcores == 0) + rte_panic("Empty set of forwarding logical cores - check the " + "core mask supplied in the command parameters\n"); + /* Bitrate/latency stats disabled by default */ #ifdef RTE_LIBRTE_BITRATE bitrate_enabled = 0; @@ -2671,23 +2688,6 @@ main(int argc, char** argv) strerror(errno)); } -#ifdef RTE_LIBRTE_PDUMP - /* initialize packet capture framework */ - rte_pdump_init(NULL); -#endif - - nb_ports = (portid_t) rte_eth_dev_count_avail(); - if (nb_ports == 0) - TESTPMD_LOG(WARNING, "No probed ethernet devices\n"); - - /* allocate port structures, and init them */ - init_port(); - - set_def_fwd_config(); - if (nb_lcores == 0) - rte_panic("Empty set of forwarding logical cores - check the " - "core mask supplied in the command parameters\n"); - if (tx_first && interactive) rte_exit(EXIT_FAILURE, "--tx-first cannot be used on " "interactive mode.\n");