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 95325A00BE; Wed, 29 Apr 2020 01:15:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B6971D667; Wed, 29 Apr 2020 01:14:45 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 0AB201D654 for ; Wed, 29 Apr 2020 01:14:37 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id f15so96436plr.3 for ; Tue, 28 Apr 2020 16:14:36 -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=S6QD3eLls3M9plGsg+sTUWhIt7li+lqKHf5cEZzmIoA=; b=psfu12XDqEnQEEDf+WhEbmFyQeqdhuyTaU1B48BhnNIrjZTyHTOuba2zUFRlwtkugx iew8BqpiCfmgeAoFApfGEPKkfo/o+9O8Ykhds0cMXU+CnfmZGX36np3WwQgTaAJLEQSO 3KlgW/OfhZEWVmsLun9OFIGJXA3s18J/4g9cAaKthpeA/TC0K8b6aFxKYdkR11+xQZsr WKk8nJuqUdIAwUd7+B1dDpIoxq46QADrxp1ji4c67CPgl53dpCTiEK2tAFCt46ocjZve iMP1t2BsLbLMik5rZix2MtjM2Q++DDKiou8/d7lW1dwDNbJVG9mEuLNzk9BGbm8QSAw5 YrKg== 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=S6QD3eLls3M9plGsg+sTUWhIt7li+lqKHf5cEZzmIoA=; b=YqmMxbaLaArW77Cpwo7894sBm5DSuYldGsHiFOSHXp0PmHyeS7hSClYZLaMZK8FZy2 XPz8cNJkpQ+ts1aT3nS40UheXupelHOP6B3FcL/NkPY6U9jCISHehpvBB55EgZ5ec+Jx btTPwHgGhDeN3rQ925AI84oX0Dm/lowsWVFfyGyA3y0CYuokMT5fo01LYm1Nmgy6etHZ zh/BzGtbVJUSN7gRj6rb4lkJUEcuG488eTb0v9+TJvrdSznwOLNrNXV4X6ywj4DnUw7X 8hneaIet93EirPnaO4BN8Len4VJhgNbC2vHtJL+8G1oI/yf7mQmjDZGp6M+7xMIDijVL MRTQ== X-Gm-Message-State: AGi0PuaalK8iB4yHx0zW/REoF+wjdGpHhb73BPF8BQ+cf7zVYsijj0Ze EN0bk1VZA3+5SLPHlbVhX7VUgFXic/bpXg== X-Google-Smtp-Source: APiQypJWiXebTS565TYYlSy3NeBDx6q1M164DxITElfw0PwAZY9TMNz0Kh2WGnApCIVzDnjbZsZY+A== X-Received: by 2002:a17:902:5983:: with SMTP id p3mr32197894pli.122.1588115675680; Tue, 28 Apr 2020 16:14:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 16:14:34 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 28 Apr 2020 16:14:14 -0700 Message-Id: <20200428231415.17985-8-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 7/8] eal: hotplug: cleanup multiprocess resources 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, hotplug should unregister the resources associated with the multi-process server. Signed-off-by: Stephen Hemminger --- lib/librte_eal/common/hotplug_mp.c | 5 +++++ lib/librte_eal/common/hotplug_mp.h | 6 ++++++ lib/librte_eal/linux/eal.c | 1 + 3 files changed, 12 insertions(+) diff --git a/lib/librte_eal/common/hotplug_mp.c b/lib/librte_eal/common/hotplug_mp.c index ee791903b3b7..a390c01fd41c 100644 --- a/lib/librte_eal/common/hotplug_mp.c +++ b/lib/librte_eal/common/hotplug_mp.c @@ -463,3 +463,8 @@ int eal_mp_dev_hotplug_init(void) return 0; } + +void eal_mp_dev_hotplug_cleanup(void) +{ + rte_mp_action_unregister(EAL_DEV_MP_ACTION_REQUEST); +} diff --git a/lib/librte_eal/common/hotplug_mp.h b/lib/librte_eal/common/hotplug_mp.h index 8fcf9b52e24c..4848446c852d 100644 --- a/lib/librte_eal/common/hotplug_mp.h +++ b/lib/librte_eal/common/hotplug_mp.h @@ -37,6 +37,12 @@ struct eal_dev_mp_req { int eal_mp_dev_hotplug_init(void); +/** + * Unregister all mp action callbacks for hotplug. + */ +void +eal_mp_dev_hotplug_cleanup(void); + /** * This is a synchronous wrapper for secondary process send * request to primary process, this is invoked when an attach diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index 7c56dbf49508..ffb0678b864a 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -1350,6 +1350,7 @@ rte_eal_cleanup(void) vfio_mp_sync_cleanup(); #endif rte_eal_alarm_cleanup(); + eal_mp_dev_hotplug_cleanup(); rte_mp_channel_cleanup(); rte_trace_save(); eal_trace_fini(); -- 2.20.1