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 55EB7A0C4B; Sat, 13 Nov 2021 04:32:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3292841159; Sat, 13 Nov 2021 04:32:22 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id B3DE34113F for ; Sat, 13 Nov 2021 04:32:18 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id y7so10056046plp.0 for ; Fri, 12 Nov 2021 19:32:18 -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=SpuQGLd6dJkCYM+Hx/SPa6lEr9ygcL2nyzjXMzKfkzFhUMqdmJdcQ2300/LON0mQgy pV5Tq9suTw1ADyFYb9QT6ojnJAVypBX9GatUxHFv1DAa65V40a0TDNr8+WoeIBjZrD3D wijdyFK/dLx1d140N5ljWH+AaDQG6Pq+8pBzXjoTx8trlg/zshEsi8xDDslcNl3rztq5 J9h8fI3SNPuBqlLSPhAuN807abSJfkzXaX4t36JL9Zk1Ayn/EwO8QPccjrL98LiXI0Zr vlogMKuLSrYReVd/HS3LtRpxdM9EsYrTkpizeBeQPDG6FJtrLR90zXsbzqfhy9rPKr4C 7a6g== 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=Uxo3F17Bav3am+DVy5q749zNGRIF08sOuYfDcSVyhLBXrnggHxgukFXCWy9/vbWd2M kKfqrctlPrgsKwkjrDs2mzK8fPmwDIp9Kr8soFFEtoQAA9JzhG5tQ3PrBCclRaAQCriw f9EzR3LJrDY2bqwCClPxWE2OmgOZLnJNObkJODPRiF1YVpyhOseHgCz+k25OibIrTtli RNht4I42EIsp2bdCDF6MV4t7PdqYdc3BI3k3FwUxoQKfiydAzXUum5dZLHu+qIfWzmMI K1xZtn9/6hgtZT3hhfsvp4FnIXjfxk3um+k42vPDd64P9V7HuFlBf1a1kVQPssZ2wPeF LzDA== X-Gm-Message-State: AOAM533LMgSbRCmyhHeJ15xWjyZQZQZMFWFwzUhGSBOkmXKFscHPwnt/ AYMhBeQFLrMmgscLGqd1XlYMAWDohF5uaw== X-Google-Smtp-Source: ABdhPJyCeGAH8bF3rtYyrCNawaboL2xYIaaMNSDdaF1tgTEBBTSyfJzy2f1sYRgFcnnW9pPZHdux0g== X-Received: by 2002:a17:90a:e60a:: with SMTP id j10mr43169493pjy.169.1636774337576; Fri, 12 Nov 2021 19:32:17 -0800 (PST) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id b9sm5999596pgf.15.2021.11.12.19.32.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 19:32:16 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v5 4/5] eal: hotplug: cleanup multiprocess resources Date: Fri, 12 Nov 2021 19:32:08 -0800 Message-Id: <20211113033209.341027-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211113033209.341027-1-stephen@networkplumber.org> References: <20200428235827.15383-1-stephen@networkplumber.org> <20211113033209.341027-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