From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A71E81C935 for ; Mon, 14 May 2018 17:46:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 08:46:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,400,1520924400"; d="scan'208";a="54201830" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 14 May 2018 08:46:43 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w4EFkgPI030241; Mon, 14 May 2018 16:46:42 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w4EFkgi5028483; Mon, 14 May 2018 16:46:42 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w4EFkgvR028479; Mon, 14 May 2018 16:46:42 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: Wenzhuo Lu , Jingjing Wu , thomas@monjalon.net, ferruh.yigit@intel.com Date: Mon, 14 May 2018 16:46:42 +0100 Message-Id: <99dbef2bd2d8652f20b4d349048d018756f09290.1526310468.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] app/testpmd: fix testpmd initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 15:46:47 -0000 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 --- app/test-pmd/testpmd.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 664c435..6c3b64a 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"); -- 2.7.4