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 2B564A0C4B for ; Sat, 13 Nov 2021 04:32:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D44041148; Sat, 13 Nov 2021 04:32:20 +0100 (CET) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id 0C8B7410F5 for ; Sat, 13 Nov 2021 04:32:17 +0100 (CET) Received: by mail-pg1-f172.google.com with SMTP id q126so9582947pgq.13 for ; Fri, 12 Nov 2021 19:32:16 -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=LFmIZE7PTeeOd/K5OXdlFGqPuZyewlALvDbiE5eDT7Y=; b=rIwQ6r6GmMLl5ZDBFi46nIxDsRJRN6w/Z0/ikW7wJPujZ9/FhwaPd+cgXC38XU07Ie 9jrezuC8uHMbx2zwE3JhgMGZlFTqSHzYaXOoDvue4DehWiG+/olOJ9DDexhq1sEj9Gcl WH0xG2U+b3ANwn/suuAy0WtLYcGaYdIp11TPfE5z07M9S5p+26hyPbPVk/P4HgtwsSd7 vvXnAP1AvcVStyFmGuCzbCrG5givgGM9TcRPS8cbUvVapEUqKX8leLdpKd11dQaQZtnl oT/z3udxqifEgJWX20Gr1UfpO5Y12VUM3pjIhTt4OeQTBGVGeeCzi02/DEIK/sGmo2gW Qb6Q== 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=LFmIZE7PTeeOd/K5OXdlFGqPuZyewlALvDbiE5eDT7Y=; b=KGwdcXgCdLvJVpvll4A3776axiy6X7Y7swIxxOpKHn5zuB2X3YHAthl3fZL7VadSam MQpjTEj6CIq2afQ7L73gcK22QAcrzXTlWfziU5cB0cdi3ZUrBF8qoC/Yw5zdmp1B+pfu 5YfXey1qRl3BZ4OdnCtAjHI7Rh2syWVmj1K7cSU31AS1IrN4+OHKO8gZ4yu0Rzwfo9YF 1tsY9JiXrFSKtL9qnpChQJ2c3T9fHAPxkfv6t9jzt9Gn8SZ14AzJq7VkATVnU/rz3zDR TYEug+CF8e6SA/5LQZWmNw2MhHxiC1kZzEAYtVDHykyJftxNjCq6cDtxAkZER+TmCLlv VuaA== X-Gm-Message-State: AOAM5323iFGUJ/jhTHyq1XLsde2YXQP9ye+XykmWlDkg1pb6bbToZQ1w Ir8OKFVu/i7GDamQBnq3dt8m8g== X-Google-Smtp-Source: ABdhPJyl1GFRnYbG+Sl0gLuM1dIiDMidLk9bh7x/hkWZm3H1Psqe6xkFM4eJUqYOrVD7rHiu38i6fg== X-Received: by 2002:a63:e755:: with SMTP id j21mr13210545pgk.235.1636774336259; Fri, 12 Nov 2021 19:32:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 19:32:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , anatoly.burakov@intel.com, stable@dpdk.org Subject: [PATCH v5 3/5] eal: vfio: cleanup the mp sync handle Date: Fri, 12 Nov 2021 19:32:07 -0800 Message-Id: <20211113033209.341027-4-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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org When rte_eal_cleanup is called the rte_mp_action for VFIO should be freed. Fixes: edf73dd33072 ("ipc: handle unsupported IPC in action register") Cc: anatoly.burakov@intel.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Anatoly Burakov --- lib/eal/linux/eal.c | 4 ++++ lib/eal/linux/eal_vfio.h | 1 + lib/eal/linux/eal_vfio_mp_sync.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index b67030b2792e..ad8f130b509d 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1362,7 +1362,11 @@ rte_eal_cleanup(void) if (rte_eal_process_type() == RTE_PROC_PRIMARY) rte_memseg_walk(mark_freeable, NULL); + rte_service_finalize(); +#ifdef VFIO_PRESENT + vfio_mp_sync_cleanup(); +#endif rte_mp_channel_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); diff --git a/lib/eal/linux/eal_vfio.h b/lib/eal/linux/eal_vfio.h index 6ebaca6a0cbf..921ee595388c 100644 --- a/lib/eal/linux/eal_vfio.h +++ b/lib/eal/linux/eal_vfio.h @@ -133,6 +133,7 @@ int vfio_has_supported_extensions(int vfio_container_fd); int vfio_mp_sync_setup(void); +void vfio_mp_sync_cleanup(void); #define EAL_VFIO_MP "eal_vfio_mp_sync" diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c index a2accfab3a38..d12bbaee648b 100644 --- a/lib/eal/linux/eal_vfio_mp_sync.c +++ b/lib/eal/linux/eal_vfio_mp_sync.c @@ -120,4 +120,12 @@ vfio_mp_sync_setup(void) return 0; } +void +vfio_mp_sync_cleanup(void) +{ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + + rte_mp_action_unregister(EAL_VFIO_MP); +} #endif -- 2.30.2