Skip to content

Commit

Permalink
examples/l3fwd-power: fix early shutdown
Browse files Browse the repository at this point in the history
[ upstream commit 19781e7 ]

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: d7937e2 ("power: initial import")
Fixes: 613ce66 ("examples/l3fwd-power: implement proper shutdown")

Signed-off-by: Harneet Singh <harneet.singh@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
harneetsi authored and cpaelzer committed Nov 30, 2021
1 parent ffd8f8c commit c98edab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/l3fwd-power/main.c
Expand Up @@ -2216,16 +2216,16 @@ main(int argc, char **argv)
uint8_t num_telstats = RTE_DIM(telstats_strings);
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)
rte_exit(EXIT_FAILURE, "Invalid EAL parameters\n");
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();

Expand Down

0 comments on commit c98edab

Please sign in to comment.