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 A4643A04DD; Sat, 4 Jan 2020 02:34:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A96E91D538; Sat, 4 Jan 2020 02:33:59 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 4DE251D51D for ; Sat, 4 Jan 2020 02:33:55 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id b137so24142447pga.6 for ; Fri, 03 Jan 2020 17:33:55 -0800 (PST) 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=Oyl74YOTBn8D11KizXfAhLy6Ct8Bthw2Jprwg24xr5I=; b=TOQ99Qq7IEae0o6a4LQtZe5/wekTNGm+PUFupWvSm8ii9LxBswPjgkYTZosEQRy7Yt fqw6KQwM29sp1LRZytcWooy8fx9Xyf3zPfg2GD4pEzzabCqb7YOivd1OKePVrBb26Nyb U9LbTsEjbZuG8Z7G54TL+6hxByFr85hfqAU5hOYueQMZxlNwKymgQqith9Z1NuPdndRw JCLX+0yr7Z6cjw6awSCxtn7+jv++F14ikR69XEi065+02h3d+ufDeQZ3+0B6pMbGx9He bnmbIbR9H0ilazcMlEwWkBDofhgzUHb5ed7sJg1VGkEP3ab6JQ1cpMM+HmKI/BHDe8rL J9ag== 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=Oyl74YOTBn8D11KizXfAhLy6Ct8Bthw2Jprwg24xr5I=; b=DHuLQdEfDjPIYO7iAcpe6O+D+luqYvO7AqHIjOtpdxNVE3fXs6KlSccpXC/DtH7aC7 KDVTjaIBcqpmz1Zs7xMmseWAvXF6Tfb+CNYw3S2rmgcL+MlM3x3i7DAsKPuFBsUrWdOj WCqFfcGp+ddCoX9VycwxidzrVRODBsYMGSTyk2386c5KWNnFD0abMgm0ZOkKZVroIR9x Nl6tTuFVNtOXOHu61mEATRzIAxByje8G0uO0EO5QcKGP2Kv8TEood7OJ/v+oSXZIDPVU jZ2AePeM8XFbIfkbOLCW+45yDzPvCt6krt6vnjOWI0ucqCOz1JEgF2Aw//o73FVJtQxW thAg== X-Gm-Message-State: APjAAAU0PekuYQNGGB4fg5rInhcKjB3zZ0EYyV2z36fhA3DxRSM/WsnT PVm4oND77d/DokITSK3pgK3VU0bvn1Q= X-Google-Smtp-Source: APXvYqwqgJ28J3YpoYbgMbOk7LU7pVBW8CCRVjMTKDB1w0oWw03ieDiLEX03X+ZLSHskpDfDOom1zA== X-Received: by 2002:a63:444c:: with SMTP id t12mr96474455pgk.433.1578101634089; Fri, 03 Jan 2020 17:33:54 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j6sm16212934pjv.10.2020.01.03.17.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 17:33:53 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 3 Jan 2020 17:33:31 -0800 Message-Id: <20200104013341.19809-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200104013341.19809-1-stephen@networkplumber.org> References: <20200104013341.19809-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 04/14] 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 --- lib/librte_eal/linux/eal/eal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index a1b928820b11..d98a2afe85da 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -1319,11 +1319,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