eal/windows: cleanup virt2phys handle
PATCH 1/1 eal/windows: cleanup virt2phys handle
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 <[email protected]>
--- lib/eal/windows/eal.c | 1 + lib/eal/windows/eal_memory.c | 7 +++++++ lib/eal/windows/eal_windows.h | 5 +++++ 3 files changed, 13 insertions(+)
lib/eal/windows/eal.c +1 -0
@@ -261,6 +261,7 @@ rte_eal_cleanup(void)eal_get_internal_configuration ();eal_intr_thread_cancel (); +eal_mem_virt2iova_cleanup ();/* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach ();eal_cleanup_config (internal_conf);
lib/eal/windows/eal_memory.c +7 -0
@@ -198,6 +198,13 @@ eal_mem_virt2iova_init(void)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) {
lib/eal/windows/eal_windows.h +5 -0
@@ -79,6 +79,11 @@ void eal_intr_thread_cancel(void);*/ 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. *
Signature · 1 line
2.29.3
Quoted 49 lines · Dmitry Kozlyuk
eal_mem_virt2phys_init()opens a handle for use byrte_mem_virt2phy(). Close this handle on EAL cleanup.Fixes 2a5d547a4a9b ("eal/windows: implement basic memory management")Signed-off-by Dmitry Kozlyuk <[email protected]>--- lib/eal/windows/eal.c | 1 + lib/eal/windows/eal_memory.c | 7 +++++++ lib/eal/windows/eal_windows.h | 5 +++++ 3 files changed, 13 insertions(+)lib/eal/windows/eal.c +1
-0@@ -261,6 +261,7 @@ rte_eal_cleanup(void)eal_get_internal_configuration ();eal_intr_thread_cancel (); +eal_mem_virt2iova_cleanup ();/* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach ();eal_cleanup_config (internal_conf);lib/eal/windows/eal_memory.c +7
-0@@ -198,6 +198,13 @@ eal_mem_virt2iova_init(void)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) {lib/eal/windows/eal_windows.h +0
-0@@ -79,6 +79,11 @@ void eal_intr_thread_cancel(void);*/
lib/eal/windows/eal_windows.h void eal_intr_thread_cancel(void); · line 89
Quoted 10 lines
lib/eal/windows/eal_windows.h +5
-0int 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. *
Acked-by Ranjit Menon <[email protected]>
Thomas Monjalon
Applied27/07/2021 07:43, Menon, Ranjit:
Quoted 9 lines · Dmitry Kozlyuk
Quoted 7 lines
eal_mem_virt2phys_init()opens a handle for use byrte_mem_virt2phy(). Close this handle on EAL cleanup.Fixes 2a5d547a4a9b ("eal/windows: implement basic memory management")Signed-off-by Dmitry Kozlyuk <[email protected]>Acked-by Ranjit Menon <[email protected]>
Applied, thanks.