[dpdk] Revise (#48226)

This commit is contained in:
Kai Pastor 2025-11-17 21:40:07 +01:00 committed by GitHub
parent 096e0079c5
commit 3af1d1e60a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 113 additions and 36 deletions

View File

@ -8,7 +8,7 @@ index 34b85f10b5..5ed4625d9e 100644
if find_libnuma
- numa_dep = cc.find_library('numa', required: false)
- if numa_dep.found() and cc.has_header('numaif.h')
+ numa_dep = dependency('numa', method: 'pkg-config')
+ numa_dep = dependency('numa', method: 'pkg-config', required: false)
+ if numa_dep.found()
dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
has_libnuma = true

View File

@ -1,4 +1,4 @@
if(VCPKG_TARGET_IS_LINUX)
if(VCPKG_TARGET_IS_LINUX AND VCPKG_HOST_IS_LINUX)
execute_process(
COMMAND uname --kernel-release
OUTPUT_VARIABLE KERNEL_VERSION
@ -36,6 +36,7 @@ vcpkg_from_github(
0003-remove-examples-src-from-datadir.patch
0004-stop-building-apps.patch
0005-no-absolute-driver-path.patch
rename-sched.h.diff
)
macro(append_bool_option feature_name option_name)
@ -47,48 +48,55 @@ macro(append_bool_option feature_name option_name)
endmacro()
set(DPDK_OPTIONS "")
set(DPDK_OPTIONS_RELEASE "")
append_bool_option("docs" "enable_docs")
append_bool_option("kmods" "enable_kmods")
append_bool_option("tests" "tests")
append_bool_option("trace" "enable_trace_fp")
string(REPLACE "-Denable_docs=true" "-Denable_docs=false" DPDK_OPTIONS_DEBUG "${DPDK_OPTIONS}")
list(APPEND PYTHON_PACKAGES pyelftools)
set(PYTHON_PACKAGES "")
if(VCPKG_TARGET_IS_WINDOWS)
# https://doc.dpdk.org/guides/windows_gsg/build_dpdk.html#option-3-native-build-on-windows-using-msvc
list(APPEND DPDK_OPTIONS "-Denable_stdatomic=true")
else()
list(APPEND PYTHON_PACKAGES pyelftools)
endif()
if("docs" IN_LIST FEATURES)
list(APPEND DPDK_OPTIONS_RELEASE "-Denable_docs=true")
vcpkg_find_acquire_program(DOXYGEN)
list(APPEND PYTHON_PACKAGES packaging sphinx)
endif()
x_vcpkg_get_python_packages(PYTHON_VERSION "3" PACKAGES ${PYTHON_PACKAGES})
if(PYTHON_PACKAGES)
x_vcpkg_get_python_packages(OUT_PYTHON_VAR PYTHON3 PYTHON_VERSION "3" PACKAGES ${PYTHON_PACKAGES})
endif()
vcpkg_configure_meson(SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Ddeveloper_mode=disabled
-Ddisable_drivers=regex/cn9k
-Dexamples=
OPTIONS_RELEASE
${DPDK_OPTIONS}
OPTIONS_DEBUG
${DPDK_OPTIONS_DEBUG}
OPTIONS_RELEASE
${DPDK_OPTIONS_RELEASE}
ADDITIONAL_BINARIES
"doxygen = ['${DOXYGEN}']"
)
vcpkg_install_meson()
set(tools
dpdk-cmdline-gen.py
dpdk-devbind.py
dpdk-pmdinfo.py
dpdk-telemetry.py
dpdk-hugepages.py
dpdk-rss-flows.py
dpdk-telemetry-exporter.py
)
vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN)
vcpkg_fixup_pkgconfig()
file(GLOB scripts "${CURRENT_PACKAGES_DIR}/bin/*.py")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
foreach(script IN LISTS scripts)
cmake_path(GET script FILENAME filename)
file(RENAME "${script}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${filename}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${filename}")
endforeach()
vcpkg_clean_executables_in_bin(FILE_NAMES none)
if("docs" IN_LIST FEATURES)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/dpdk")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc/dpdk" "${CURRENT_PACKAGES_DIR}/share/dpdk/doc")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc/dpdk" "${CURRENT_PACKAGES_DIR}/share/${PORT}/doc")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/doc")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license/README")

View File

