From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD9D3A056E; Wed, 11 Mar 2020 15:39:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 81D451BF7F; Wed, 11 Mar 2020 15:39:06 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 378E93B5; Wed, 11 Mar 2020 15:39:04 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 07:39:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,541,1574150400"; d="scan'208";a="443573541" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by fmsmga006.fm.intel.com with ESMTP; 11 Mar 2020 07:39:01 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: david.marchand@redhat.com, aconole@redhat.com, Harry van Haaren , stable@dpdk.org Date: Wed, 11 Mar 2020 14:39:27 +0000 Message-Id: <20200311143927.76021-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200310133304.39951-1-harry.van.haaren@intel.com> References: <20200310133304.39951-1-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v2] eal/service: fix exit by resetting service lcores X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This commit releases all service cores from their role, returning them to ROLE_RTE on rte_service_finalize(). This may fix an issue relating to the service cores causing a race-condition on eal_cleanup(), where the service core could still be executing while the main thread has already free-d the service memory, leading to a segfault. Fixes: 21698354c832 ("service: introduce service cores concept") Cc: stable@dpdk.org Reported-by: David Marchand Reported-by: Aaron Conole Signed-off-by: David Marchand Signed-off-by: Harry van Haaren Acked-by: Aaron Conole --- v2: - Added rte_eal_mp_wait_lcore() after reset (David) - Added Signed-off and Acked from mailing list (David, Aaron) --- lib/librte_eal/common/rte_service.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index 7e537b8cd..b0b78baab 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -122,6 +122,9 @@ rte_service_finalize(void) if (!rte_service_library_initialized) return; + rte_service_lcore_reset_all(); + rte_eal_mp_wait_lcore(); + rte_free(rte_services); rte_free(lcore_states); -- 2.17.1