[dpdk-dev] [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d

Iremonger, Bernard bernard.iremonger at intel.com
Tue Jul 24 17:31:08 CEST 2018


Hi Reshma,

> -----Original Message-----
> From: Pattan, Reshma
> Sent: Tuesday, July 24, 2018 3:47 PM
> To: dev at dpdk.org
> Cc: Iremonger, Bernard <bernard.iremonger at intel.com>;
> thomas at monjalon.net; Singh, Jasvinder <jasvinder.singh at intel.com>;
> olivier.matz at 6wind.com; Mordechay Haimovsky <motih at mellanox.com>
> Subject: RE: [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d
> 
> + CC: Olivier and Mordechay Haimovsky.
> 
> > -----Original Message-----
> > From: Pattan, Reshma
> > Sent: Tuesday, July 24, 2018 3:17 PM
> > To: dev at dpdk.org
> > Cc: Iremonger, Bernard <bernard.iremonger at intel.com>;
> > thomas at monjalon.net; Singh, Jasvinder <jasvinder.singh at intel.com>;
> > Pattan, Reshma <reshma.pattan at intel.com>
> > Subject: [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d
> >
> > Testpmd should be existed gracefully when ctrl+d is typed.

Typo in commit message:
"should be existed" should be "should exit"

> > This behaviour is not handled properly, fix this by calling
> > pmd_test_exit() instead of rte_panic.
> >
> > Fixes: 0ad778b398c6 ("app/testpmd: rework softnic forward mode")
> >
> > Reported-by: Mordechay Haimovsky <motih at mellanox.com>
> > Signed-off-by: Jasvinder Singh <jasvinder.singh at intel.com>
> > Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
> > ---
> > v2: removed changes done to lib/librte_cmdline/cmdline.c reworded
> > commit message and heading.
> > ---
> >  app/test-pmd/cmdline.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 588528928..406008d73 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -17581,9 +17581,9 @@ prompt(void)
> >
> >  	for (;;) {
> >  		status = cmdline_poll(testpmd_cl);
> > -		if (status < 0)
> > -			rte_panic("CLI poll error (%" PRId32 ")\n", status);
> > -		else if (status == RDLINE_EXITED) {
> > +		if (status == RDLINE_EXITED || status == -1) {
> > +			if (status == -1)
> > +				pmd_test_exit();
> >  			cmdline_stdin_exit(testpmd_cl);
> >  			rte_exit(0, "\n");
> >  		}
> > --
> > 2.14.4

Regards,

Bernard.



More information about the dev mailing list