@ -0,0 +1,71 @@
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index a53bc63..087ec80 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -6,7 +6,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
+#ifdef _WIN32
+#include <sched_from_dpdk.h>
+#else
#include <sched.h>
+#endif
#include <assert.h>
#include <string.h>
diff --git a/lib/eal/windows/include/meson.build b/lib/eal/windows/include/meson.build
index e985a77..dbd6b4b 100644
--- a/lib/eal/windows/include/meson.build
+++ b/lib/eal/windows/include/meson.build
@@ -6,5 +6,5 @@ includes += include_directories('.')
headers += files(
'rte_os.h',
'rte_windows.h',
- 'sched.h',
+ 'sched_from_dpdk.h',
)
diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h
index e1c3101..f28b37d 100644
--- a/lib/eal/windows/include/pthread.h
+++ b/lib/eal/windows/include/pthread.h
@@ -6,7 +6,7 @@
#define _PTHREAD_H_
#include <stdint.h>
-#include <sched.h>
+#include <sched_from_dpdk.h>
/**
* This file is required to support the common code in eal_common_proc.c,
diff --git a/lib/eal/windows/include/rte_os.h b/lib/eal/windows/include/rte_os.h
index 9d69467..4df82dd 100644
--- a/lib/eal/windows/include/rte_os.h
+++ b/lib/eal/windows/include/rte_os.h
@@ -14,7 +14,7 @@
#include <stdlib.h>
#include <string.h>
-#include <sched.h>
+#include <sched_from_dpdk.h>
/* These macros are compatible with bundled sys/queue.h. */
#define RTE_TAILQ_HEAD(name, type) \
diff --git a/lib/eal/windows/include/sched.h b/lib/eal/windows/include/sched_from_dpdk.h
similarity index 97%
rename from lib/eal/windows/include/sched.h
rename to lib/eal/windows/include/sched_from_dpdk.h
index 912fed1..400c927 100644
--- a/lib/eal/windows/include/sched.h
+++ b/lib/eal/windows/include/sched_from_dpdk.h
@@ -2,8 +2,8 @@
* Copyright(c) 2019 Intel Corporation
*/
-#ifndef _SCHED_H_
-#define _SCHED_H_
+#ifndef _SCHED_FROM_DPDK_H_
+#define _SCHED_FROM_DPDK_H_
/**
* This file is added to support the common code in eal_common_thread.c

View File

@ -1,6 +0,0 @@
The package dpdk can be imported via CMake FindPkgConfig module:
find_package(PkgConfig)
pkg_check_modules(DPDK REQUIRED IMPORTED_TARGET libdpdk)
target_link_libraries(main PRIVATE PkgConfig::DPDK)

View File

@ -1,11 +1,12 @@
{
"name": "dpdk",
"version-string": "24.11.3",
"version": "24.11.3",
"port-version": 1,
"description": "A set of libraries and drivers for fast packet processing",
"homepage": "https://www.dpdk.org/",
"documentation": "https://doc.dpdk.org/guides/index.html",
"documentation": "https://doc.dpdk.org/guides/",
"license": "BSD-3-Clause",
"supports": "linux | freebsd",
"supports": "freebsd | linux | (windows & x64)",
"dependencies": [
{
"name": "libarchive",
@ -15,7 +16,6 @@
"name": "numactl",
"platform": "linux"
},
"python3",
{
"name": "vcpkg-get-python-packages",
"host": true

View File

@ -86,7 +86,6 @@ discord-game-sdk:x64-windows-static-md=fail
discord-game-sdk:x64-windows-static=fail
discord-rpc(uwp)=fail
dmlc(uwp) = fail
dpdk[docs]:x64-linux = feature-fails # doxygen required to build docs
ensmallen[openmp](osx) = feature-fails # No openmp on default osx toolchain
epsilon(uwp)=fail
faiss:arm64-windows=fail

View File

@ -2526,7 +2526,7 @@
},
"dpdk": {
"baseline": "24.11.3",
"port-version": 0
"port-version": 1
},
"dpp": {
"baseline": "10.1.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c7a3787ad80d51937e2b97a7ef9888afe4b80061",
"version": "24.11.3",
"port-version": 1
},
{
"git-tree": "688a23c5e2022b2bfec803eb636b87e6d7655f34",
"version-string": "24.11.3",