DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org, Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>,
	Ferruh Yigit <ferruh.yigit@amd.com>
Subject: Re: [PATCH v4 1/2] testpmd: go back to using cmdline_interact
Date: Fri, 17 Mar 2023 09:38:34 -0700	[thread overview]
Message-ID: <20230317093834.6ae46737@hermes.local> (raw)
In-Reply-To: <ZBSTYKoG3caNHp3n@platinum>

On Fri, 17 Mar 2023 17:20:48 +0100
Olivier Matz <olivier.matz@6wind.com> wrote:

> >  
> > +#ifdef RTE_EXEC_ENV_WINDOWS
> >  	signal(SIGINT, signal_handler);
> >  	signal(SIGTERM, signal_handler);
> > +#else
> > +	/* Want read() not to be restarted on signal */
> > +	struct sigaction action = {
> > +		.sa_handler = signal_handler,
> > +	};
> > +
> > +	sigaction(SIGINT, &action, NULL);
> > +	sigaction(SIGTERM, &action, NULL);
> > +#endif  
> 
> If we have to change this in testpmd, we'll have to do the same in other
> applications.

The only a couple other program combining signal() and cmdline_interact().
These programs all exit from signal handler and never return from it.

In examples/ntb, the program is using the signal suicide (lets kill myself)
model, which will work.  Not sure why it bothers just to print a message.

In examples/vdpa, the program is trapping signal and calling close on ports.
This is not signal safe, but that is up to the vdpa maintainers to address.

Also, examples/vm_power_management is calling channel_XXX_exit() routines
which is not signal safe. Ditto, need the maintainers to address that.

> > +__rte_experimental
> > +void cmdline_cancel(struct cmdline *cl);
> > +  
> 
> The help says this function causes the read() in cmdline_interact to
> exit, but the unix implementation is empty.
> 
> Maybe we should instead explain in what condition this function must
> called. Also, shouldn't this function call cmdline_quit() too to avoid
> the user to do it?

Prefer to have function not to do implicit quit.

PS: cmdline functions need better documentation.


  reply	other threads:[~2023-03-17 16:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 17:19 [RFT] test-pmd: " Stephen Hemminger
2023-03-13 21:38 ` [RFT v2] " Stephen Hemminger
2023-03-14  7:06   ` Ling, WeiX
     [not found]   ` <MW4PR12MB56684FA660218F925D64BE09A4BE9@MW4PR12MB5668.namprd12.prod.outlook.com>
2023-03-14 12:07     ` Pier Damouny
2023-03-14 17:36 ` [PATCH v3 0/3] testpmd control C fixes Stephen Hemminger
2023-03-14 17:36   ` [PATCH v3 1/3] testpmd: go back to using cmdline_interact Stephen Hemminger
2023-03-14 17:36   ` [PATCH v3 2/3] testpmd: use sig_atomic_t for flag Stephen Hemminger
2023-03-15 16:31     ` Stephen Hemminger
2023-03-14 17:36   ` [PATCH v3 3/3] testpmd: enable interrupt in interactive mode Stephen Hemminger
2023-03-14 22:40   ` [PATCH v3 0/3] testpmd control C fixes Stephen Hemminger
2023-03-15  9:46     ` David Marchand
2023-03-15 17:31 ` [PATCH v4 0/2] Fix testpmd interrupt regression Stephen Hemminger
2023-03-15 17:31   ` [PATCH v4 1/2] testpmd: go back to using cmdline_interact Stephen Hemminger
2023-03-17 16:20     ` Olivier Matz
2023-03-17 16:38       ` Stephen Hemminger [this message]
2023-03-15 17:31   ` [PATCH v4 2/2] testpmd: enable interrupt in interactive mode Stephen Hemminger
2023-03-17 16:20     ` Olivier Matz
2023-03-17 16:25       ` Stephen Hemminger
2023-03-16  8:16   ` [PATCH v4 0/2] Fix testpmd interrupt regression Pier Damouny
2023-03-16 12:20   ` Ferruh Yigit
2023-03-16 15:31     ` Stephen Hemminger
2023-03-16 17:01       ` Ferruh Yigit
2023-03-16 17:05         ` Thomas Monjalon
2023-03-16 17:36           ` Ferruh Yigit
2023-03-16 17:27   ` [PATCH] app/testpmd: revert cleanup cleanly from signal Ferruh Yigit
2023-03-17 16:59 ` [PATCH v5] testpmd: go back to using cmdline_interact Stephen Hemminger
2023-03-17 21:12   ` Olivier Matz
2023-03-19 23:28     ` Thomas Monjalon

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=20230317093834.6ae46737@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=olivier.matz@6wind.com \
    --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).