[meta-intel] [PATCH 0/3] Add DPDK recipes to meta-intel/common

2014-07-08 Thread wei . sern . chan
From: Chan Wei Sern wei.sern.c...@intel.com

Hi All,

This series of patch consists below:-

1. Create meta-intel/common/recipes-extended folder and add initial recipe for
   Intel Data Plane Development Kits (DPDK) v1.6.0-r2.
2. Cherry-pick patches from dpdk.org to fix examples/app build issue found on 
1.6.0-r2.
3. Update romley and romley-ivb machine configuration to include dpdk-1.6.0r2 
during the build.

Please help to pull this into meta-intel:daisy branch and meta-intel:master 
branch.

Thanks.
Regards,
Chan Wei Sern.
The following changes since commit 50d1afd52a612dbf9a190bf869c37253864886cc:

  Provide a time limited kernel extension for the v3.14 kernel (2014-06-12 
11:58:21 -0500)

are available in the git repository at:

  git://git.yoctoproject.org/meta-intel-contrib wchan9/daisy/intel-bsp-common
  
http://git.yoctoproject.org/cgit.cgi/meta-intel-contrib/log/?h=wchan9/daisy/intel-bsp-common

Chan Wei Sern (3):
  meta-intel/common: Initial Intel DPDK recipe under recipes-extended
  meta-intel/common: fix Intel DPDK example apps build failure in
v1.6.0-r2
  meta-romley: add Intel DPDK v1.6.0r2 support Romley machine config

 ...ix-build-switches-to-enable-cmdline-tests.patch |  49 +
 ...dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch |  31 
 ...k-1.6.0r2-examples-qos_sched-fix-makefile.patch |  31 
 common/recipes-extended/dpdk/dpdk_1.6.0r2.bb   | 205 +
 meta-romley/conf/machine/romley-ivb.conf   |   6 +-
 meta-romley/conf/machine/romley.conf   |   6 +-
 6 files changed, 326 insertions(+), 2 deletions(-)
 create mode 100644 
common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch
 create mode 100644 
common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch
 create mode 100644 
common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch
 create mode 100644 common/recipes-extended/dpdk/dpdk_1.6.0r2.bb

-- 
1.9.1

-- 
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


[meta-intel] [PATCH 1/3] meta-intel/common: Initial Intel DPDK recipe under recipes-extended

2014-07-08 Thread wei . sern . chan
From: Chan Wei Sern wei.sern.c...@intel.com

This is an initial version of Intel Data Plane Development Kits
(DPDK) recipe support. This recipe is targetting on Intel DPDK
v1.6.0r2. This recipe is created under meta-intel/common because
Intel DPDK can be commonly used several Intel BSP platforms such
as Romley, Crystal-Forest  Mohon-peak.

Signed-off-by: Chan Wei Sern wei.sern.c...@intel.com
---
 common/recipes-extended/dpdk/dpdk_1.6.0r2.bb | 205 +++
 1 file changed, 205 insertions(+)
 create mode 100644 common/recipes-extended/dpdk/dpdk_1.6.0r2.bb

