aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch
diff options
context:
space:
mode:
authorCarsten Koester <ckoester@cisco.com>2016-06-13 06:39:40 -0400
committerDave Wallace <dwallacelf@gmail.com>2016-08-01 14:52:10 +0000
commitbb847371cf77f1fac6579d0444d6168b5b43c2a0 (patch)
treefd4b84edcda8535033b436d6f3f39cd432350107 /resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch
parentec3512ff7f1405f2e7bc74bbfadf5691afc352c4 (diff)
CSIT-156: DPDK support for Nested VM image
Change-Id: Iefa9ec90d1b243c9e1108f63a182c3d9ef6e6474 Signed-off-by: Carsten Koester <ckoester@cisco.com>
Diffstat (limited to 'resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch')
-rw-r--r--resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch214
1 files changed, 214 insertions, 0 deletions
diff --git a/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch b/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch
new file mode 100644
index 0000000000..29b8bb8de5
--- /dev/null
+++ b/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch
@@ -0,0 +1,214 @@
+diff --git a/package/Config.in b/package/Config.in
+index 6fc0466..ab38a76 100644
+--- a/package/Config.in
++++ b/package/Config.in
+@@ -1095,6 +1095,7 @@ menu "Networking"
+ source "package/cgic/Config.in"
+ source "package/cppzmq/Config.in"
+ source "package/czmq/Config.in"
++ source "package/dpdk/Config.in"
+ source "package/filemq/Config.in"
+ source "package/flickcurl/Config.in"
+ source "package/fmlib/Config.in"
+diff --git a/package/dpdk/Config.in b/package/dpdk/Config.in
+new file mode 100644
+index 0000000..a42271e
+--- /dev/null
++++ b/package/dpdk/Config.in
+@@ -0,0 +1,54 @@
++config BR2_PACKAGE_DPDK
++ bool "dpdk"
++ depends on (BR2_i386 && !BR2_x86_i386 && !BR2_x86_i486 \
++ && !BR2_x86_i586 && !BR2_x86_x1000) \
++ || BR2_x86_64 || BR2_ARM_CPU_ARMV7A || BR2_aarch64 \
++ || BR2_aarch64_be
++ depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC
++ depends on BR2_TOOLCHAIN_HAS_SYNC_1
++ depends on BR2_TOOLCHAIN_HAS_SYNC_2
++ depends on BR2_TOOLCHAIN_HAS_SYNC_4
++ depends on BR2_TOOLCHAIN_HAS_SYNC_8
++ help
++ DPDK is a set of libraries and drivers for fast packet processing. It
++ was designed to run on any processors, however, Intel x86 has been the
++ first CPU to be supported. Ports for other CPUs like IBM Power 8 and
++ ARM are under progress. It runs mostly in Linux userland. A FreeBSD
++ port is now available for a subset of DPDK features.
++
++ Notes:
++ * To build the included Linux Kernel drivers, it is necessary to
++ enable CONFIG_PCI_MSI, CONFIG_UIO.
++ * To build the PCAP PMD properly, you need to enable the libpcap
++ manually.
++ * You may need to install the python2 interpreter if you want to use
++ scripts dpdk_nic_bind.py and cpu_layout.py
++
++ http://www.dpdk.org/
++
++if BR2_PACKAGE_DPDK
++
++config BR2_PACKAGE_DPDK_CONFIG
++ string "Configuration"
++ default "i686-native-linuxapp-gcc" \
++ if BR2_x86_i686
++ default "x86_64-native-linuxapp-gcc" \
++ if BR2_x86_64
++ default "arm-armv7a-linuxapp-gcc" \
++ if BR2_ARM_CPU_ARMV7A
++ default "arm64-armv8a-linuxapp-gcc" \
++ if BR2_aarch64 || BR2_aarch64_be
++
++config BR2_PACKAGE_DPDK_TEST
++ bool "Install tests suite"
++ select BR2_PACKAGE_PYTHON_PEXPECT if BR2_PACKAGE_PYTHON
++ help
++ Install all DPDK tests. If you want to run the tests by the included
++ autotest.py script you need to enable python manually.
++
++config BR2_PACKAGE_DPDK_EXAMPLES
++ bool "Build & install examples"
++ help
++ Build and install all examples selected by the current configuration.
++
++endif
+diff --git a/package/dpdk/dpdk.hash b/package/dpdk/dpdk.hash
+new file mode 100644
+index 0000000..1c47f19
+--- /dev/null
++++ b/package/dpdk/dpdk.hash
+@@ -0,0 +1,2 @@
++# Locally calculated
++sha256 d631495bc6e8d4c4aec72999ac03c3ce213bb996cb88f3bf14bb980dad1d3f7b dpdk-16.04.tar.gz
+diff --git a/package/dpdk/dpdk.mk b/package/dpdk/dpdk.mk
+new file mode 100644
+index 0000000..02860fd
+--- /dev/null
++++ b/package/dpdk/dpdk.mk
+@@ -0,0 +1,128 @@
++################################################################################
++#
++# dpdk
++#
++################################################################################
++
++DPDK_VERSION = 16.04
++DPDK_SITE = http://dpdk.org/browse/dpdk/snapshot
++DPDK_SOURCE = dpdk-$(DPDK_VERSION).tar.gz
++
++DPDK_LICENSE = BSD (core), GPLv2+ (Linux drivers)
++DPDK_LICENSE_FILES = GNUmakefile LICENSE.GPL
++DPDK_INSTALL_STAGING = YES
++
++DPDK_DEPENDENCIES += linux
++
++ifeq ($(BR2_PACKAGE_LIBPCAP),y)
++DPDK_DEPENDENCIES += libpcap
++endif
++
++ifeq ($(BR2_SHARED_LIBS),y)
++define DPDK_ENABLE_SHARED_LIBS
++ $(call KCONFIG_ENABLE_OPT,CONFIG_RTE_BUILD_SHARED_LIB,\
++ $(@D)/build/.config)
++endef
++
++DPDK_POST_CONFIGURE_HOOKS += DPDK_ENABLE_SHARED_LIBS
++endif
++
++# We're building a kernel module without using the kernel-module infra,
++# so we need to tell we want module support in the kernel
++ifeq ($(BR2_PACKAGE_DPDK),y)
++LINUX_NEEDS_MODULES = y
++endif
++
++DPDK_CONFIG = $(call qstrip,$(BR2_PACKAGE_DPDK_CONFIG))
++
++ifeq ($(BR2_PACKAGE_DPDK_EXAMPLES),y)
++# Build of DPDK examples is not very straight-forward. It requires to have
++# the SDK and runtime installed on same place to reference it by RTE_SDK.
++# We place it locally in the build directory.
++# In additition, some examples seem to have a dependency on the ethtool
++# example that may not be met when building in parallel for the first
++# time. As a (dirty) workaround, we build twice.
++define DPDK_BUILD_EXAMPLES
++ $(MAKE) -C $(@D) DESTDIR=$(@D)/examples-sdk \
++ CROSS=$(TARGET_CROSS) install-sdk install-runtime
++ $(MAKE) -C $(@D) RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) \
++ RTE_SDK=$(@D)/examples-sdk/usr/local/share/dpdk \
++ T=$(DPDK_CONFIG) examples || echo "Failed, building again"
++ $(MAKE) -C $(@D) RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) \
++ RTE_SDK=$(@D)/examples-sdk/usr/local/share/dpdk \
++ T=$(DPDK_CONFIG) examples
++endef
++
++DPDK_EXAMPLES_PATH = $(@D)/examples-sdk/usr/local/share/dpdk/examples
++
++# Installation of examples is not supported in DPDK so we do it explicitly
++# here. As the binaries and libraries do not have a single or regular location
++# where to find them after build, we search for them by find.
++define DPDK_INSTALL_EXAMPLES
++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/bin
++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/lib
++ for f in `find $(DPDK_EXAMPLES_PATH) -executable -type f \
++ -name '[a-z]*.so*' | grep '\/lib\/.*'`; do \
++ $(INSTALL) -m 0755 -D $$f \
++ $(TARGET_DIR)/usr/local/lib/`basename $$f`;\
++ done
++ for f in `find $(DPDK_EXAMPLES_PATH) -executable -type f \
++ ! -name '*.so*' | grep '\/app\/.*'`; do \
++ $(INSTALL) -m 0755 -D $$f \
++ $(TARGET_DIR)/usr/local/bin/`basename $$f`;\
++ done
++endef
++
++define DPDK_INSTALL_KMOD
++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/kmod
++ for f in `find $(@D)/build/kmod -name '*.ko'` ; do \
++ $(INSTALL) -m 0755 -D $$f \
++ $(TARGET_DIR)/usr/local/kmod/`basename $$f`; \
++ done
++endef
++
++# Build of the power example is broken (at least for 16.04).
++define DPDK_DISABLE_POWER
++ $(call KCONFIG_DISABLE_OPT,CONFIG_RTE_LIBRTE_POWER,\
++ $(@D)/build/.config)
++endef
++
++DPDK_POST_CONFIGURE_HOOKS += DPDK_DISABLE_POWER
++endif
++
++define DPDK_CONFIGURE_CMDS
++ $(MAKE) -C $(@D) T=$(DPDK_CONFIG) RTE_KERNELDIR=$(LINUX_DIR) \
++ CROSS=$(TARGET_CROSS) config
++endef
++
++define DPDK_BUILD_CMDS
++ $(TARGET_MAKE_ENV) LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) \
++ DBM_INCLUDE="$(STAGING_DIR)/usr/include" \
++ CCOPTS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \
++ SHARED_LIBS="$(if $(BR2_STATIC_LIBS),n,y)" -C $(@D) \
++ RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS)
++ $(DPDK_BUILD_EXAMPLES)
++endef
++
++define DPDK_INSTALL_STAGING_CMDS
++ $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) prefix=/usr \
++ CROSS=$(TARGET_CROSS) install-sdk
++endef
++
++ifeq ($(BR2_PACKAGE_DPDK_TEST),y)
++define DPDK_INSTALL_TARGET_TEST
++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/dpdk
++ $(INSTALL) -m 0755 -D $(@D)/build/app/test $(TARGET_DIR)/usr/dpdk
++ $(INSTALL) -m 0755 -D $(@D)/app/test/*.py $(TARGET_DIR)/usr/dpdk
++endef
++endif
++
++define DPDK_INSTALL_TARGET_CMDS
++ $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) prefix=/usr \
++ CROSS=$(TARGET_CROSS) install-runtime
++ $(DPDK_INSTALL_KMOD)
++ $(DPDK_INSTALL_TARGET_TEST)
++ $(DPDK_INSTALL_EXAMPLES)
++endef
++
++$(eval $(generic-package))