On Tue, Jun 20, 2017 at 12:20:34PM +0100, Bruce Richardson wrote: > On Tue, Jun 20, 2017 at 12:19:01PM +0200, Gaëtan Rivet wrote: > > On Tue, Jun 20, 2017 at 11:58:54AM +0200, Thomas Monjalon wrote: > > > 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 <pablo.de.lara.gua...@intel.com> > > > > > > > --- > > > > > > > --- 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. > > > > Side note, one can: > > > > (trap 'echo quit' SIGUSR1; echo 'start'; while true; do sleep 1; done) > > |testpmd -i & > > > > and issue a SIGUSR1 to the subshell to cleanly quit testpmd. > > Or: > > > > (trap 'echo show port stats all' SIGUSR1; \ > > trap 'echo quit' SIGUSR2; \ > > echo 'start'; \ > > while true; do :; done) |\ > > testpmd -i & > > > > It's a little contrived, but it does the job and is easy enough to put > > in scripts. > > > Or we can just put in a --tx-first flag and save the user the pain of > doing multi-line bash commands. Usability is a constant complaint about > DPDK that we hear e.g. at userspace every year, so we need to stop > assuming everyone looking to play with DPDK is a shell power-user. > > /Bruce
Sure, but who are the users of testpmd, beside DPDK developers and integration bots? This fix IMO may be useful but it is a crutch for this usability problem. The aimed functionality would result in the end in adding one by one all interactive commands as parameters to have feature-parity between interactive and non-interactive mode. A better solution could be to open the cmdline from testpmd to a pipe when not in interactive mode, instead of relying on the user to do it artificially (as I was doing with my multiline shell command). Then the parameters could be restricted to configuration items that ought to be set before probing any device, instead of each possible elements being added twice in the cmdline and in the parameters. A kind of daemon / background mode if you want. Anyway, that's just my limited experience with integrating testpmd to a CI and using it, I reckon that it may not be the most common use, and I have no opinion regarding this parameter ; I only wanted to give my PoV. -- Gaëtan Rivet 6WIND