From patchwork Tue Apr 28 23:58:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69494 X-Patchwork-Delegate: thomas@monjalon.net 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 E1BAEA00BE; Wed, 29 Apr 2020 01:59:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8446F1D6A5; Wed, 29 Apr 2020 01:58:53 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 08D8E1D684 for ; Wed, 29 Apr 2020 01:58:48 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id 18so176504pfv.8 for ; Tue, 28 Apr 2020 16:58:47 -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=I4ikXa7Us5GfQ7k/WggUZ3CNBizI2uxmp7Kz6s1VkxXyTHUnIRswXSIuKPvfb4PTUy pNVyiTQq6Xg3Sjf7Qx3YQKBSBcxpl6knsMwkasa/fpYte519hfdqUn6t6ywHAGVwPvVo hvwzo6MhOLjt6IGTrxqtQNjJ0hqwd/7cvND7BItKqq/RUL1kfNCDuAVqbNgs/XVId3zA udHViEBxhs9Cm0gw7bEXschad/2k7ZNMe57oWP8XkqjEWqykseHBg3Y40yRB7mc1NUEj gbZ2pllxVEhER3hBLA1u9htYbya9rRYDdzr0q9w+LWIGxLa5DUmlNkWZ/FcdTEtj1gnX /QUg== 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=Lp81lDWbfiOr3gltQ71Ka995B1VxPD8Bi2U6xug/qCGFmssDyeloNJXbO/Rg3kwAt8 XRW4eIVEgTubm98WMSD2LqOa2qf6jo5ifyyFmnYieioBHG6nTNkcaB9wb2odKjF5ZYYM r4+kBykiBNu6tT2wSPyBVD/B7WyVAJDH290/Y7am9tsN0c/GjRo9e5ReqCx2Kzznjd/g EVPYwZ9QYxJrbg5uNWq2RykBdF2APUD4AhRJiJl1joUSZtwhvOUWurJaoek5OVy89cYp 45WjoARGN0Lbcogsk1mhCIcsQguGChQ1DSqfECAjhoBTgVmklzp9PNbrCAGy7Gu+9Z14 t9eg== X-Gm-Message-State: AGi0PuZlj38sNSRZurVqOe48vqkQSlNAELOlFdzPym48fRKuF3MIGYjV /F7fIHdGIpoH0GMWaT+7tCFbTRe4j54Dpw== X-Google-Smtp-Source: APiQypJVLyNodfEu/iWCA4P/zrA7KwUIem2Iq4P8Wb7gMZ8X2FvJ3N2pYZcXBx6xlf85JhzjvnYv/g== X-Received: by 2002:a63:4446:: with SMTP id t6mr8032507pgk.450.1588118326717; Tue, 28 Apr 2020 16:58:46 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h193sm16209471pfe.30.2020.04.28.16.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 16:58:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 28 Apr 2020 16:58:26 -0700 Message-Id: <20200428235827.15383-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428235827.15383-1-stephen@networkplumber.org> References: <20200104013341.19809-1-stephen@networkplumber.org> <20200428235827.15383-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 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();