From patchwork Tue Mar 10 13:33:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 66508 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8A935A0566; Tue, 10 Mar 2020 14:32:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D70FD2BE6; Tue, 10 Mar 2020 14:32:38 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C00DF23D for ; Tue, 10 Mar 2020 14:32:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 06:32:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,537,1574150400"; d="scan'208";a="265618409" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by fmsmga004.fm.intel.com with ESMTP; 10 Mar 2020 06:32:34 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: david.marchand@redhat.com, aconole@redhat.com, Harry van Haaren Date: Tue, 10 Mar 2020 13:33:04 +0000 Message-Id: <20200310133304.39951-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] 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 thier 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") Reported-by: David Marchand Reported-by: Aaron Conole Signed-off-by: Harry van Haaren Acked-by: Aaron Conole --- Please note that this patch is being sent to community for testing as I cannot reliably reproduce the reported issue on my local setup (despite code-changes in attempts to make the problem more visible, and instructions from David on how he can reproduce it). Email discusson on this topic here: https://mails.dpdk.org/archives/dev/2020-March/159584.html --- lib/librte_eal/common/rte_service.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index 7e537b8cd..d400ccf79 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -122,6 +122,8 @@ rte_service_finalize(void) if (!rte_service_library_initialized) return; + rte_service_lcore_reset_all(); + rte_free(rte_services); rte_free(lcore_states);