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 E5F32A0C4B; Sat, 13 Nov 2021 04:32:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C0E974114D; Sat, 13 Nov 2021 04:32:20 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 592DC410F5 for ; Sat, 13 Nov 2021 04:32:17 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id x131so10022187pfc.12 for ; Fri, 12 Nov 2021 19:32:17 -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=cCSqSRv5nD6N5uc9Yr8HPh847QOn5cS34EM7an5am8faQsjAm/FjQJiFczbG76EyVE yRNzPXKVQ8F76X4vMA8Z3z7BxIunfXzuPzBhHg9slQzqLZXWRyio2EeWzyObVDAP3607 QoZK5OdnTKq8HCGxGqfHUfl+4RHVnka2/LtaCihjeWiUl8XLRuTrpIEgZ1DzjnwQCgZ6 p3EUX0lHgN8NeZkmAV1HL+2kOXmV4LzlDekWpfeci4VE4phQEfz5ciwzfEqzcnblnvbT hZhp1HmbnvXifCv51dD472Dw9O46dKhdhdrv5rpBBDXE4dUYdGD9WaeIkljnVz99gwiw l49w== X-Gm-Message-State: AOAM531+6mZ9eiSH6Z7ASea0YF3WcpT6urrembwb6tUsRh8g17f1r+QK 3I7//32kD6VWq45bQTuBkHB/wt5A8afICQ== 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: 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 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