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 242E6A0032; Sat, 13 Nov 2021 01:28:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D0634114F; Sat, 13 Nov 2021 01:28:34 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 813DB41141 for ; Sat, 13 Nov 2021 01:28:32 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id n15-20020a17090a160f00b001a75089daa3so8456994pja.1 for ; Fri, 12 Nov 2021 16:28:32 -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=XxQYew7y43h9/ncKHERdwAeL5L/Eic8IWjbkAZOOaq+vHzjFqHRP4qxv/bbsQsPoeN dpfvYQjDobQ/lQTTcA25YO2kqmJ5H+bpKkCRedYb+CH37R5kjkwBo2bfjs6JFNvY8Bzw z2mDTYSiDs20DHdAZPZuoTqrZ6uL8AQ6Daro758w1SFvcL0J9FLyf6RatEBLcyQ32aSF LXTpXJi6PTLOWapLssf05dVUleoVZAj9rr5TxEDzz4OYnz4N8bxbwiNsrWq1/afP2Ce4 0oBKBrP3KDJ+cHOAieaFS7MmQVVsg0IFq9xQPxzQFi/qGnqeBqB5QNMjmQ4ggT283k1U nhxw== 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=lxekJfsGJ6QdgqAtzDqZB0gBocBG+34qIyV9dvsn2I81VhJhza2zXJahZzzr+cfqqp mbVszui/iwBbZ7ua/EG5UxBGE81pBrIwP4Uid58uF5SZ6yI43G6refWOKKPaZC3sGvsF 3KkpEOcQ8d7E1gazmiseUROlDOEDp+VQrcIbIOW3Tktbv5+0Kozg16ysqps5e2vkv6tU b2JUH6VSBh+v9PffqCknouiyqbqRkV8S9sjHQrHyF5wHPVbTPzGss0qNBNh9Y9ySQSTY +skwIzdVABuy7Xaey3MBVn/JXPrARU6CnGIH4+jJ1Wqz/djf++q8y/GR3lruqvkO+kOn Gc1w== X-Gm-Message-State: AOAM533GgDbm9pXKib7puIUjv7c4VCwWB6eLmMXoPF84apANCwwe0dBw 8BX7yDN0Xnt8YVrHzeyhTmJyYFfXbY1+6A== X-Google-Smtp-Source: ABdhPJwV4VpxjdlQa+12sAm2Ej5mFSLonwyDBeHcnS3Fg5Km4NEwRkCAi1K6OXYgcrVtDnYmcwrzwQ== X-Received: by 2002:a17:90b:1644:: with SMTP id il4mr22484739pjb.39.1636763311366; Fri, 12 Nov 2021 16:28:31 -0800 (PST) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id z10sm7687748pfh.106.2021.11.12.16.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 16:28:30 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , anatoly.burakov@intel.com, stable@dpdk.org Subject: [PATCH v4 3/5] eal: vfio: cleanup the mp sync handle Date: Fri, 12 Nov 2021 16:28:22 -0800 Message-Id: <20211113002824.338343-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211113002824.338343-1-stephen@networkplumber.org> References: <20200428235827.15383-1-stephen@networkplumber.org> <20211113002824.338343-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