[dpdk-stable] patch 'eal/windows: cleanup virt2phys handle' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Aug 3 14:22:08 CEST 2021


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 <dmitry.kozliuk at gmail.com>
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 <dmitry.kozliuk at gmail.com>
Acked-by: Ranjit Menon <ranjit.menon at intel.com>
---
 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 at 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);


More information about the stable mailing list