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 6AD39A04DD; Sat, 4 Jan 2020 02:35:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B4A41D553; Sat, 4 Jan 2020 02:34:07 +0100 (CET) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id C863E1D53B for ; Sat, 4 Jan 2020 02:34:00 +0100 (CET) Received: by mail-pj1-f66.google.com with SMTP id t101so5355403pjb.4 for ; Fri, 03 Jan 2020 17:34:00 -0800 (PST) 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=1zc6+AhRV1YcnqJbDgE6FqrfBVK0tAQVQ4bkQbZ/oEM=; b=hr4FaV8w/6Qk47oNO1X3zurVzUwZVkc3P+HFYnk9she948GHRiVw4sa0BeyogQ21Dz YQ7J+t9Rq2aAxjlnBLhU88QN5LTEKZR7tCsANUDroIzwhEs7XxaoaDMTVbDkNswjbfyz DzvhEYb8OxARVw//BCRhN8IW1rgmULym0nXOrKdMpGNUv1u13faubOlfE5BXSLB4P4zu J60a9vc1rK6MHUiMXMjH0XPEcA/JlhvjL9C0nwf+741jashqw8wVAt2Kle9q12UElNP9 Hwc4ikDaUrW4QQk/1p35s3Mgg3bdHU7xFAWUTLsY7ANGLUCQvxahvqyguZY3LUYD58aq zb4g== 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=1zc6+AhRV1YcnqJbDgE6FqrfBVK0tAQVQ4bkQbZ/oEM=; b=MF13VdtjFQWQc2Hpz+W30RfgHQpAwYNJD71u8oQf2D95/z0M9rJMgFiu2OQYBhk10E jmHAqpq318ZfMytn5m23SRpsiPRwQymm+dDRB2kEUir0dE0LKThiD+5prHdlqe1qn24g qQVHXXCqlU0ufHOKwsY6cXbaZa/i9YtfspKMRS0hhLbT7kpCilGLPyhLNTn2oo6cEnVR txPR2QU9vC9E/nbsSTEBlyGOFnBzXY2I7B9+G+FuhgiMRxBjBBX4KSbSFHOrG5+ErTEu m5AcGIriV/QiJxDtqapAej8F7c5lWpNuVCosZtHcF9vMLFjmrKzmUDjFBG0SfUnYH40p pokg== X-Gm-Message-State: APjAAAWqDen5D1Cdv51o62bP7QHmqRYopZ4hg8OIDgNRbyGYmxdagp9V nO/Kyh3TIaNC7lvy2TnFasZBbUg088Y= X-Google-Smtp-Source: APXvYqxUAMTLnZ4o6d1Jk10QG2oJ7dhF8t4pj50ymuVtRG1E/ODdBJkANwBVrlvTzl2k75Ep4KFh7g== X-Received: by 2002:a17:902:694c:: with SMTP id k12mr81952362plt.329.1578101639574; Fri, 03 Jan 2020 17:33:59 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id j6sm16212934pjv.10.2020.01.03.17.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 17:33:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , anatoly.burakov@intel.com, stable@dpdk.org Date: Fri, 3 Jan 2020 17:33:35 -0800 Message-Id: <20200104013341.19809-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200104013341.19809-1-stephen@networkplumber.org> References: <20200104013341.19809-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 08/14] 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 --- lib/librte_eal/linux/eal/eal.c | 3 +++ lib/librte_eal/linux/eal/eal_vfio.h | 1 + lib/librte_eal/linux/eal/eal_vfio_mp_sync.c | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index eb95f4f0c317..9ad81378f23c 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -1338,6 +1338,9 @@ rte_eal_cleanup(void) } rte_service_finalize(); +#ifdef VFIO_PRESENT + vfio_mp_sync_cleanup(); +#endif rte_eal_intr_cleanup(); rte_eal_alarm_cleanup(); rte_mp_channel_cleanup(); diff --git a/lib/librte_eal/linux/eal/eal_vfio.h b/lib/librte_eal/linux/eal/eal_vfio.h index cb2d35fb1206..bf7408a897a7 100644 --- a/lib/librte_eal/linux/eal/eal_vfio.h +++ b/lib/librte_eal/linux/eal/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/eal_vfio_mp_sync.c b/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c index 5f2a5fc1d94e..b8ae9c65892e 100644 --- a/lib/librte_eal/linux/eal/eal_vfio_mp_sync.c +++ b/lib/librte_eal/linux/eal/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