From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C735A0032; Sat, 13 Nov 2021 01:28:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 408014115B; Sat, 13 Nov 2021 01:28:35 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 1C22441151 for ; Sat, 13 Nov 2021 01:28:34 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id n23so9309817pgh.8 for ; Fri, 12 Nov 2021 16:28:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iXB1LawRGPVXn8R02W+aV0pR1MKqhc8JED0X0sX0iDM=; b=MAH2+vyuS7N7O0BKypLCDr7iEIetfzjcOdsr1UvxY+hLzN3dgQWode675iBSagchFA QEtbUmt98ChhFDAcS9MABFpOYxRyTG9mfu1OUfKvY1cL+7Omx5OT9VocLSdTqsPC5gQ6 Hj8JU416OPtaUeKf1dpXENINF2jSHVRc4WYI0xfI+WbRQcKyCjECaMOcdfVO0ZbHINZw UyBQ5PpWMdr3jKNJiTyUHAKnA0TXLROVqeG3M9v0Ho1sMxyuQC3TZBkxvVd45MgM3zzc YGM8kZ5t1yw/fW06QtK8gRTi3rQ0BL5h3ZBdQgA4IPS7lkVyyTm+d1NLhAI/CxSzoCDO Eg5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iXB1LawRGPVXn8R02W+aV0pR1MKqhc8JED0X0sX0iDM=; b=MNOPSLFuAajG2bi8WmfzdtBK5pjZl2uzI5+0JUKNDVmEock4Ur83eBt6051DUQtQq7 WE6torVYF6ZRIYiYxEnF6Wkx+x8pcVJaWHT6IliSbmaVZoBU5WHt23tLVU5R/OHfqLsb 0/mTv065dGQhUwk1kfU6gJdSVbCKaAbkIqOBDthvf650JnBlSpRXKU4URRWTGYQqRTJ+ P2ZBC1UlxWnhcwlNsx+BGBW39ovhpUTnFDOx2hIOUS5C66LvcRSqPjdlWvRHPBCtqtu0 G6uCl7fpGD2SCR1Q2JvRBOeVQvVv4HSJPXmcFmlyNFn5jPOi8RcEQmiWRyPHmlctczpJ M/1w== X-Gm-Message-State: AOAM533RqSuMhgLmZ7hn84LckPq3+TW477ViPvctEriD9iiLwyOE8Q2A WmEIGBmBXAOJrK+GP3oOZlsSIFMrAacJ+w== X-Google-Smtp-Source: ABdhPJyrbuit8DQwtUokn4imnbM9APakUj2Vj2av/K1NkTvZ4EXRi7qZZjH3bgT2GaWylBnZo6oHPg== X-Received: by 2002:a63:dc13:: with SMTP id s19mr12459265pgg.233.1636763312892; Fri, 12 Nov 2021 16:28:32 -0800 (PST) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id z10sm7687748pfh.106.2021.11.12.16.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 16:28:32 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v4 4/5] eal: hotplug: cleanup multiprocess resources Date: Fri, 12 Nov 2021 16:28:23 -0800 Message-Id: <20211113002824.338343-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211113002824.338343-1-stephen@networkplumber.org> References: <20200428235827.15383-1-stephen@networkplumber.org> <20211113002824.338343-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When rte_eal_cleanup is called, hotplug should unregister the resources associated with the multi-process server. Signed-off-by: Stephen Hemminger --- lib/eal/common/hotplug_mp.c | 5 +++++ lib/eal/common/hotplug_mp.h | 6 ++++++ lib/eal/linux/eal.c | 1 + 3 files changed, 12 insertions(+) diff --git a/lib/eal/common/hotplug_mp.c b/lib/eal/common/hotplug_mp.c index bf55056f59c0..bde0de196ef5 100644 --- a/lib/eal/common/hotplug_mp.c +++ b/lib/eal/common/hotplug_mp.c @@ -462,3 +462,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/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h index 8fcf9b52e24c..4848446c852d 100644 --- a/lib/eal/common/hotplug_mp.h +++ b/lib/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/eal/linux/eal.c b/lib/eal/linux/eal.c index ad8f130b509d..1a13a3474e38 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1370,6 +1370,7 @@ rte_eal_cleanup(void) rte_mp_channel_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); + eal_mp_dev_hotplug_cleanup(); rte_eal_alarm_cleanup(); rte_trace_save(); eal_trace_fini(); -- 2.30.2