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 5659D2C8 for ; Tue, 20 Jun 2017 12:27:18 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2017 03:27:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="982995383" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga003.jf.intel.com with ESMTP; 20 Jun 2017 03:27:15 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.211]) by IRSMSX108.ger.corp.intel.com ([169.254.11.133]) with mapi id 14.03.0319.002; Tue, 20 Jun 2017 11:27:14 +0100 From: "Van Haaren, Harry" To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= , Thomas Monjalon CC: "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v3] app/testpmd: add parameter to start forwarding TX first Thread-Index: AQHS6a7PQL7LNNNtOUicEnCAKYYpAqItirxg Date: Tue, 20 Jun 2017 10:27:14 +0000 Message-ID: References: <20170609023044.75127-1-pablo.de.lara.guarch@intel.com> <2741486.Oz5ccjHQup@xps> <20170620092239.GA39980@bricha3-MOBL3.ger.corp.intel.com> <3085290.YZ0U5LvfSW@xps> <20170620101901.GG29091@bidouze.vm.6wind.com> In-Reply-To: <20170620101901.GG29091@bidouze.vm.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2JmMzE0MjQtNTJiZC00ODQ3LThiYzAtMmViOWM0OTg5ZDNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InJaOU1KdjVFWEs1Yk1yUlhzaDlTQVBXKzZYSEdPS3Z6ckE0aUZUQTVEUlU9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: add parameter to start forwarding TX first 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, 20 Jun 2017 10:27:19 -0000 > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ga=EBtan Rivet > Sent: Tuesday, June 20, 2017 11:19 AM > To: Thomas Monjalon > Cc: Richardson, Bruce ; De Lara Guarch, Pablo > ; dev@dpdk.org; Wu, Jingjing > Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: add parameter to start fo= rwarding TX first >=20 > 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 > > > > > > --- > > > > > > --- 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 kil= l > > > it via signal. With the extra cmdline option, it will cleanly exit vi= a > > > 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. >=20 > Side note, one can: >=20 > (trap 'echo quit' SIGUSR1; echo 'start'; while true; do sleep 1; done) |t= estpmd -i & >=20 > and issue a SIGUSR1 to the subshell to cleanly quit testpmd. > Or: >=20 > (trap 'echo show port stats all' SIGUSR1; \ > trap 'echo quit' SIGUSR2; \ > echo 'start'; \ > while true; do :; done) |\ > testpmd -i & >=20 > It's a little contrived, but it does the job and is easy enough to put > in scripts. >=20 > For automated testing, what I did was open a pipe to testpmd to issue > commands from wherever, allowing to keep testpmd running in the > background and dispatch commands when needed from other terminals. No > need to issue signals at all then. In an expert-user automated testing environment this is a solution yes.. > > 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 comma= nd: > > ( 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 restrict= ed > > options or leverage the shell to freely program non-interactive testpmd= . Lets keep in mind the beginner users, who probably don't have a traffic gen= erator machine, perhaps just 2 ports and a loopback cable. IMO running ./= testpmd -- --tx-first is the easiest way to learn to run traffic using te= stpmd, instead of various shell tricks to work-around a missing CLI flag? A +1 from me to add --tx-first to the CLI, -Harry