diff --git a/common/recipes-extended/dpdk/dpdk_1.6.0r2.bb 
b/common/recipes-extended/dpdk/dpdk_1.6.0r2.bb
new file mode 100644
index 000..fb48207
--- /dev/null
+++ b/common/recipes-extended/dpdk/dpdk_1.6.0r2.bb
@@ -0,0 +1,205 @@
+DESCRIPTION = Intel(r) Data Plane Development Kit
+HOMEPAGE = http://dpdk.org;
+LICENSE = BSD  LGPLv2  GPLv2
+LIC_FILES_CHKSUM = file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe
+
+
+# Recipe Ingredients (source, patch, etc)
+SRC_URI = http://dpdk.org/browse/dpdk/snapshot/dpdk-${PV}.tar.gz;name=dpdk \
+  file://dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch \
+  
file://dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch \
+  file://dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch \
+  
+
+
+SRC_URI[dpdk.md5sum] = f406d027320fc8e724bff20db5397cbb
+SRC_URI[dpdk.sha256sum] = 
e72fdebcf8a899fc58e60c9b6493b7457576eece60b08dea6aee96c9087df4b2
+
+# Package Run-time dependency
+RDEPENDS_${PN} += python-subprocess
+
+S = ${WORKDIR}/dpdk-${PV}
+
+inherit module
+
+
+export MODULE_DIR=/lib/modules/${KERNEL_VERSION}/kernel/drivers/net
+export RTE_SDK = ${S}
+export RTE_TARGET=${TARGET_ARCH}-ivshmem-${TARGET_OS}app-gcc
+export ICP_ROOT = ${PKG_CONFIG_SYSROOT_DIR}/usr/include
+export ICP_LIB_ROOT= ${PKG_CONFIG_SYSROOT_DIR}/usr/lib
+export RTE_KERNELDIR = ${STAGING_KERNEL_DIR}
+export INSTALL_PATH = /opt/dpdk
+
+
+do_configure () {
+   #
+   ### default value for prefix is usr, unsetting it, so it
+   ### will not be concatenated in ${RTE_TARGET}/Makefile
+   ### which will cause compilation failure
+   #
+   unset prefix
+
+   make O=$RTE_TARGET T=$RTE_TARGET config
+
+}
+
+
+do_compile () {
+   unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
+
+   cd ${S}/${RTE_TARGET}
+   oe_runmake EXTRA_LDFLAGS= --sysroot=${PKG_CONFIG_SYSROOT_DIR} \
+  EXTRA_CFLAGS= --sysroot=${PKG_CONFIG_SYSROOT_DIR} \
+  CROSS=${TARGET_PREFIX} \
+  prefix=  LDFLAGS=  WERROR_FLAGS=-w V=1
+
+}
+
+
+do_compile_append () {
+
+   ###
+   ### Compilation for examples
+   ### Skip dpdk_qat due to it has dependency with qat source code
+   ### Skip vhost due to it has dependency to fuse libraries
+   ### Skip vhost_xen due to it has dependency to xen libraries
+   ###
+   for app in ${S}/examples/*
+   do
+
+   case `basename ${app}` in
+   dpdk_qat) continue
+;;
+   vhost) continue
+   ;;
+   vhost_xen) continue
+   ;;
+   esac
+
+   cd ${app}
+   oe_runmake CROSS=${TARGET_PREFIX}
+   done
+
+}
+
+
+do_install () {
+
+   #
+   ### Creating necessary folder under image directory
+   ### Those folders are to host compiled binary, scripts,
+   ### libraries.
+   #
+   install -m 0755 -d  ${D}/${INSTALL_PATH} \
+   ${D}/${INSTALL_PATH}/doc \
+   ${D}/${INSTALL_PATH}/tools \
+   ${D}/${INSTALL_PATH}/${RTE_TARGET} \
+   ${D}/${INSTALL_PATH}/${RTE_TARGET}/app \
+   ${D}/lib64 \
+   ${D}${includedir} \
+   ${D}${includedir}/arch \
+   ${D}${includedir}/exec-env \
+   ${D}${libdir} \
+   ${D}${MODULE_DIR}
+
+   install -m 0755 ${S}/${RTE_TARGET}/kmod/igb_uio.ko  
${D}${MODULE_DIR}/
+   install -m 0755 ${S}/${RTE_TARGET}/kmod/rte_kni.ko  
${D}${MODULE_DIR}/
+
+   install -m 640 ${S}/${RTE_TARGET}/lib/*.a   ${D}${libdir}
+
+   install -m 640 ${S}/${RTE_TARGET}/.config   
${D}/${INSTALL_PATH}/${RTE_TARGET}/
+   install -m 640 ${S}/${RTE_TARGET}/include/*.h   
${D}${includedir}/
+   install -m 640 

[meta-intel] [PATCH 3/3] meta-romley: add Intel DPDK v1.6.0r2 support Romley machine config

2014-07-08 Thread wei . sern . chan
From: Chan Wei Sern wei.sern.c...@intel.com

Added PREFERRED_PROVIDER and PREFERRED_VERSION for Intel DPDK.
Added MACHINE_EXTRA_RRECOMMENDS to include dpdk for romley machine
configuration so that building on Romley will automatically pick up
Intel DPDK. This is an initial version of Intel DPDK support in Romley
that is targetting version 1.6.0r2.

Signed-off-by: Chan Wei Sern wei.sern.c...@intel.com
---
 meta-romley/conf/machine/romley-ivb.conf | 6 +-
 meta-romley/conf/machine/romley.conf | 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta-romley/conf/machine/romley-ivb.conf 
b/meta-romley/conf/machine/romley-ivb.conf
index af52897..fc179dd 100644
--- a/meta-romley/conf/machine/romley-ivb.conf
+++ b/meta-romley/conf/machine/romley-ivb.conf
@@ -7,7 +7,8 @@
 #@DESCRIPTION: Machine configuration for Romley systems
 # i.e. Xeon E5-2600 and E5-2400 + Intel CC604/C602-J
 
-
+PREFERRED_PROVIDER_virtual/extended ?= dpdk
+PREFERRED_VERSION_dpdk ?= 1.6.0r2%
 PREFERRED_VERSION_linux-yocto ?= 3.10%
 
 require conf/machine/include/intel-corei7-64-common.inc
@@ -18,3 +19,6 @@ XSERVER ?= ${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
   ${XSERVER_X86_MATROX_MGA} \

+
+MACHINE_EXTRA_RRECOMMENDS += dpdk \
+  
diff --git a/meta-romley/conf/machine/romley.conf 
b/meta-romley/conf/machine/romley.conf
index ed52a1e..33be235 100644
--- a/meta-romley/conf/machine/romley.conf
+++ b/meta-romley/conf/machine/romley.conf
@@ -7,7 +7,8 @@
 #@DESCRIPTION: Machine configuration for Romley systems
 # i.e. Xeon E5-2600 and E5-2400 + Intel CC604/C602-J
 
-
+PREFERRED_PROVIDER_virtual/extended ?= dpdk
+PREFERRED_VERSION_dpdk ?= 1.6.0r2%
 PREFERRED_VERSION_linux-yocto ?= 3.10%
 
 require conf/machine/include/intel-corei7-64-common.inc
@@ -18,3 +19,6 @@ XSERVER ?= ${XSERVER_X86_BASE} \
${XSERVER_X86_EXT} \
   ${XSERVER_X86_MATROX_MGA} \

+
+MACHINE_EXTRA_RRECOMMENDS += dpdk \
+  
-- 
1.9.1

-- 
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


[meta-intel] [PATCH 2/3] meta-intel/common: fix Intel DPDK example apps build failure in v1.6.0-r2

2014-07-08 Thread wei . sern . chan
From: Chan Wei Sern wei.sern.c...@intel.com

Intel DPDK v1.6.0r2 examples, qos_sched, eal_flags_autotest and
cmdline_autotest have build failure in build. As above failures
are not planned to be fixed in v1.6.0r2, so we resolve them by
cherry-picking patches from v1.7.0 instead.

Signed-off-by: Chan Wei Sern wei.sern.c...@intel.com
---
 ...ix-build-switches-to-enable-cmdline-tests.patch | 49 ++
 ...dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch | 31 ++
 ...k-1.6.0r2-examples-qos_sched-fix-makefile.patch | 31 ++
 3 files changed, 111 insertions(+)
 create mode 100644 
common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch
 create mode 100644 
common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch
 create mode 100644 
common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch

diff --git 
a/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch
 
b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch
new file mode 100644
index 000..eab4776
--- /dev/null
+++ 
b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch
@@ -0,0 +1,49 @@
+From cf953d2bfa7df9aa67459b333db4d4d8a9e72fd6 Mon Sep 17 00:00:00 2001
+From: Thomas Monjalon thomas.monja...@6wind.com
+Date: Fri, 27 Jun 2014 11:21:11 +0200
+Subject: [PATCH] app/test: fix build switches to enable cmdline tests
+
+There were 2 typos since these commits (in 1.6.0 releases):
+   21a7f4e264 fix build without librte_cmdline
+   cac6d08c8b replace --use-device option by --pci-whitelist and --vdev
+In makefiles, the build options are prefixed with CONFIG_RTE_
+but in .c file, it is only RTE_.
+
+These typos were disabling cmdline unit tests and test of --vdev eth_ring 
option.
+
+Signed-off-by: Thomas Monjalon thomas.monja...@6wind.com
+Acked-by: Pablo de Lara pablo.de.lara.gua...@intel.com
+---
+ app/test/test_cmdline.c   | 2 +-
+ app/test/test_eal_flags.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c
+index 77475c4..10a3f77 100644
+--- a/app/test/test_cmdline.c
 b/app/test/test_cmdline.c
+@@ -39,7 +39,7 @@
+ int
+ test_cmdline(void)
+ {
+-#ifdef CONFIG_RTE_LIBRTE_CMDLINE
++#ifdef RTE_LIBRTE_CMDLINE
+   printf(Testind parsing ethernet addresses...\n);
+   if (test_parse_etheraddr_valid()  0)
+   return -1;
+diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
+index a862654..1b80b80 100644
+--- a/app/test/test_eal_flags.c
 b/app/test/test_eal_flags.c
+@@ -317,7 +317,7 @@ test_whitelist_flag(void)
+   const char *wlval3[] = {prgname, prefix, mp_flag, -n, 1, -c, 1,
+   pci_whitelist, 09:0B.3,type=test,
+   pci_whitelist, 08:00.1,type=normal,
+-#ifdef CONFIG_RTE_LIBRTE_PMD_RING
++#ifdef RTE_LIBRTE_PMD_RING
+   vdev, eth_ring,arg=test,
+ #endif
+   };
+-- 
+1.9.1
+
diff --git 
a/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch
 
b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch
new file mode 100644
index 000..971d0c5
--- /dev/null
+++ 
b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch
@@ -0,0 +1,31 @@
+From be1816f59e772e427fc5815281f9458a9314973a Mon Sep 17 00:00:00 2001
+From: Pablo de Lara pablo.de.lara.gua...@intel.com
+Date: Thu, 19 Jun 2014 16:35:22 +0100
+Subject: [PATCH] eal: fix option --base-virtaddr
+
+When parsing EAL option --base-virtaddr
+errno was not being set to 0 before calling strtoull,
+therefore function might fail unnecesarily.
+
+Signed-off-by: Pablo de Lara pablo.de.lara.gua...@intel.com
+Signed-off-by: Aaron Campbell aa...@arbor.net
+Acked-by: Anatoly Burakov anatoly.bura...@intel.com
+---
+ lib/librte_eal/linuxapp/eal/eal.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/librte_eal/linuxapp/eal/eal.c 
b/lib/librte_eal/linuxapp/eal/eal.c
+index 6994303..d204387 100644
+--- a/lib/librte_eal/linuxapp/eal/eal.c
 b/lib/librte_eal/linuxapp/eal/eal.c
+@@ -562,6 +562,7 @@ eal_parse_base_virtaddr(const char *arg)
+   char *end;
+   uint64_t addr;
+ 
++  errno = 0;
+   addr = strtoull(arg, end, 16);
+ 
+   /* check for errors */
+-- 
+1.9.1
+
diff --git 
a/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch
 
b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch
new file mode 100644
index 000..d6e499c
--- /dev/null
+++ 
b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch
@@ -0,0 +1,31 @@
+From ea9a59b26c3c86b498337e968ee8f68c4e263614 Mon Sep 17 00:00:00 2001
+From: Olivier Matz olivier.m...@6wind.com
+Date: Fri, 16 May 

Re: [meta-intel] [PATCH 1/3] meta-intel/common: Initial Intel DPDK recipe under recipes-extended

2014-07-08 Thread Burton, Ross
On 8 July 2014 08:00,  wei.sern.c...@intel.com wrote:
 +# Recipe Ingredients (source, patch, etc)
 +# Package Run-time dependency

No need to add comments explaining what variables are for.

 +S = ${WORKDIR}/dpdk-${PV}

This is the default, remove it.

 +export INSTALL_PATH = /opt/dpdk

Why does DPDK get installed into /opt, and why can't it be fully
installed into ${prefix}?

 +do_compile () {
 +   unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
 +
 +   cd ${S}/${RTE_TARGET}
 +   oe_runmake EXTRA_LDFLAGS= --sysroot=${PKG_CONFIG_SYSROOT_DIR} \
 +  EXTRA_CFLAGS= --sysroot=${PKG_CONFIG_SYSROOT_DIR} \

You don't want to use PKG_CONFIG_SYSROOT_DIR, as that's for use by
pkg-config.  Use $STAGING_DIR_HOST.

 +do_compile_append () {

Merge do_compile and do_compile_append.

 +   case `basename ${app}` in
 +   dpdk_qat) continue
 +;;
 +   vhost) continue
 +   ;;
 +   vhost_xen) continue
 +   ;;
 +   esac

