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 57126A00BE for ; Wed, 29 Apr 2020 01:14:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA1D21D65C; Wed, 29 Apr 2020 01:14:43 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 1743C1D64F for ; Wed, 29 Apr 2020 01:14:35 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id n16so72702pgb.7 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=HA9lHixPDEPIYLVU6co0UJhm0g34I4hyWUR+JP9Oqu2i7BBN5f0Ua3VPc2rQBRrKu7 h//SfPz/cLDEfECt/OKIQJXdlnygiarGYa2HR5SVTUhuQBzjsR4RLB7Ci366k4rVoqjT PEEm53Wc3OiBmyCs9Mbz2wxyBQIfRx42/bUbpGFMDJN6kEsgRZZ1rN8LWe6YaR/W1VNT FrPx/XowATZ5LhPo9FZL5SNPrZFm90DHGP1s6uVosvVhmkJrmg27iUVPqc8ZW4T6N/1N WeefWQWOXFlCuwqD0aJMRzSaiY1UmlF6VdeG22VBGsTdXhLAO0AtybleZX3d2W8xAvXw 6XLw== X-Gm-Message-State: AGi0PuZHP8XlQUhnj96IBE3TQzntIj6HTsecMzQLhk1lmgYJbZmNXqiv I/fhO8Yqip6AWBFiV85cPIcGZg== 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-stable] [PATCH v2 6/8] eal: vfio: cleanup the mp sync handle X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" 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