From: David Hunt Date: Tue, 25 Jul 2017 10:27:52 +0000 (+0100) Subject: app/testpmd: fix Tx first with LSC interrupt X-Git-Tag: spdx-start~2236 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=8820cba4d9cc2b055400e49af617a1a21beb724f app/testpmd: fix Tx first with LSC interrupt 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 Acked-by: Pablo de Lara --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9a36e6664e..7d40139416 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2329,6 +2329,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");