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 EC368A0032 for ; Sat, 13 Nov 2021 01:28:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD24C4114A; Sat, 13 Nov 2021 01:28:33 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 1845041140 for ; Sat, 13 Nov 2021 01:28:32 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id iq11so8044475pjb.3 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=FUdxS1AJ7fpicNwIu72Iond/2VGngtKKVeBfj5TBqIWS3NiiCVkX8lY0weEL+EwPsx uapKBHYunQcnpwT00X29JT/ha64NemxJUxxVuXlFcFr1On5bg8svZCD+7TSn+KHOFt+g 2QmyE/3g2lOTafREf6moShvyND4xgafKRFEPjc9VBqCBazPb89B11lscV0MxnK6vb3aX ka4ukX1Rc1aZCKPP50Pi68uAUsZh8DNKSBumzY/l3QqcxTB9m5hC4wqOnXXVPIdDqLSp WGV+Rvi7Ke1zShp9ABt4DuCGK/B94fiM9RH3OyE+cAkizyikqY8P6ajheZEiJsLK3ZXO eIkg== X-Gm-Message-State: AOAM531FS3EtGIWGRpoNINt1731wn86VjZ92AkHCl42dL1hzo3epqgty g9oIrH86F3PeyWgMI+EcHhAugQ== 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: stable@dpdk.org X-Mailman-Version: 2.1.29 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 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