Skip to contentSkip to conversation

dmadev: enable build on Windows

PATCH In review Bruce Richardson 3 participants 4 messages Oct 19, 2021 – Oct 20, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmadev: enable build on Windows

The dmadev library was not added to the list of libraries built on Windows, meaning it was skipped in those builds and also that none of the drivers were being considered for build. Adding dmadev to the list fixes this, and also enables the skeleton dmadev driver to be built - all-be-it with a small fix necessary.

---

This patch has been compile tested using mingw on Linux. Sending it publicly so that I can get CI test reports to check native windows builds.

---
 drivers/dma/skeleton/skeleton_dmadev.c | 2 +-
 lib/meson.build                        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/dma/skeleton/skeleton_dmadev.c +1 -1
index 2952417126..d9e4f731d7 100644
@@ -153,7 +153,7 @@ skeldma_stop(struct rte_dma_dev *dev)
 	hw->exit_flag = true;
 	rte_delay_ms(1);
 
-	pthread_cancel(hw->thread);
+	(void)pthread_cancel(hw->thread);
 	pthread_join(hw->thread, NULL);
 
 	return 0;
lib/meson.build +1 -0
index 3b8b099820..403b1f4aa4 100644
@@ -75,6 +75,7 @@ if is_windows
             'net',
             'meter',
             'ethdev',
+            'dmadev',
             'pci',
             'cmdline',
             'metrics',
Signature · 1 line
2.30.2
#1 lore raw
Quoted 7 lines · Bruce Richardson

The dmadev library was not added to the list of libraries built on Windows, meaning it was skipped in those builds and also that none of the drivers were being considered for build. Adding dmadev to the list fixes this, and also enables the skeleton dmadev driver to be built - all-be-it with a small fix necessary.

Quoted 7 lines

---

This patch has been compile tested using mingw on Linux. Sending it publicly so that I can get CI test reports to check native windows builds.
---

There is a problem with exported symbols.
Some inlines have been marked for versioning (see rte_dma_burst_capacity for example) and must be removed from version.map.

Can you have a look?

==== 20 line log output for Windows Server 2019 (dpdk_meson_compile): ====
"clang" -Wl,/MACHINE:X64 -Wl,/OUT:lib/rte_dmadev-22.dll lib/librte_dmadev.a.p/dmadev_rte_dmadev.c.obj "-Wl,/nologo"
"-Wl,/release" "-Wl,/nologo" "-Wl,/OPT:REF" "-Wl,/DLL"
"-Wl,/IMPLIB:lib\rte_dmadev.lib" "lib\rte_eal.lib"
"lib\rte_kvargs.lib" "-Wl,/def:C:\Users\builder\jenkins\workspace\Windows-Compile-DPDK-Meson\dpdk\build\lib\rte_dmadev_exports.def" "-ldbghelp" "-lsetupapi" "-lws2_32" "-lmincore" "-lkernel32"
"-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32"
"-luuid" "-lcomdlg32" "-ladvapi32"
rte_dmadev_exports.def : error LNK2001: unresolved external symbol
rte_dma_burst_capacity
rte_dmadev_exports.def : error LNK2001: unresolved external symbol
rte_dma_completed
rte_dmadev_exports.def : error LNK2001: unresolved external symbol
rte_dma_completed_status
rte_dmadev_exports.def : error LNK2001: unresolved external symbol rte_dma_copy rte_dmadev_exports.def : error LNK2001: unresolved external symbol
rte_dma_copy_sg
rte_dmadev_exports.def : error LNK2001: unresolved external symbol rte_dma_fill rte_dmadev_exports.def : error LNK2001: unresolved external symbol
rte_dma_submit
lib\rte_dmadev.lib : fatal error LNK1120: 7 unresolved externals
clang: error: linker command failed with exit code 1120 (use -v to see
invocation)
[485/536] Linking target lib/rte_timer-22.dll
Creating library lib\rte_timer.lib and object lib\rte_timer.exp
[486/536] Linking target lib/rte_cfgfile-22.dll
Creating library lib\rte_cfgfile.lib and object lib\rte_cfgfile.exp
[487/536] Linking target lib/rte_pci-22.dll
Creating library lib\rte_pci.lib and object lib\rte_pci.exp
[488/536] Generating symbol file lib/rte_meter-22.dll.p/rte_meter-22.dll.symbols
[489/536] Generating symbol file lib/rte_ring-22.dll.p/rte_ring-22.dll.symbols
ninja: build stopped: subcommand failed.
[1] Error running command.
==== End log output ====

Signature · 1 line
David Marchand
#2 lore raw
Quoted 18 lines · David Marchand
Quoted 7 lines · Bruce Richardson

The dmadev library was not added to the list of libraries built on Windows, meaning it was skipped in those builds and also that none of the drivers were being considered for build. Adding dmadev to the list fixes this, and also enables the skeleton dmadev driver to be built - all-be-it with a small fix necessary.

Quoted 7 lines

---

This patch has been compile tested using mingw on Linux. Sending it publicly so that I can get CI test reports to check native windows builds.
---

Quoted 6 lines

There is a problem with exported symbols.
Some inlines have been marked for versioning (see rte_dma_burst_capacity for example) and must be removed from version.map.

Can you have a look?

I sent the patches.
Hope it saves us some time:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

Signature · 1 line
David Marchand
Reviewed-by on v1 1/1
#3 lore raw
In reply to Bruce Richardson
Quoted 35 lines · Bruce Richardson

The dmadev library was not added to the list of libraries built on Windows, meaning it was skipped in those builds and also that none of the drivers were being considered for build. Adding dmadev to the list fixes this, and also enables the skeleton dmadev driver to be built - all-be-it with a small fix necessary.

---

This patch has been compile tested using mingw on Linux. Sending it publicly so that I can get CI test reports to check native windows builds.

---
 drivers/dma/skeleton/skeleton_dmadev.c | 2 +-
 lib/meson.build                        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/dma/skeleton/skeleton_dmadev.c +1 -1
index 2952417126..d9e4f731d7 100644
@@ -153,7 +153,7 @@ skeldma_stop(struct rte_dma_dev *dev)
 	hw->exit_flag = true;
 	rte_delay_ms(1);
 
-	pthread_cancel(hw->thread);
+	(void)pthread_cancel(hw->thread);
 	pthread_join(hw->thread, NULL);
 
 	return 0;
lib/meson.build +0 -0
index 3b8b099820..403b1f4aa4 100644

lib/meson.build if is_windows · line 81

Quoted 7 lines
lib/meson.build +1 -0
@@ -75,6 +75,7 @@ if is_windows
             'net',
             'meter',
             'ethdev',
+            'dmadev',
             'pci',
             'cmdline',
             'metrics',
Quoted 1 line