DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: dev@dpdk.org, Olivier Matz <olivier.matz@6wind.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>,
	Phil Yang <phil.yang@arm.com>, Jianbo Liu <jianbo.liu@arm.com>
Subject: Re: [PATCH v9] testpmd: cleanup cleanly from signal
Date: Mon, 30 Jan 2023 12:11:33 -0800	[thread overview]
Message-ID: <20230130121133.0af0ba34@hermes.local> (raw)
In-Reply-To: <851ff1c2-ebb4-fd34-b950-06b0f6fd6ef3@amd.com>

On Mon, 30 Jan 2023 18:48:25 +0000
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 1/25/2023 6:32 PM, Stephen Hemminger wrote:
> > Do a clean shutdown of testpmd when a signal is received; instead of
> > having testpmd kill itself.  This fixes the problem where a signal could
> > be received in the middle of a PMD and then the signal handler would
> > call PMD's close routine leading to locking problems.
> > 
> > An added benefit is it gets rid of some Windows specific code.
> > 
> > Fixes: d9a191a00e81 ("app/testpmd: fix quitting in container")
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> 
> Patch looks good to me, but './devtools/test-null.sh' hangs with change.
> 
> It is possible the fix by updating './devtools/test-null.sh', but my
> concern is if this behavior change hit more consumers other than this
> internal tool, and I am for keeping previous behavior.
> 
> './devtools/test-null.sh' sends 'stop' command to testpmd but that seems
> not really what makes testpmd quit, because following change still works
> with original testpmd code:
>  -(sleep 1 && echo stop) |
>  +(sleep 1 && echo help) |
> Somehow testpmd gets Ctrl-D or equivalent with above command.
> 
> And it seems because of 'cmdline_interact()' and 'cmdline_poll()'
> difference behavior changes with above command.
> 
> It is possible to add something like  'cmdline_interact_one()' (non loop
> version of 'cmdline_interact()'), but not really sure that is correct
> way to fix the issue.
> 

Thanks for the review.
Fixed the end-of-file handling in v10 of the patch.
The cmdline_poll() function doesn't handle EOF correctly.

The function cmdline_poll() documentation is problematic since it
references that the return value is an enum, but the enum is actually
private and not exported by the library!


  reply	other threads:[~2023-01-30 20:11 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 17:23 [RFC 1/2] testpmd: make f_quit flag volatile Stephen Hemminger
2022-10-14 17:23 ` [RFC 2/2] testpmd: cleanup cleanly from signal Stephen Hemminger
2022-11-06 10:50   ` Andrew Rybchenko
2022-11-08 18:16     ` Stephen Hemminger
2022-11-08 18:53   ` [PATCH v2] " Stephen Hemminger
2022-11-08 20:24   ` [PATCH v3] " Stephen Hemminger
2022-11-09  4:10   ` [PATCH v4] " Stephen Hemminger
2022-11-09 21:46     ` Mattias Rönnblom
2022-11-09 22:53       ` Stephen Hemminger
2022-11-10  7:50         ` Mattias Rönnblom
2022-11-10 16:14           ` Stephen Hemminger
2022-11-10 22:06             ` Mattias Rönnblom
2022-11-09 17:29   ` [PATCH v5] " Stephen Hemminger
2022-11-10  7:14     ` Andrew Rybchenko
2022-11-10 16:13       ` Stephen Hemminger
2022-11-10 16:53   ` [PATCH v6] " Stephen Hemminger
2022-11-11  8:05     ` Andrew Rybchenko
2022-11-11 16:49       ` Stephen Hemminger
2022-11-11 16:51   ` [PATCH v7] " Stephen Hemminger
2022-11-12 17:28   ` [PATCH v8] " Stephen Hemminger
2023-01-19 15:53     ` Ferruh Yigit
2023-01-25 18:32     ` [PATCH v9] " Stephen Hemminger
2023-01-30 18:48       ` Ferruh Yigit
2023-01-30 20:11         ` Stephen Hemminger [this message]
2022-11-06 10:48 ` [RFC 1/2] testpmd: make f_quit flag volatile Andrew Rybchenko
2022-11-08 18:07 ` [PATCH v2] " Stephen Hemminger
2022-11-09 10:11   ` Ruifeng Wang
2022-11-09 10:37     ` Andrew Rybchenko
2023-01-30 20:09 ` [PATCH v10 0/2] testpmd: handle signals safely Stephen Hemminger
2023-01-30 20:09   ` [PATCH v10 1/2] cmdline: handle EOF in cmdline_poll Stephen Hemminger
2023-01-30 22:12     ` Ferruh Yigit
2023-01-31  2:54       ` Stephen Hemminger
2023-01-30 20:09   ` [PATCH v10 2/2] testpmd: cleanup cleanly from signal Stephen Hemminger
2023-01-31  9:30     ` Ferruh Yigit
2023-01-30 22:13   ` [PATCH v10 0/2] testpmd: handle signals safely Ferruh Yigit
2023-02-03 19:14   ` [PATCH v11 0/3] Fix cmdline_poll and testpmd signal handling Stephen Hemminger
2023-02-03 19:14     ` [PATCH v11 1/3] cmdline: make rdline status not private Stephen Hemminger
2023-02-06  2:31       ` fengchengwen
2023-02-03 19:14     ` [PATCH v11 2/3] cmdline: handle EOF in cmdline_poll Stephen Hemminger
2023-02-03 19:14     ` [PATCH v11 3/3] testpmd: cleanup cleanly from signal Stephen Hemminger
2023-02-07 14:49       ` Ferruh Yigit
2023-02-07 14:48     ` [PATCH v11 0/3] Fix cmdline_poll and testpmd signal handling Ferruh Yigit
2023-02-19 17:53     ` Stephen Hemminger
2023-03-11 10:17       ` Thomas Monjalon
2023-03-12 17:18         ` Tal Shnaiderman
2023-03-13 10:34           ` Ling, WeiX
2023-03-13 15:53             ` Stephen Hemminger
2023-03-14  7:05               ` Ling, WeiX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230130121133.0af0ba34@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=jianbo.liu@arm.com \
    --cc=olivier.matz@6wind.com \
    --cc=phil.yang@arm.com \
    --cc=thomas@monjalon.net \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).