From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC1B5A00BE; Wed, 29 Apr 2020 01:15:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED74B1D660; Wed, 29 Apr 2020 01:14:43 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 923AA1D650 for ; Wed, 29 Apr 2020 01:14:35 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id 145so113395pfw.13 for ; Tue, 28 Apr 2020 16:14:35 -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=SRzQAEQ47xfzy39dnBWvcBVnmzaCA5jfKtlPrGxK+7U=; b=Levtrux+nLR43R6v2s9eDu8I8q3AiRQstQg/pMGXGzBWKVEOKW0oYMlaFql9oA0IRw AQCFNfhgMVedoJ7JOqOaJ34982SBD3MlzehWjhm1DdjtOgwLk8A2YW1d3LO+A3VT92Jh hkgwdy6a1e9pOb0BCN+4E76dJCYFXMbdBK5pJJImzDs3RLwFNKHl8NMzzvmsc+HXaGgz drRryFhtICRn5FdRqiIvvFx3RPv6FJkQVogL638Mp1v+VaARiH2upgllvd7evcHFUBcN tGIcS4HQbolKKZb3cspV/3l3HWGICoiYBQfIgxWEAz5gTus3izWQntB4n4DKu+cf0jTa GZaA== 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=SRzQAEQ47xfzy39dnBWvcBVnmzaCA5jfKtlPrGxK+7U=; b=EfoPzUBlOg5UXX3pHfTrgXf+0J6/rUOljcXM8Q9YpXfPDxQE0c9EIO+qCGAQbTHNMp ljzOm554cemHUKDNZjI/Yk+obRTbUtoxN+C7/Xj+7hfSgrGfKGo6Q/D8zjcqaD4TZSrS bIkxgjg7mgpYJ/dqi+HaoEdtrCnwur8BGCTbWYbe9cYjcPOgtHcv8GZuepVkL6CM60gY Ms07jjeByMIJNaVUoraGaJ7w6Hb5SZonQniLZnKMFxLGBTQBvoofBYO3sYM4YwQL57W0 qBkoxNrBs+JEP29UebR5Q6H2V3vHk3uSRUVPdBfLLB3koMQ4I3Kemb48epyfuHsE8ZFB ZIfw== X-Gm-Message-State: AGi0PuYh+LQ9Kr+aXCMvAo/nD8O7tMs9SUklq5IZOcU42DPSAQ90dXKz 9Wamj+Z204++uGpCniGiKVauFyImmeHcEQ== X-Google-Smtp-Source: APiQypJ6wzuKcez/Gl8gXNXU2Ozf0Dp1Vc1bbgNCI4v2ivPUbP1GUlfF/4i2mi5LwjX0ulIoCcEyFA== X-Received: by 2002:a63:63c1:: with SMTP id x184mr15678844pgb.116.1588115674254; Tue, 28 Apr 2020 16:14:34 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l64sm3230454pjb.44.2020.04.28.16.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 16:14:33 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , anatoly.burakov@intel.com, stable@dpdk.org Date: Tue, 28 Apr 2020 16:14:13 -0700 Message-Id: <20200428231415.17985-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428231415.17985-1-stephen@networkplumber.org> References: <20200104013341.19809-1-stephen@networkplumber.org> <20200428231415.17985-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 6/8] eal: vfio: cleanup the mp sync handle 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 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/librte_eal/linux/eal.c | 3 +++ lib/librte_eal/linux/eal_vfio.h | 1 + lib/librte_eal/linux/eal_vfio_mp_sync.c | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index 27b768b15c4a..7c56dbf49508 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -1346,6 +1346,9 @@ rte_eal_cleanup(void) } rte_service_finalize(); +#ifdef VFIO_PRESENT + vfio_mp_sync_cleanup(); +#endif rte_eal_alarm_cleanup(); rte_mp_channel_cleanup(); rte_trace_save(); diff --git a/lib/librte_eal/linux/eal_vfio.h b/lib/librte_eal/linux/eal_vfio.h index cb2d35fb1206..bf7408a897a7 100644 --- a/lib/librte_eal/linux/eal_vfio.h +++ b/lib/librte_eal/linux/eal_vfio.h @@ -132,6 +132,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/librte_eal/linux/eal_vfio_mp_sync.c b/lib/librte_eal/linux/eal_vfio_mp_sync.c index 5f2a5fc1d94e..b8ae9c65892e 100644 --- a/lib/librte_eal/linux/eal_vfio_mp_sync.c +++ b/lib/librte_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.20.1