From: Chunrong Guo <chunrong....@nxp.com>

---
 recipes-extended/dpdk/dpdk-extras_git.bb           | 27 +++++++
 ...ys-sysmacros.h-for-major-minor-defintions.patch | 38 ++++++++++
 .../add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch | 51 +++++++++++++
 recipes-extended/dpdk/dpdk_16.07.bb                | 85 ++++++++++++++++++++++
 recipes-extended/ovs-dpdk/ovs-dpdk_0.1.bb          | 49 +++++++++++++
 5 files changed, 250 insertions(+)
 create mode 100644 recipes-extended/dpdk/dpdk-extras_git.bb
 create mode 100644 
recipes-extended/dpdk/dpdk/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
 create mode 100644 
recipes-extended/dpdk/dpdk/add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch
 create mode 100644 recipes-extended/dpdk/dpdk_16.07.bb
 create mode 100644 recipes-extended/ovs-dpdk/ovs-dpdk_0.1.bb

diff --git a/recipes-extended/dpdk/dpdk-extras_git.bb 
b/recipes-extended/dpdk/dpdk-extras_git.bb
new file mode 100644
index 0000000..a18c467
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-extras_git.bb
@@ -0,0 +1,27 @@
+DESCRIPTION = "Data Plane Development Kit Extended utilities"
+HOMEPAGE = "http://dpdk.org";
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+RDEPENDS_${PN} = "dpdk"
+
+SRC_URI = "git://git.freescale.com/ppc/sdk/dpdk-extras.git;nobranch=1"
+SRCREV = "ebc515aad0605ad90d8ade5c1fde60d8da86973f"
+
+S = "${WORKDIR}/git"
+
+DPAA_VER ?= "dpaa2"
+DPAA_VER_fsl-lsch2 = "dpaa"
+
+do_install() {
+    install -d ${D}/${bindir}/dpdk-example/extras
+
+    for file_suffix in xml sh; do
+        if [ "`ls ${S}/${DPAA_VER}/*.${file_suffix}`" != "" ]; then
+            install -m 755 ${S}/${DPAA_VER}/*.${file_suffix} 
${D}/${bindir}/dpdk-example/extras
+        fi
+    done
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "(ls2080ardb|ls2084ardb|ls2088a|ls1043a|ls1046a)"
diff --git 
a/recipes-extended/dpdk/dpdk/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
 
b/recipes-extended/dpdk/dpdk/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
new file mode 100644
index 0000000..c894044
--- /dev/null
+++ 
b/recipes-extended/dpdk/dpdk/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
@@ -0,0 +1,38 @@
+Subject: [PATCH] include <sys/sysmacros.h> for major/minor defintions
+
+glibc 2.25 is warning about it if applications depend on
+sys/types.h for these macros, it expects to be included
+from <sys/sysmacros.h>
+
+Fixes
+| Grow.c:3534:13: error: In the GNU C Library, "minor" is defined
+|  by <sys/sysmacros.h>. For historical compatibility, it is
+|  currently defined by <sys/types.h> as well, but we plan to
+|  remove this soon. To use "minor", include <sys/sysmacros.h>
+|  directly. If you did not intend to use a system-defined macro
+|  "minor", you should undefine it after including <sys/types.h>. [-Werror]
+| Query.c: In function 'Query':
+| Query.c:105:13: error: In the GNU C Library, "makedev" is defined
+|  by <sys/sysmacros.h>. For historical compatibility, it is
+|  currently defined by <sys/types.h> as well, but we plan to
+|  remove this soon. To use "makedev", include <sys/sysmacros.h>
+|  directly. If you did not intend to use a system-defined macro
+|  "makedev", you should undefine it after including <sys/types.h>. [-Werror]
+|           makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev)
+|              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Chunrong Guo <chunrong....@nxp.com>
+---
+Upstream-Status: Pending
+
+
+--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.cold     2017-02-27 
17:36:15.984931159 +0800
++++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c        2017-02-27 
17:36:57.520929721 +0800
+@@ -39,6 +39,7 @@
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+ #include <linux/pci_regs.h>
++#include <sys/sysmacros.h>
+ 
+ #if defined(RTE_ARCH_X86)
+ #include <sys/io.h>
diff --git 
a/recipes-extended/dpdk/dpdk/add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch 
b/recipes-extended/dpdk/dpdk/add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch
new file mode 100644
index 0000000..4657f07
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk/add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch
@@ -0,0 +1,51 @@
+From 6c8d348190a8cf6c35111913cbf117ca98137e84 Mon Sep 17 00:00:00 2001
+From: Rahul Kumar Gupta <rahul.kumarxx.gu...@intel.com>
+Date: Fri, 18 Dec 2015 18:30:47 +0800
+Subject: [PATCH] dpdk v2.2.0: add RTE_KERNELDIR_OUT to split kernel build
+ artifact
+
+Introduce RTE_KERNELDIR_OUT to be the path to which kernel build
+artifacts are located. This is for matching the workflow change
+since Yocto Project v1.8 onwards whereby tmp/work-shared contains
+separate directories for kernel source and kernel artifacts.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Rahul Kumar Gupta <rahul.kumarxx.gu...@intel.com>
+---
+ mk/rte.module.mk | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/mk/rte.module.mk b/mk/rte.module.mk
+index 53ed4fe..b7a014b 100644
+--- a/mk/rte.module.mk
++++ b/mk/rte.module.mk
+@@ -77,7 +77,7 @@ build: _postbuild
+ # build module
+ $(MODULE).ko: $(SRCS_LINKS)
+       @if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+-      @$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) \
++      @$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR_OUT) \
+               CC="$(KERNELCC)" CROSS_COMPILE=$(CROSS) V=$(if $V,1,0)
+ 
+ # install module in $(RTE_OUTPUT)/kmod
+@@ -88,7 +88,7 @@ $(RTE_OUTPUT)/kmod/$(MODULE).ko: $(MODULE).ko
+ 
+ # install module
+ modules_install:
+-      @$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) \
++      @$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR_OUT) \
+               modules_install
+ 
+ .PHONY: clean
+@@ -98,7 +98,7 @@ clean: _postclean
+ .PHONY: doclean
+ doclean:
+       @if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+-      $(Q)$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) clean
++      $(Q)$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR_OUT) clean
+       @$(foreach FILE,$(SRCS-y) $(SRCS-n) $(SRCS-),\
+               if [ -h $(notdir $(FILE)) ]; then rm -f $(notdir $(FILE)) ; fi 
;)
+       @if [ -h $(notdir Makefile) ]; then rm -f $(notdir Makefile) ; fi
+-- 
+1.9.1
diff --git a/recipes-extended/dpdk/dpdk_16.07.bb 
b/recipes-extended/dpdk/dpdk_16.07.bb
new file mode 100644
index 0000000..380ec39
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk_16.07.bb
@@ -0,0 +1,85 @@
+DESCRIPTION = "Data Plane Development Kit"
+HOMEPAGE = "http://dpdk.org";
+LICENSE = "BSD & LGPLv2 & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS += "virtual/kernel openssl"
+RDEPENDS_${PN} = "bash python"
+RDEPENDS_${PN}-examples = "bash python-core"
+
+inherit module
+
+SRC_URI = "git://git.freescale.com/ppc/sdk/dpdk.git;nobranch=1 \
+    file://add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
+    file://a.patch \
+"
+SRCREV = "34b69f9ab1af11db43df2d616be1c1f20feef70b"
+
+S = "${WORKDIR}/git"
+
+DPAA_VER ?= "dpaa2"
+DPAA_VER_fsl-lsch2 = "dpaa"
+export RTE_TARGET = "${ARCH}-${DPAA_VER}-linuxapp-gcc"
+
+EXTRA_OEMAKE += 'ARCH="${ARCH}" CROSS="${TARGET_PREFIX}" \
+    CPU_CFLAGS="--sysroot=${STAGING_DIR_HOST}" RTE_SDK="${S}" \
+    OPENSSL_PATH="${STAGING_DIR_HOST}" RTE_KERNELDIR="${STAGING_KERNEL_DIR}" \
+    RTE_KERNELDIR_OUT="${STAGING_KERNEL_BUILDDIR}" \
+'
+
+do_configure[noexec] = "1"
+
+do_compile[depends] += "virtual/kernel:do_shared_workdir"
+do_compile() {
+    oe_runmake O="${RTE_TARGET}" T="${RTE_TARGET}" config
+}
+
+do_install() {
+    unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
+
+    oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" 
T="${RTE_TARGET}" DESTDIR="${D}" install
+
+    # Build and install the DPDK examples
+    for APP in examples/l2fwd examples/l3fwd examples/l2fwd-crypto 
examples/ipsec-secgw examples/kni; do
+        oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu"  -C 
${APP}
+
+        [ ! -d ${D}/${bindir}/dpdk-example ] && install -d 0644 
${D}/${bindir}/dpdk-example
+        install -m 0755 ${S}/examples/`basename ${APP}`/build/`basename 
${APP}` \
+            ${D}/${bindir}/dpdk-example/
+    done
+    install -m 0755 ${S}/${RTE_TARGET}/app/testpmd ${D}/${bindir}/dpdk-example/
+    rm -fr ${D}/lib/modules/*
+    install -d ${D}/lib/modules/${KERNEL_VERSION}/dpdk
+    install -m 0755 ${S}/${RTE_TARGET}/kmod/rte_kni.ko 
${D}/lib/modules/${KERNEL_VERSION}/dpdk/
+
+    sed -i 's#/bin/echo#/bin/bash#' 
${D}/${datadir}/scripts/load-devel-config.sh
+   # rm ${S}/${RTE_TARGET}/app/dpdk-pmdinfogen
+    rm ${D}/${datadir}/${RTE_TARGET}/app/dpdk-pmdinfogen
+
+    chown root:root -R ${D}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PACKAGES += "${PN}-examples"
+
+FILES_${PN} += "${datadir}/tools /usr/bin/* /usr/sbin/*"
+FILES_${PN}-dbg += "${bindir}/dpdk-example/.debug \
+    ${datadir}/examples/kni/build/.debug \
+    ${datadir}/examples/kni/build/app/.debug \
+    ${datadir}/examples/l2fwd/build/.debug \
+    ${datadir}/examples/l2fwd/build/app/.debug \
+    ${datadir}/examples/l2fwd-crypto/build/.debug \
+    ${datadir}/examples/l2fwd-crypto/build/app/.debug \
+    ${datadir}/examples/l3fwd/build/.debug \
+    ${datadir}/examples/l3fwd/build/app/.debug \
+    ${datadir}/examples/ipsec-secgw/build/.debug \
+    ${datadir}/examples/ipsec-secgw/build/app/.debug \
+"
+FILES_${PN}-dev += "${datadir}/mk ${datadir}/scripts \
+    ${datadir}/${RTE_TARGET} \
+    ${includedir} \
+"
+FILES_${PN}-examples += "${datadir}/examples"
+
+COMPATIBLE_MACHINE = "(ls2080ardb|ls2084ardb|ls2088a|ls1043a|ls1046a)"
diff --git a/recipes-extended/ovs-dpdk/ovs-dpdk_0.1.bb 
b/recipes-extended/ovs-dpdk/ovs-dpdk_0.1.bb
new file mode 100644
index 0000000..472ac16
--- /dev/null
+++ b/recipes-extended/ovs-dpdk/ovs-dpdk_0.1.bb
@@ -0,0 +1,49 @@
+DESCRIPTION = "OVS DPDK"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35"
+
+DEPENDS = "dpdk python-six-native"
+RDEPENDS_${PN} = "bash libcrypto libssl python"
+
+inherit pythonnative
+
+SRC_URI = "git://git.freescale.com/ppc/sdk/ovs-dpdk.git;nobranch=1"
+SRCREV = "84599fad4a10597fb4377174abdeb84b871cb4b0"
+
+S = "${WORKDIR}/git"
+
+DPAA_VER ?= "dpaa2"
+DPAA_VER_fsl-lsch2 = "dpaa"
+export RTE_TARGET = "${ARCH}-${DPAA_VER}-linuxapp-gcc"
+
+EXTRA_OEMAKE += 'ARCH="${ARCH}" CROSS="${TARGET_PREFIX}" \
+    CPU_CFLAGS="--sysroot=${STAGING_DIR_HOST}" RTE_SDK="${S}" \
+    OPENSSL_PATH="${STAGING_DIR_HOST}" RTE_KERNELDIR="${STAGING_KERNEL_DIR}" \
+    RTE_KERNELDIR_OUT="${STAGING_KERNEL_BUILDDIR}" \
+'
+
+do_configure() {
+       export SYSROOT_DPDK=${PKG_CONFIG_SYSROOT_DIR}
+       ${S}/boot.sh
+       ${S}/configure --host aarch64-fsl-linux 
--with-dpdk=${SYSROOT_DPDK}/usr/share/${RTE_TARGET} 
--with-openssl=${SYSROOT_DPDK}/usr CFLAGS="-g -Wno-cast-align -Ofast" 
+}
+
+do_compile() {
+       oe_runmake O="${RTE_TARGET}" T="${RTE_TARGET}" 
+}
+
+do_install() {
+       install -d ${D}${bindir}/ovs-dpdk
+       cp -rf  ${S}/ovsdb/ovsdb-tool ${D}${bindir}/ovs-dpdk
+       cp -rf  ${S}/ovsdb/ovsdb-server ${D}${bindir}/ovs-dpdk
+       cp -rf  ${S}/vswitchd/vswitch.ovsschema ${D}${bindir}/ovs-dpdk
+       cp -rf  ${S}/vswitchd/ovs-vswitchd ${D}${bindir}/ovs-dpdk
+       cp -rf  ${S}/utilities/ovs-vsctl ${D}${bindir}/ovs-dpdk
+       cp -rf  ${S}/utilities/ovs-ofctl ${D}${bindir}/ovs-dpdk
+       chmod 777 -R ${D}${bindir}/ovs-dpdk/*
+}
+
+ALLOW_EMPTY_${PN} = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "(ls2080ardb|ls2084ardb|ls2088a|ls1043a|ls1046a)"
-- 
1.9.0

-- 
_______________________________________________
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to