That's a lot of code for a simple test.  Using | will let you do
multiple tests in a single case, or just use test.

 +   #
 +   ### Creating necessary folder under image directory
 +   ### Those folders are to host compiled binary, scripts,
 +   ### libraries.
 +   #

No need to explain something obvious, every do_install has to make the
directories it installs into.

 +do_install_append () {

Merge do_install and do_install_append.

 +   #Install test applications
 +   #Install example applications

More comments for obvious code.

 +# Split the DPDK ingredient into several packages defined by PACKAGES.
 +# Please refer to ${WORKDIR}/packages-split/
 +# Note: DPDK ingredient only goes into one of the split package
 +# Note: For kernel module built from DPDK, please don't include
 +# them in the following package as they go into kernel-module-* split
 +# package

Remove obvious comments.

 +FILES_${PN}-dbg +=  \
 +   ${INSTALL_PATH}/.debug \
 +   ${INSTALL_PATH}/doc \
 +   ${INSTALL_PATH}/${RTE_TARGET}/app/.debug \
 +   

Copy-paste error, putting documentation into the -dbg package?

 +FILES_${PN}-dev +=  \
 +   ${INSTALL_PATH}/${RTE_TARGET}/.config \
 +   ${includedir} \
 +   ${includedir}/arch \
 +   ${includedir}/exec-env \
 +   
 +
 +FILES_${PN} +=   ${INSTALL_PATH}/${RTE_TARGET}/app/ \
 +/lib64/ \
 +${INSTALL_PATH}/tools \
 +   

Hard-coded /lib64?

 +FILES_${PN}-staticdev += ${libdir}/*.a

This is the default, remove.

Ross
-- 
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel


Re: [meta-intel] [PATCH 3/3] meta-romley: add Intel DPDK v1.6.0r2 support Romley machine config

2014-07-08 Thread Burton, Ross
On 8 July 2014 08:00,  wei.sern.c...@intel.com wrote:
 +PREFERRED_PROVIDER_virtual/extended ?= dpdk

What does this do?

 +PREFERRED_VERSION_dpdk ?= 1.6.0r2%

There's only one version, so you don't need a preferred version.

Ross
-- 
___
meta-intel mailing list
meta-intel@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-intel