From 1eed21188933daf956f1b44591b4dd92a4f51647 Mon Sep 17 00:00:00 2001 From: lean Date: Sat, 19 Jun 2021 23:16:19 +0800 Subject: [PATCH] dpdk: add x64 and armv8 64bit support --- package/network/utils/dpdk/Makefile | 24 ++--- .../0001-Add-DPDK-support-for-Armv7.patch | 91 ------------------- ...g-backtrace-and-execinfo-header-file.patch | 40 ++++++++ 3 files changed, 47 insertions(+), 108 deletions(-) delete mode 100644 package/network/utils/dpdk/patches/0001-Add-DPDK-support-for-Armv7.patch create mode 100644 package/network/utils/dpdk/patches/0001-Handling-backtrace-and-execinfo-header-file.patch diff --git a/package/network/utils/dpdk/Makefile b/package/network/utils/dpdk/Makefile index e3345ed84..dd0f4603d 100644 --- a/package/network/utils/dpdk/Makefile +++ b/package/network/utils/dpdk/Makefile @@ -16,36 +16,26 @@ include $(INCLUDE_DIR)/host-build.mk include $(TOPDIR)/feeds/packages/devel/meson/meson.mk include $(TOPDIR)/feeds/packages/devel/ninja/ninja.mk -ifeq ($(CONFIG_LIBC),"glibc") - PKG_CONFIG := $(PKG_BUILD_DIR)/config/arm/arm_armv7a_linux_glibc_gcc -else - PKG_CONFIG := $(PKG_BUILD_DIR)/config/arm/arm_armv7a_linux_musl_gcc -endif - TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral define Package/dpdk SECTION := net CATEGORY := Network - TITLE := Data Plane Development Kit (DPDK) - DEPENDS := @(arm) +librt +libpthread +libbpf +libpcap + TITLE := Data Plane Development Kit (DPDK) + DEPENDS := @(x86_64||arm||aarch64) +librt +libpthread +libbpf +libpcap +libopenssl endef define Package/dpdk/description - DPDK consists of libraries to accelerate packet processing - workloads running on a wide variety of CPU architectures. -endef - -define Build/Configure - $(call Build/Configure/Meson) --cross-file $(PKG_CONFIG) + DPDK consists of libraries to accelerate packet processing + workloads running on a wide variety of CPU architectures. endef define Package/dpdk/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/bin/dpdk-testpmd $(1)/usr/bin/ - $(CP) $(PKG_INSTALL_DIR)/usr/bin/dpdk-proc-info $(1)/usr/bin/ - $(CP) $(PKG_INSTALL_DIR)/usr/bin/dpdk-test-flow-perf $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dpdk-testpmd $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dpdk-proc-info $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dpdk-test-flow-perf $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/ endef diff --git a/package/network/utils/dpdk/patches/0001-Add-DPDK-support-for-Armv7.patch b/package/network/utils/dpdk/patches/0001-Add-DPDK-support-for-Armv7.patch deleted file mode 100644 index e401034cb..000000000 --- a/package/network/utils/dpdk/patches/0001-Add-DPDK-support-for-Armv7.patch +++ /dev/null @@ -1,91 +0,0 @@ -From e8fa8aa186644e797ca1df457f5bbe146e901bad Mon Sep 17 00:00:00 2001 -From: Chandrakant Sharpa -Date: Wed, 9 Jun 2021 14:07:10 +0530 -Subject: [PATCH] Add DPDK support for Armv7 - -Signed-off-by: Chandrakant Sharpa ---- - config/arm/arm_armv7a_linux_glibc_gcc | 17 +++++++++++++++++ - config/arm/arm_armv7a_linux_musl_gcc | 17 +++++++++++++++++ - lib/eal/linux/eal_debug.c | 2 ++ - 3 files changed, 36 insertions(+) - create mode 100644 config/arm/arm_armv7a_linux_glibc_gcc - create mode 100644 config/arm/arm_armv7a_linux_musl_gcc - -diff --git a/config/arm/arm_armv7a_linux_glibc_gcc b/config/arm/arm_armv7a_linux_glibc_gcc -new file mode 100644 -index 000000000..5981a5b9f ---- /dev/null -+++ b/config/arm/arm_armv7a_linux_glibc_gcc -@@ -0,0 +1,17 @@ -+[binaries] -+c = 'arm-openwrt-linux-gnueabi-gcc' -+cpp = 'arm-openwrt-linux-gnueabi-cpp' -+ar = 'arm-openwrt-linux-gnueabi-ar' -+strip = 'arm-openwrt-linux-gnueabi-strip' -+pkgconfig = 'arm-openwrt-linux-gnueabi-pkg-config' -+pcap-config = '' -+ -+[host_machine] -+system = 'linux' -+cpu_family = 'arm' -+cpu = 'armv7-a' -+endian = 'little' -+ -+[properties] -+# Generate binaries that are portable across all Armv7 machines -+platform = 'generic' -diff --git a/config/arm/arm_armv7a_linux_musl_gcc b/config/arm/arm_armv7a_linux_musl_gcc -new file mode 100644 -index 000000000..9b4a5dd1e ---- /dev/null -+++ b/config/arm/arm_armv7a_linux_musl_gcc -@@ -0,0 +1,17 @@ -+[binaries] -+c = 'arm-openwrt-linux-muslgnueabi-gcc' -+cpp = 'arm-openwrt-linux-muslgnueabi-cpp' -+ar = 'arm-openwrt-linux-muslgnueabi-ar' -+strip = 'arm-openwrt-linux-muslgnueabi-strip' -+pkgconfig = 'arm-openwrt-linux-muslgnueabi-pkg-config' -+pcap-config = '' -+ -+[host_machine] -+system = 'linux' -+cpu_family = 'arm' -+cpu = 'armv7-a' -+endian = 'little' -+ -+[properties] -+# Generate binaries that are portable across all Armv7 machines -+platform = 'generic' -diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c -index 64dab4e0d..3dbf42248 100644 ---- a/lib/eal/linux/eal_debug.c -+++ b/lib/eal/linux/eal_debug.c -@@ -2,9 +2,12 @@ - * Copyright(c) 2010-2014 Intel Corporation - */ - -+#ifdef __GLIBC__ - #ifdef RTE_BACKTRACE - #include - #endif -+#endif -+ - #include - #include - #include -@@ -26,8 +26,10 @@ void rte_dump_stack(void) - char **symb = NULL; - int size; - -+#ifdef __GLIBC__ - size = backtrace(func, BACKTRACE_SIZE); - symb = backtrace_symbols(func, size); -+#endif - - if (symb == NULL) - return; --- -2.17.1 - diff --git a/package/network/utils/dpdk/patches/0001-Handling-backtrace-and-execinfo-header-file.patch b/package/network/utils/dpdk/patches/0001-Handling-backtrace-and-execinfo-header-file.patch new file mode 100644 index 000000000..68511825e --- /dev/null +++ b/package/network/utils/dpdk/patches/0001-Handling-backtrace-and-execinfo-header-file.patch @@ -0,0 +1,40 @@ +From afe64bae6d398fc9a194bce2763d6b2ab080f38f Mon Sep 17 00:00:00 2001 +From: Chandrakant Sharpa +Date: Mon, 14 Jun 2021 17:53:16 +0530 +Subject: [PATCH] Handling backtrace and execinfo header file + +Signed-off-by: Chandrakant Sharpa +--- + lib/eal/linux/eal_debug.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c +index 64dab4e0d..24b8b23dd 100644 +--- a/lib/eal/linux/eal_debug.c ++++ b/lib/eal/linux/eal_debug.c +@@ -2,9 +2,11 @@ + * Copyright(c) 2010-2014 Intel Corporation + */ + ++#ifdef __GLIBC__ + #ifdef RTE_BACKTRACE + #include + #endif ++#endif + #include + #include + #include +@@ -26,8 +28,10 @@ void rte_dump_stack(void) + char **symb = NULL; + int size; + ++#ifdef __GLIBC__ + size = backtrace(func, BACKTRACE_SIZE); + symb = backtrace_symbols(func, size); ++#endif + + if (symb == NULL) + return; +-- +2.17.1 +