From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] app/testpmd: add parameter to start forwarding TX first Date: Tue, 20 Jun 2017 11:58:54 +0200 Message-ID: <3085290.YZ0U5LvfSW@xps> References: <20170609023044.75127-1-pablo.de.lara.guarch@intel.com> <2741486.Oz5ccjHQup@xps> <20170620092239.GA39980@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Wu, Jingjing" To: Bruce Richardson , "De Lara Guarch, Pablo" Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 8D0CE9E3 for ; Tue, 20 Jun 2017 11:58:56 +0200 (CEST) In-Reply-To: <20170620092239.GA39980@bricha3-MOBL3.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 20/06/2017 11:22, Bruce Richardson: > On Mon, Jun 19, 2017 at 11:12:53PM +0200, Thomas Monjalon wrote: > > 15/06/2017 14:05, De Lara Guarch, Pablo: > > > > Add parameter to start forwarding sending first > > > > a burst of packets, which is useful when testing > > > > a loopback connection. > > > > > > > > This was already implemented as an internal command, > > > > but adding it as a parameter is interesting, as it > > > > allows the user to test a loopback connection without > > > > entering in the internal command line. > > > > > > > > Signed-off-by: Pablo de Lara > > > > --- > > > > --- a/doc/guides/testpmd_app_ug/run_app.rst > > > > +++ b/doc/guides/testpmd_app_ug/run_app.rst > > > > @@ -188,6 +188,14 @@ The commandline options are: > > > > > > > > Start forwarding on initialization. > > > > > > > > +* ``--tx-first`` > > > > + > > > > + Start forwarding, after sending a burst of packets first. > > > > + > > > > +.. Note:: > > > > + > > > > + This flag should be only used in non-interactive mode. > > > > I don't really understand the benefit of this option. > > Why is it better than > > echo start tx_first | testpmd -i > > ? > > The one big difference I see is normal vs abnormal termination. With the > echo command you suggest, the only way to terminate testpmd is to kill > it via signal. With the extra cmdline option, it will cleanly exit via > enter as with non-interactive mode right now. Not a huge difference, but > I think having the extra argument to enable tx-first is useful. I do not see a big difference between "enter" and "ctrl+c". I think it is more flexible to pipe commands instead of options. We could combine the proposed options --tx-first and -T into this command: ( echo 'start tx_first' ; while true ; do echo 'show port stats all' ; sleep 1 ; done ) | testpmd -i It is even possible to add more actions in the loop, so it is less limited than the -T options. It is a matter of deciding whether we prefer to implement more restricted options or leverage the shell to freely program non-interactive testpmd.