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 332A1A0547 for ; Fri, 29 Oct 2021 15:42:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2DC6A410E1; Fri, 29 Oct 2021 15:42:18 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A8324410E1 for ; Fri, 29 Oct 2021 15:42:15 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10151"; a="254250132" X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="254250132" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2021 06:42:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="448118585" Received: from silpixa00400900.ir.intel.com ([10.243.22.130]) by orsmga006.jf.intel.com with ESMTP; 29 Oct 2021 06:42:13 -0700 From: Harneet Singh To: anatoly.burakov@intel.com Cc: Harneet Singh , stable@dpdk.org Date: Fri, 29 Oct 2021 13:42:05 +0000 Message-Id: <20211029134205.1912326-1-harneet.singh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] examples/l3fwd-power: fix ctrl+c issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "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 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