From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 9B9EB3256 for ; Tue, 20 Jun 2017 12:19:10 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id d73so15629038wma.0 for ; Tue, 20 Jun 2017 03:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=JAuBO2/I9Se3/uOJ4V40McQB7HgRCCFFaFB7JifSoE8=; b=peupqdNN+dopbsLB4yqjOe+rj6AGuQ9rQQMRo7yGRw93gmK9wfmhUvPy7JrpEqgCdH lkUqHRsoCq7R/eAi3moBLdLi57GZud3uE//k4Q/HC7csWASZaBrPmWc0Smm0cFc1vmdg k2lRWNnDAqtys/E4Ylm9g85vtxVL3wH3LK9lE3BfHdW7UII7xPea+c6r0GO8c5VkiUgf 1AF4GD6Y8+MERofd0ihOqOLOs+PCh8iphq8UmO4hmDLV8BZUlw6zMm6Ye5c3diYBjEfs kd1o4wSn8a2KJesNaDy4ztitETZJkT+yFnEObCnDt03IaHHYxe+7ZHe4trDznH2qwGY5 VANA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=JAuBO2/I9Se3/uOJ4V40McQB7HgRCCFFaFB7JifSoE8=; b=OxziHRuNqUaOClq8SUkeNxkeBg13aUyZXI0t8jJbOuCVY0m5D/kE1cNv2JOeahYg7c y61OIWziKew4sMzwsI0eRnkQJHCqPDBXRCDG9bC2M3MMz8y+Qumr8/8/mF3OJiLHGOj8 4oJpYDzmn7bWSCa0JZayAC/GOuXDM+r2KWo/7edq7bxagRVT7YjIolTdDfQ6e0v0ZVjo R1J7AnnOGjtyOvJhuk52et2EIH7lp7EOSFqthwSNrc81gUsLmyhncJqWA3G6RmG7CTbt LAVs6eBUvvi4wTC7SMi7pFnFZ0YSrGHcGltwWtVUexPlD79+JZ7mwkW+ht/S/NmCyy3S fBSw== X-Gm-Message-State: AKS2vOxCdsNuyt8DFe6WtEt0PXD0PafkmLq2Qcm/AyrhsFofgYxkimv/ rIZs+/K1gUDVO0iS X-Received: by 10.80.186.47 with SMTP id g44mr20664000edc.15.1497953950011; Tue, 20 Jun 2017 03:19:10 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i42sm6532511ede.5.2017.06.20.03.19.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 03:19:09 -0700 (PDT) Date: Tue, 20 Jun 2017 12:19:01 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Thomas Monjalon Cc: Bruce Richardson , "De Lara Guarch, Pablo" , dev@dpdk.org, "Wu, Jingjing" Message-ID: <20170620101901.GG29091@bidouze.vm.6wind.com> References: <20170609023044.75127-1-pablo.de.lara.guarch@intel.com> <2741486.Oz5ccjHQup@xps> <20170620092239.GA39980@bricha3-MOBL3.ger.corp.intel.com> <3085290.YZ0U5LvfSW@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3085290.YZ0U5LvfSW@xps> User-Agent: Mutt/1.5.23 (2014-03-12) 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:19:10 -0000 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 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. 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. > > 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. -- Gaëtan Rivet 6WIND