patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] examples/l3fwd-power: fix ctrl+c issue
@ 2021-10-29 14:05 Harneet Singh
  2021-10-29 15:50 ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
  0 siblings, 1 reply; 4+ messages in thread
From: Harneet Singh @ 2021-10-29 14:05 UTC (permalink / raw)
  To: dev; +Cc: Harneet Singh, stable, David Hunt

Currently, EAL init cannot be interrupted with SIGINT because the
signal  handler is already overridden by the time EAL init happens.

Fix it by moving signal handler installation to after EAL
initialization, to allow SIGNIT to interrupt EAL initialization.

Fixes: d7937e2e3d12 ("power: initial import")
Cc: stable@dpdk.org

Signed-off-by: Harneet Singh <harneet.singh@intel.com>

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 21c79567b1..002ba011c3 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2532,9 +2532,6 @@ main(int argc, char **argv)
 	uint16_t portid;
 	const char *ptr_strings[NUM_TELSTATS];
 
-	/* catch SIGINT and restore cpufreq governor to ondemand */
-	signal(SIGINT, signal_exit_now);
-
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
 	if (ret < 0)
@@ -2542,6 +2539,9 @@ main(int argc, char **argv)
 	argc -= ret;
 	argv += ret;
 
+	/* catch SIGINT and restore cpufreq governor to ondemand */
+	signal(SIGINT, signal_exit_now);
+
 	/* init RTE timer library to be used late */
 	rte_timer_subsystem_init();
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/l3fwd-power: fix ctrl+c issue
  2021-10-29 14:05 [dpdk-stable] [PATCH] examples/l3fwd-power: fix ctrl+c issue Harneet Singh
@ 2021-10-29 15:50 ` Burakov, Anatoly
  2021-11-16 14:24   ` David Marchand
  0 siblings, 1 reply; 4+ messages in thread
From: Burakov, Anatoly @ 2021-10-29 15:50 UTC (permalink / raw)
  To: Harneet Singh, dev; +Cc: stable, David Hunt

On 29-Oct-21 3:05 PM, Harneet Singh wrote:
> Currently, EAL init cannot be interrupted with SIGINT because the
> signal  handler is already overridden by the time EAL init happens.
> 
> Fix it by moving signal handler installation to after EAL
> initialization, to allow SIGNIT to interrupt EAL initialization.
> 
> Fixes: d7937e2e3d12 ("power: initial import")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Harneet Singh <harneet.singh@intel.com>
> 
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index 21c79567b1..002ba011c3 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -2532,9 +2532,6 @@ main(int argc, char **argv)
>   	uint16_t portid;
>   	const char *ptr_strings[NUM_TELSTATS];
>   
> -	/* catch SIGINT and restore cpufreq governor to ondemand */
> -	signal(SIGINT, signal_exit_now);
> -
>   	/* init EAL */
>   	ret = rte_eal_init(argc, argv);
>   	if (ret < 0)
> @@ -2542,6 +2539,9 @@ main(int argc, char **argv)
>   	argc -= ret;
>   	argv += ret;
>   
> +	/* catch SIGINT and restore cpufreq governor to ondemand */
> +	signal(SIGINT, signal_exit_now);
> +
>   	/* init RTE timer library to be used late */
>   	rte_timer_subsystem_init();
>   
> 

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/l3fwd-power: fix ctrl+c issue
  2021-10-29 15:50 ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
@ 2021-11-16 14:24   ` David Marchand
  0 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2021-11-16 14:24 UTC (permalink / raw)
  To: Burakov, Anatoly, Harneet Singh; +Cc: dev, dpdk stable, David Hunt

On Fri, Oct 29, 2021 at 5:50 PM Burakov, Anatoly
<anatoly.burakov@intel.com> wrote:
> On 29-Oct-21 3:05 PM, Harneet Singh wrote:
> > Currently, EAL init cannot be interrupted with SIGINT because the
> > signal handler is already overridden by the time EAL init happens.
> >
> > Fix it by moving signal handler installation to after EAL
> > initialization, to allow SIGNIT to interrupt EAL initialization.
> >
> > Fixes: d7937e2e3d12 ("power: initial import")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Harneet Singh <harneet.singh@intel.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH] examples/l3fwd-power: fix ctrl+c issue
@ 2021-10-29 13:42 Harneet Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Harneet Singh @ 2021-10-29 13:42 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: Harneet Singh, stable

Currently, EAL init cannot be interrupted with SIGINT because the
signal  handler is already overridden by the time EAL init happens.

Fix it by moving signal handler installation to after EAL
initialization, to allow SIGNIT to interrupt EAL initialization.

Fixes: d7937e2e3d12 ("power: initial import")
Cc: stable@dpdk.org

Signed-off-by: Harneet Singh <harneet.singh@intel.com>

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 21c79567b1..002ba011c3 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2532,9 +2532,6 @@ main(int argc, char **argv)
 	uint16_t portid;
 	const char *ptr_strings[NUM_TELSTATS];
 
-	/* catch SIGINT and restore cpufreq governor to ondemand */
-	signal(SIGINT, signal_exit_now);
-
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
 	if (ret < 0)
@@ -2542,6 +2539,9 @@ main(int argc, char **argv)
 	argc -= ret;
 	argv += ret;
 
+	/* catch SIGINT and restore cpufreq governor to ondemand */
+	signal(SIGINT, signal_exit_now);
+
 	/* init RTE timer library to be used late */
 	rte_timer_subsystem_init();
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-16 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 14:05 [dpdk-stable] [PATCH] examples/l3fwd-power: fix ctrl+c issue Harneet Singh
2021-10-29 15:50 ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
2021-11-16 14:24   ` David Marchand
  -- strict thread matches above, loose matches on Subject: below --
2021-10-29 13:42 [dpdk-stable] " Harneet Singh

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git