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 D12F1A0032; Sat, 13 Nov 2021 18:23:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EFF341149; Sat, 13 Nov 2021 18:23:08 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id 89AC841141 for ; Sat, 13 Nov 2021 18:23:04 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id v19so255588plo.7 for ; Sat, 13 Nov 2021 09:23:04 -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=MunNPYgYG6ePQsKAum/z3P0u2bYPEe7/LJHoKbeaVRfqZoYLU63AzHQEoLkX5nJ0eT kfOhuNVSO6bW328bPJE+Y5WBwMDnCrwGBNx1R7gt9ItVQdWKw9XuwT7tgAstHjOxitbc 5Owhus1k+1kR3Gl/5olIXC/GrN6keTzucW8Tz0kz5gsnel2RUfi/V5U6fC9ldy+vy1+F LqIr7IoVd9eTIcvn7lHXhjC/ThqTgks1j42TmtDB8WhLSMcZE5ProRTg4qvdHzzNwqT2 /b3hdi2uX9JoOld67KRQL1+AY5ite4mRzXvFLn3Fn4RUdL4rmII1iyyYedNmN7Xrkgg+ Pa4w== 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=Ax8+P6CIRS5Yp2IYgGIJ2j79+KEoljhkbn5TG0EhQcNZ5TT+VzSY87cXtnLVDVw9cV ZhpLniIBqIPKmjnbgpAy/xkAiSfrGZLjXu/IxKWEJAULI7MBGb0p14WZQMhJBJQDiKS8 9fbw4rxFMzJ1xicrA95i6JfBWkYcphtkTObn6UnPS0RpQnhaHNqD1Ygb4o2BCLRGiRxd IizkLd1Mbh/sGbBzWEKol2fqCBCEedB41AZJzQ+x3m3b3SvBevJzLJYkX9XOlyUbAItr NG/KICx5fuT/UZaoXdl3/IxPpcA5a3miruNS8PM0IYfApKvxmlOCxuGsooYUxxoSwMVq wL4w== X-Gm-Message-State: AOAM531krzLu3xDYmML/Txot+s3tj14GeZzCturcTnNPG7t38FHoloz3 wVPv5QrKuSM1ETPMnick/6qYkv/keJxqjw== X-Google-Smtp-Source: ABdhPJzzsN1yDG1oz1uJajyEGP6+NHJW2TNOJiEBYIaKNODZnOM2fHUR3lrTrmdqm7599JAUH1p6lg== X-Received: by 2002:a17:90a:c394:: with SMTP id h20mr29631050pjt.136.1636824183373; Sat, 13 Nov 2021 09:23:03 -0800 (PST) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id u19sm9658370pfl.185.2021.11.13.09.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Nov 2021 09:23:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , anatoly.burakov@intel.com, stable@dpdk.org Subject: [PATCH v6 3/5] eal: vfio: cleanup the mp sync handle Date: Sat, 13 Nov 2021 09:22:55 -0800 Message-Id: <20211113172257.6543-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211113172257.6543-1-stephen@networkplumber.org> References: <20200428235827.15383-1-stephen@networkplumber.org> <20211113172257.6543-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