From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79A44A0547; Fri, 29 Oct 2021 16:06:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 644DE4111F; Fri, 29 Oct 2021 16:06:55 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D823D410E1; Fri, 29 Oct 2021 16:06:53 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10151"; a="217854214" X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="217854214" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2021 07:06:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="448124685" Received: from silpixa00400900.ir.intel.com ([10.243.22.130]) by orsmga006.jf.intel.com with ESMTP; 29 Oct 2021 07:06:16 -0700 From: Harneet Singh To: dev@dpdk.org Cc: Harneet Singh , stable@dpdk.org, David Hunt Date: Fri, 29 Oct 2021 14:05:56 +0000 Message-Id: <20211029140556.1913267-1-harneet.singh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] examples/l3fwd-power: fix ctrl+c issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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