From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 51ACE2C24 for ; Tue, 25 Jul 2017 12:43:41 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2017 03:43:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,411,1496127600"; d="scan'208";a="115354799" Received: from silpixa00397898.ir.intel.com ([10.237.223.116]) by orsmga002.jf.intel.com with ESMTP; 25 Jul 2017 03:43:38 -0700 From: David Hunt To: dev@dpdk.org Cc: jingjing.wu@intel.com, David Hunt Date: Tue, 25 Jul 2017 11:27:52 +0100 Message-Id: <1500978472-182803-1-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH v1] app/testpmd: fix Tx first with LSC interrupt 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: Tue, 25 Jul 2017 10:43:42 -0000 The lsc_interrupt flag is enabled by default, and when the --tx-first is used as a command line parameter, the 32 packets can be sent out before the link state is up, resulting in the loss of the packets, and no further forwarding will take place. E.g. ./build/app/testpmd -c f0 -- --tx-first --stats-period 1 When the --tx-first is used, the lsc_interrupt flag needs to be disabled, ensuring the links are up before forwarding traffic. Therefore, during the parameter checking at startup, if --tx-first is used, we now warn the user, and set lsc_interrupt to 0. Fixes: 99cabef08855 ("app/testpmd: add parameter to start forwarding Tx first") Signed-off-by: David Hunt --- app/test-pmd/testpmd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e754d12..4ca3445 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2326,6 +2326,13 @@ main(int argc, char** argv) if (tx_first && interactive) rte_exit(EXIT_FAILURE, "--tx-first cannot be used on " "interactive mode.\n"); + + if (tx_first && lsc_interrupt) { + printf("Warning: lsc_interrupt needs to be off when " + " using tx_first. Disabling.\n"); + lsc_interrupt = 0; + } + if (!nb_rxq && !nb_txq) printf("Warning: Either rx or tx queues should be non-zero\n"); -- 2.7.4