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 6917EA00BE; Wed, 29 Apr 2020 01:15:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A68CD1D650; Wed, 29 Apr 2020 01:14:36 +0200 (CEST) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id E6E831D642 for ; Wed, 29 Apr 2020 01:14:31 +0200 (CEST) Received: by mail-pj1-f68.google.com with SMTP id h12so1613059pjz.1 for ; Tue, 28 Apr 2020 16:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p+GwdMm2UwxS1a1z5F+0+KYPi/v4lFrzxgvROMBkFKE=; b=zhMrU/E/gsuP1m0dSlzv41LMMR8gLtrI9oH6ij6x/wBvQm4fNrgQwUvcxchqtbMXXA +T8pvDxmMuQ3nfLA6TfhIk/qoxCVMtfbbY0kM5u6POlVxI69G31WHEtC9Te9679qt3Fn IRTSl/fi/Em2WCxMfHZexWfpT4Pw//w34npe3gxy0Z9a9tPVjxgcFsnUXFpKwepBe+Ht 1Oo1ubwoUdBlUa4IP2QqdCwicHD5Eqk1u8XtTNa1oZjoMTq+XipMOwYaZAs+wkuspdfk dS4CvcWvX3KkZ/dbjmk+cw2S2aJ0NlCqZ/1Dfos43U0QHg3qTCKZkY4HeuyuKZgIaucI j34Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p+GwdMm2UwxS1a1z5F+0+KYPi/v4lFrzxgvROMBkFKE=; b=WbWH2gCN6Bk8zOIR+LYAmBdYwJvYTg3IEhPJX4hdUQEbrCMbx3FOvxdZyNoPd0cjKu LFWB9w3bx1WgHg8+FkmLaMcLgCv5qYu0Sz0dmC9hj1y1ORFStCTNs3GZFDSjfs7HUUmd uuSVj4ovjVbYBjb1JVdL9F7AbohzZVA3nPjBmTliG7EfgYzuUfOnVLZm9FLx1lLlCESq C0c4X2ljU7tIc9N46umA8Qz7X2FjQvUa9puE2JkO8cITpNsuI8CmeYZFmwSsSrfRUWgh iIFS8nhwWE/G/bxNCShVwRY3Mr04DEr4k1qBMCO76PmPTlItRznNMIdN3/UheI3ILPj3 9shw== X-Gm-Message-State: AGi0PuZlnYc6LPUS8e7H3LYc9Sga9tMFyXaIOx7hJcsgcleYHdKWtzQq zS+0TNZCRoOMf9z4zBITupOKjSlkAtkn5A== X-Google-Smtp-Source: APiQypI1F9FObHZ39AoJmDPtBsDnKvCd61kZ3iUTy1gWA5H/t7E5rsYZMKzyrUZ4Zn0lyLQdgcGfJA== X-Received: by 2002:a17:902:8a88:: with SMTP id p8mr30906179plo.134.1588115670702; Tue, 28 Apr 2020 16:14:30 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l64sm3230454pjb.44.2020.04.28.16.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 16:14:29 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aaron Conole Date: Tue, 28 Apr 2020 16:14:11 -0700 Message-Id: <20200428231415.17985-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428231415.17985-1-stephen@networkplumber.org> References: <20200104013341.19809-1-stephen@networkplumber.org> <20200428231415.17985-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 4/8] eal: cleanup threads 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" When rte_eal_cleanup is called it should stop all the child threads and close the pipes between threads. Signed-off-by: Stephen Hemminger Acked-by: Aaron Conole --- lib/librte_eal/linux/eal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index 7458592f4950..27b768b15c4a 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -1327,11 +1327,24 @@ mark_freeable(const struct rte_memseg_list *msl, const struct rte_memseg *ms, int rte_eal_cleanup(void) { + int i; + /* if we're in a primary process, we need to mark hugepages as freeable * so that finalization can release them back to the system. */ if (rte_eal_process_type() == RTE_PROC_PRIMARY) rte_memseg_walk(mark_freeable, NULL); + + RTE_LCORE_FOREACH_SLAVE(i) { + pthread_cancel(lcore_config[i].thread_id); + pthread_join(lcore_config[i].thread_id, NULL); + + close(lcore_config[i].pipe_master2slave[0]); + close(lcore_config[i].pipe_master2slave[1]); + close(lcore_config[i].pipe_slave2master[0]); + close(lcore_config[i].pipe_slave2master[1]); + } + rte_service_finalize(); rte_eal_alarm_cleanup(); rte_mp_channel_cleanup(); -- 2.20.1