[v2] app/testpmd: fix testpmd exit for ctrl+d
Checks
Commit Message
Testpmd should be existed gracefully when ctrl+d is typed.
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@mellanox.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@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(-)
Comments
+ CC: Olivier and Mordechay Haimovsky.
> -----Original Message-----
> From: Pattan, Reshma
> Sent: Tuesday, July 24, 2018 3:17 PM
> To: dev@dpdk.org
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas@monjalon.net; Singh, Jasvinder <jasvinder.singh@intel.com>;
> Pattan, Reshma <reshma.pattan@intel.com>
> Subject: [PATCH v2] app/testpmd: fix testpmd exit for ctrl+d
>
> Testpmd should be existed gracefully when ctrl+d is typed.
> 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@mellanox.com>
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> Signed-off-by: Reshma Pattan <reshma.pattan@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
Hi ,
Can you check if v2 version is working ? And it would be great if you add Tested-by: if test passes.
Else, please let me know the steps to reproduce the issue.
Thanks,
Reshma
Hi Reshma,
> -----Original Message-----
> From: Pattan, Reshma
> Sent: Tuesday, July 24, 2018 3:47 PM
> To: dev@dpdk.org
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas@monjalon.net; Singh, Jasvinder <jasvinder.singh@intel.com>;
> olivier.matz@6wind.com; Mordechay Haimovsky <motih@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@dpdk.org
> > Cc: Iremonger, Bernard <bernard.iremonger@intel.com>;
> > thomas@monjalon.net; Singh, Jasvinder <jasvinder.singh@intel.com>;
> > Pattan, Reshma <reshma.pattan@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@mellanox.com>
> > Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> > Signed-off-by: Reshma Pattan <reshma.pattan@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.
24/07/2018 16:46, Pattan, Reshma:
> + CC: Olivier and Mordechay Haimovsky.
>
> > Testpmd should be existed gracefully when ctrl+d is typed.
> > 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@mellanox.com>
> > Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > ---
> > v2: removed changes done to lib/librte_cmdline/cmdline.c reworded commit
> > message and heading.
The partial revert from Moti is preferred.
@@ -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");
}