[dpdk-dev,v1] app/testpmd: fix Tx first with LSC interrupt

Message ID 1500978472-182803-1-git-send-email-david.hunt@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hunt, David July 25, 2017, 10:27 a.m. UTC
  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 <david.hunt@intel.com>
---
 app/test-pmd/testpmd.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

De Lara Guarch, Pablo Aug. 1, 2017, 12:54 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Hunt
> Sent: Tuesday, July 25, 2017 11:28 AM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Hunt, David
> <david.hunt@intel.com>
> Subject: [dpdk-dev] [PATCH v1] 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 <david.hunt@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Thomas Monjalon Aug. 3, 2017, 9:44 p.m. UTC | #2
> > 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 <david.hunt@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

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");