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 4CB5BA0A0C for ; Tue, 3 Aug 2021 14:23:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47525411D5; Tue, 3 Aug 2021 14:23:09 +0200 (CEST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id 45E72411D6 for ; Tue, 3 Aug 2021 14:23:08 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id h14so25079089wrx.10 for ; Tue, 03 Aug 2021 05:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nTIkGQVwIn8EYDe+VwNJY3hgeNtix8aWuduwl+O0dpo=; b=eHxGULt5oclEDF/DoJhnP4caQbdgYMJtPZlgInbbHvbbUPd0wv09WP3WyYtXXqTrmG so5V44lLiAhd2i5rzoR3c7IWOAsDehyBcqxGdMUv3I8nAC0uJvkEzieIUBfjxkmrVfvG p4p2SWtEPW2YffF5ip+QM47WaHdMOST386pjQF9Bi4EmN9AcnRhrBis2r3+sflhdRKZq JQgZFoTQ+f3xdV0sohrWShWQyZPqgCmhNxgY0MTRbtv9jErSJBv6YQg3I3A+sT/0u1/z JMq8dYpw4b1JlQSB+ysSkn3d8dmn9TaY9uGHSt7GFtZ0IqP/9UwWJjX3N44074r0xmcG ev/Q== 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=nTIkGQVwIn8EYDe+VwNJY3hgeNtix8aWuduwl+O0dpo=; b=NMAd7M3uGatlEDlt8/N7nBdQ+Dpuw5hUqFTYnLUdfZX37Y7rY9ya4I+nePiJqYh49o TJ3ceRzipvpg13UQFXte4SZMdWidsUZdJIOxGH4Ez26Bry8WOdKl3wLtTCe1x0nTw0Dp t0Eo5L+t9EOhApjcMOClcOrecGPx6OOTCGuVOez+XLn2RExZLDKBFYs95P5CG+n7nX2/ S/8wIlN36bmgGh4W6R7WQl68J8/tGyxjwcVfBAk6iC/6j4pi7euF5C+d7alIgcvTFDrD /QTXZE6eeDRX1n7Yr5mJDDeKm+kmNxQw2uXth4YehA9DVicIZAkata6aGzRMgSahX90/ yvBQ== X-Gm-Message-State: AOAM531gLfpu+4T6e+hIt2B3AxYkJm41+dfXnefUzaZozXhgzqCT/xQE T1KTDjM069whL77PVQyfyKo= X-Google-Smtp-Source: ABdhPJzl52wlCAcHmVSwdy8v1dkK3ivh4vCuv/GWM5sPjInuol+s0WrV0KMSn5geBt/CLxVyGUd6bw== X-Received: by 2002:adf:f112:: with SMTP id r18mr22320086wro.160.1627993388013; Tue, 03 Aug 2021 05:23:08 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id r133sm2960460wma.18.2021.08.03.05.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 05:23:07 -0700 (PDT) From: luca.boccassi@gmail.com To: Dmitry Kozlyuk Cc: Ranjit Menon , dpdk stable Date: Tue, 3 Aug 2021 13:22:08 +0100 Message-Id: <20210803122214.1094992-19-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210803122214.1094992-1-luca.boccassi@gmail.com> References: <20210726135322.149850-59-luca.boccassi@gmail.com> <20210803122214.1094992-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal/windows: cleanup virt2phys handle' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/05/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/946df437470f356759465a2c27ed817f8f21f867 Thanks. Luca Boccassi --- >From 946df437470f356759465a2c27ed817f8f21f867 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlyuk Date: Tue, 27 Jul 2021 00:36:32 +0300 Subject: [PATCH] eal/windows: cleanup virt2phys handle [ upstream commit 23ce9e0a193636e2f5ec9b386ddd5307c17e9723 ] eal_mem_virt2phys_init() opens a handle for use by rte_mem_virt2phy(). Close this handle on EAL cleanup. Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management") Signed-off-by: Dmitry Kozlyuk Acked-by: Ranjit Menon --- lib/librte_eal/windows/eal.c | 1 + lib/librte_eal/windows/eal_memory.c | 7 +++++++ lib/librte_eal/windows/eal_windows.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 78ac4adaeb..5b6d13481a 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -256,6 +256,7 @@ rte_eal_cleanup(void) struct internal_config *internal_conf = eal_get_internal_configuration(); + eal_mem_virt2iova_cleanup(); eal_cleanup_config(internal_conf); return 0; } diff --git a/lib/librte_eal/windows/eal_memory.c b/lib/librte_eal/windows/eal_memory.c index 4db048ccb5..71741fc07e 100644 --- a/lib/librte_eal/windows/eal_memory.c +++ b/lib/librte_eal/windows/eal_memory.c @@ -198,6 +198,13 @@ exit: return ret; } +void +eal_mem_virt2iova_cleanup(void) +{ + if (virt2phys_device != INVALID_HANDLE_VALUE) + CloseHandle(virt2phys_device); +} + phys_addr_t rte_mem_virt2phy(const void *virt) { diff --git a/lib/librte_eal/windows/eal_windows.h b/lib/librte_eal/windows/eal_windows.h index 478accc1b9..e1d28e7fac 100644 --- a/lib/librte_eal/windows/eal_windows.h +++ b/lib/librte_eal/windows/eal_windows.h @@ -74,6 +74,11 @@ int eal_intr_thread_schedule(void (*func)(void *arg), void *arg); */ int eal_mem_virt2iova_init(void); +/** + * Cleanup resources used for virtual to physical address translation. + */ +void eal_mem_virt2iova_cleanup(void); + /** * Locate Win32 memory management routines in system libraries. * -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-03 12:35:08.973702013 +0100 +++ 0019-eal-windows-cleanup-virt2phys-handle.patch 2021-08-03 12:35:08.242819288 +0100 @@ -1 +1 @@ -From 23ce9e0a193636e2f5ec9b386ddd5307c17e9723 Mon Sep 17 00:00:00 2001 +From 946df437470f356759465a2c27ed817f8f21f867 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 23ce9e0a193636e2f5ec9b386ddd5307c17e9723 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15,3 +16,3 @@ - lib/eal/windows/eal.c | 1 + - lib/eal/windows/eal_memory.c | 7 +++++++ - lib/eal/windows/eal_windows.h | 5 +++++ + lib/librte_eal/windows/eal.c | 1 + + lib/librte_eal/windows/eal_memory.c | 7 +++++++ + lib/librte_eal/windows/eal_windows.h | 5 +++++ @@ -20,5 +21,6 @@ -diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c -index 5413d4d87f..3d8c520412 100644 ---- a/lib/eal/windows/eal.c -+++ b/lib/eal/windows/eal.c -@@ -261,6 +261,7 @@ rte_eal_cleanup(void) +diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c +index 78ac4adaeb..5b6d13481a 100644 +--- a/lib/librte_eal/windows/eal.c ++++ b/lib/librte_eal/windows/eal.c +@@ -256,6 +256,7 @@ rte_eal_cleanup(void) + struct internal_config *internal_conf = @@ -27 +28,0 @@ - eal_intr_thread_cancel(); @@ -29,2 +29,0 @@ - /* after this point, any DPDK pointers will become dangling */ - rte_eal_memory_detach(); @@ -32 +31,3 @@ -diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c + return 0; + } +diff --git a/lib/librte_eal/windows/eal_memory.c b/lib/librte_eal/windows/eal_memory.c @@ -34,2 +35,2 @@ ---- a/lib/eal/windows/eal_memory.c -+++ b/lib/eal/windows/eal_memory.c +--- a/lib/librte_eal/windows/eal_memory.c ++++ b/lib/librte_eal/windows/eal_memory.c @@ -50,5 +51,5 @@ -diff --git a/lib/eal/windows/eal_windows.h b/lib/eal/windows/eal_windows.h -index 7cc811485d..23ead6d30c 100644 ---- a/lib/eal/windows/eal_windows.h -+++ b/lib/eal/windows/eal_windows.h -@@ -79,6 +79,11 @@ void eal_intr_thread_cancel(void); +diff --git a/lib/librte_eal/windows/eal_windows.h b/lib/librte_eal/windows/eal_windows.h +index 478accc1b9..e1d28e7fac 100644 +--- a/lib/librte_eal/windows/eal_windows.h ++++ b/lib/librte_eal/windows/eal_windows.h +@@ -74,6 +74,11 @@ int eal_intr_thread_schedule(void (*func)(void *arg), void *arg);