1 diff --git a/package/Config.in b/package/Config.in
2 index 6fc0466..ab38a76 100644
3 --- a/package/Config.in
4 +++ b/package/Config.in
5 @@ -1095,6 +1095,7 @@ menu "Networking"
6 source "package/cgic/Config.in"
7 source "package/cppzmq/Config.in"
8 source "package/czmq/Config.in"
9 + source "package/dpdk/Config.in"
10 source "package/filemq/Config.in"
11 source "package/flickcurl/Config.in"
12 source "package/fmlib/Config.in"
13 diff --git a/package/dpdk/Config.in b/package/dpdk/Config.in
15 index 0000000..a42271e
17 +++ b/package/dpdk/Config.in
19 +config BR2_PACKAGE_DPDK
21 + depends on (BR2_i386 && !BR2_x86_i386 && !BR2_x86_i486 \
22 + && !BR2_x86_i586 && !BR2_x86_x1000) \
23 + || BR2_x86_64 || BR2_ARM_CPU_ARMV7A || BR2_aarch64 \
25 + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC
26 + depends on BR2_TOOLCHAIN_HAS_SYNC_1
27 + depends on BR2_TOOLCHAIN_HAS_SYNC_2
28 + depends on BR2_TOOLCHAIN_HAS_SYNC_4
29 + depends on BR2_TOOLCHAIN_HAS_SYNC_8
31 + DPDK is a set of libraries and drivers for fast packet processing. It
32 + was designed to run on any processors, however, Intel x86 has been the
33 + first CPU to be supported. Ports for other CPUs like IBM Power 8 and
34 + ARM are under progress. It runs mostly in Linux userland. A FreeBSD
35 + port is now available for a subset of DPDK features.
38 + * To build the included Linux Kernel drivers, it is necessary to
39 + enable CONFIG_PCI_MSI, CONFIG_UIO.
40 + * To build the PCAP PMD properly, you need to enable the libpcap
42 + * You may need to install the python2 interpreter if you want to use
43 + scripts dpdk_nic_bind.py and cpu_layout.py
45 + http://www.dpdk.org/
49 +config BR2_PACKAGE_DPDK_CONFIG
50 + string "Configuration"
51 + default "i686-native-linuxapp-gcc" \
53 + default "x86_64-native-linuxapp-gcc" \
55 + default "arm-armv7a-linuxapp-gcc" \
56 + if BR2_ARM_CPU_ARMV7A
57 + default "arm64-armv8a-linuxapp-gcc" \
58 + if BR2_aarch64 || BR2_aarch64_be
60 +config BR2_PACKAGE_DPDK_TEST
61 + bool "Install tests suite"
62 + select BR2_PACKAGE_PYTHON_PEXPECT if BR2_PACKAGE_PYTHON
64 + Install all DPDK tests. If you want to run the tests by the included
65 + autotest.py script you need to enable python manually.
67 +config BR2_PACKAGE_DPDK_EXAMPLES
68 + bool "Build & install examples"
70 + Build and install all examples selected by the current configuration.
73 diff --git a/package/dpdk/dpdk.hash b/package/dpdk/dpdk.hash
75 index 0000000..1c47f19
77 +++ b/package/dpdk/dpdk.hash
80 +sha256 cf2ef6faf8cd056abbbebba779b7850eb3f79edd0d91767bcdbc216a2cde4fd1 dpdk-16.11.tar.gz
81 diff --git a/package/dpdk/dpdk.mk b/package/dpdk/dpdk.mk
83 index 0000000..02860fd
85 +++ b/package/dpdk/dpdk.mk
87 +################################################################################
91 +################################################################################
94 +DPDK_SITE = http://dpdk.org/browse/dpdk/snapshot
95 +DPDK_SOURCE = dpdk-$(DPDK_VERSION).tar.gz
97 +DPDK_LICENSE = BSD (core), GPLv2+ (Linux drivers)
98 +DPDK_LICENSE_FILES = GNUmakefile LICENSE.GPL
99 +DPDK_INSTALL_STAGING = YES
101 +DPDK_DEPENDENCIES += linux
103 +ifeq ($(BR2_PACKAGE_LIBPCAP),y)
104 +DPDK_DEPENDENCIES += libpcap
107 +ifeq ($(BR2_SHARED_LIBS),y)
108 +define DPDK_ENABLE_SHARED_LIBS
109 + $(call KCONFIG_ENABLE_OPT,CONFIG_RTE_BUILD_SHARED_LIB,\
110 + $(@D)/build/.config)
113 +DPDK_POST_CONFIGURE_HOOKS += DPDK_ENABLE_SHARED_LIBS
116 +# We're building a kernel module without using the kernel-module infra,
117 +# so we need to tell we want module support in the kernel
118 +ifeq ($(BR2_PACKAGE_DPDK),y)
119 +LINUX_NEEDS_MODULES = y
122 +DPDK_CONFIG = $(call qstrip,$(BR2_PACKAGE_DPDK_CONFIG))
124 +ifeq ($(BR2_PACKAGE_DPDK_EXAMPLES),y)
125 +# Build of DPDK examples is not very straight-forward. It requires to have
126 +# the SDK and runtime installed on same place to reference it by RTE_SDK.
127 +# We place it locally in the build directory.
128 +# In additition, some examples seem to have a dependency on the ethtool
129 +# example that may not be met when building in parallel for the first
130 +# time. As a (dirty) workaround, we build twice.
131 +define DPDK_BUILD_EXAMPLES
132 + $(MAKE) -C $(@D) DESTDIR=$(@D)/examples-sdk \
133 + CROSS=$(TARGET_CROSS) install-sdk install-runtime
134 + $(MAKE) -C $(@D) RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) \
135 + RTE_SDK=$(@D)/examples-sdk/usr/local/share/dpdk \
136 + T=$(DPDK_CONFIG) examples || echo "Failed, building again"
137 + $(MAKE) -C $(@D) RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) \
138 + RTE_SDK=$(@D)/examples-sdk/usr/local/share/dpdk \
139 + T=$(DPDK_CONFIG) examples
142 +DPDK_EXAMPLES_PATH = $(@D)/examples-sdk/usr/local/share/dpdk/examples
144 +# Installation of examples is not supported in DPDK so we do it explicitly
145 +# here. As the binaries and libraries do not have a single or regular location
146 +# where to find them after build, we search for them by find.
147 +define DPDK_INSTALL_EXAMPLES
148 + $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/bin
149 + $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/lib
150 + for f in `find $(DPDK_EXAMPLES_PATH) -executable -type f \
151 + -name '[a-z]*.so*' | grep '\/lib\/.*'`; do \
152 + $(INSTALL) -m 0755 -D $$f \
153 + $(TARGET_DIR)/usr/local/lib/`basename $$f`;\
155 + for f in `find $(DPDK_EXAMPLES_PATH) -executable -type f \
156 + ! -name '*.so*' | grep '\/app\/.*'`; do \
157 + $(INSTALL) -m 0755 -D $$f \
158 + $(TARGET_DIR)/usr/local/bin/`basename $$f`;\
162 +define DPDK_INSTALL_KMOD
163 + $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/kmod
164 + for f in `find $(@D)/build/kmod -name '*.ko'` ; do \
165 + $(INSTALL) -m 0755 -D $$f \
166 + $(TARGET_DIR)/usr/local/kmod/`basename $$f`; \
170 +# Build of the power example is broken (at least for 16.04).
171 +define DPDK_DISABLE_POWER
172 + $(call KCONFIG_DISABLE_OPT,CONFIG_RTE_LIBRTE_POWER,\
173 + $(@D)/build/.config)
176 +DPDK_POST_CONFIGURE_HOOKS += DPDK_DISABLE_POWER
179 +define DPDK_CONFIGURE_CMDS
180 + $(MAKE) -C $(@D) T=$(DPDK_CONFIG) RTE_KERNELDIR=$(LINUX_DIR) \
181 + CROSS=$(TARGET_CROSS) config
184 +define DPDK_BUILD_CMDS
185 + $(TARGET_MAKE_ENV) LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) \
186 + DBM_INCLUDE="$(STAGING_DIR)/usr/include" \
187 + CCOPTS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \
188 + SHARED_LIBS="$(if $(BR2_STATIC_LIBS),n,y)" -C $(@D) \
189 + RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS)
190 + $(DPDK_BUILD_EXAMPLES)
193 +define DPDK_INSTALL_STAGING_CMDS
194 + $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) prefix=/usr \
195 + CROSS=$(TARGET_CROSS) install-sdk
198 +ifeq ($(BR2_PACKAGE_DPDK_TEST),y)
199 +define DPDK_INSTALL_TARGET_TEST
200 + $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/dpdk
201 + $(INSTALL) -m 0755 -D $(@D)/build/app/test $(TARGET_DIR)/usr/dpdk
202 + $(INSTALL) -m 0755 -D $(@D)/app/test/*.py $(TARGET_DIR)/usr/dpdk
206 +define DPDK_INSTALL_TARGET_CMDS
207 + $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) prefix=/usr \
208 + CROSS=$(TARGET_CROSS) install-runtime
209 + $(DPDK_INSTALL_KMOD)
210 + $(DPDK_INSTALL_TARGET_TEST)
211 + $(DPDK_INSTALL_EXAMPLES)
214 +$(eval $(generic-package))