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

Chan, Wei Sern wei.sern.chan at intel.com
Wed Jul 16 07:50:00 PDT 2014


Hi Nitin,
This is an initial version that I've been working on last 2 weeks and they are customers waiting for it right now.
For DPDK 1.7 recipe is working in progress at the moment.

Thanks.
Regards,
Wei Sern.
> -----Original Message-----
> From: Kamble, Nitin A
> Sent: Wednesday, July 16, 2014 10:46 PM
> To: Chan, Wei Sern; meta-intel at yoctoproject.org
> Subject: RE: [meta-intel] [PATCHv3 1/2] meta-intel/common: Initial Intel
> DPDK recipe under recipes-extended
> 
> 
> 
> > -----Original Message-----
> > From: meta-intel-bounces at yoctoproject.org [mailto:meta-intel-
> > bounces at yoctoproject.org] On Behalf Of wei.sern.chan at intel.com
> > Sent: Wednesday, July 16, 2014 2:52 AM
> > To: meta-intel at yoctoproject.org
> > Subject: [meta-intel] [PATCHv3 1/2] meta-intel/common: Initial Intel
> > DPDK recipe under recipes-extended
> >
> > From: Chan Wei Sern <wei.sern.chan at 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. We resolved examples apps build failure
> > found in v1.6.0-r2 by cherry-picking patches from
> > v1.7.0 as they are not planned to be fixed in v1.6.0-r2. The example
> > app build failure are found in qos_sched, eal_flags_autotest and
> cmdline_autotest.
> 
> Hi Wei Sern,
>   Why not use v1.7.0 then?
> 
> Nitin
> 
> 
> >
> > Signed-off-by: Chan Wei Sern <wei.sern.chan at intel.com>
> > ---
> >  ...ix-build-switches-to-enable-cmdline-tests.patch |  53 +++++++
> > ...dpdk- 1.6.0r2-eal-fix-option-base-virtaddr.patch |  35 +++++
> > ...k-1.6.0r2-examples- qos_sched-fix-makefile.patch |  35 +++++
> >  common/recipes-extended/dpdk/dpdk_1.6.0r2.bb       | 166
> > +++++++++++++++++++++
> >  4 files changed, 289 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
> >  create mode 100644 common/recipes-extended/dpdk/dpdk_1.6.0r2.bb
> >
> > 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 0000000..87d2ef7
> > --- /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,53 @@
> > +From cf953d2bfa7df9aa67459b333db4d4d8a9e72fd6 Mon Sep 17 00:00:00
> > 2001
> > +From: Thomas Monjalon <thomas.monjalon at 6wind.com>
> > +Date: Fri, 27 Jun 2014 11:21:11 +0200
> > +Subject: [PATCH] app/test: fix build switches to enable cmdline tests
> > +
> > +Upstream-Status: backport
> > +Imported patch from: http://dpdk.org/browse/dpdk/log/
> > +
> > +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.monjalon at 6wind.com>
> > +Acked-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> > +Signed-off-by: Chan Wei Sern <wei.sern.chan at 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 0000000..e724591
> > --- /dev/null
> > +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-
> > base
> > +++ -virtaddr.patch
> > @@ -0,0 +1,35 @@
> > +From be1816f59e772e427fc5815281f9458a9314973a Mon Sep 17 00:00:00
> > 2001
> > +From: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> > +Date: Thu, 19 Jun 2014 16:35:22 +0100
> > +Subject: [PATCH] eal: fix option --base-virtaddr
> > +
> > +Upstream-Status: backport
> > +Imported patch from: http://dpdk.org/browse/dpdk/log/
> > +
> > +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.guarch at intel.com>
> > +Signed-off-by: Aaron Campbell <aaron at arbor.net>
> > +Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
> > +Signed-off-by: Chan Wei Sern <wei.sern.chan at 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 0000000..47b5ece
> > --- /dev/null
> > +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-
> > qos_sched-
> > +++ fix-makefile.patch
> > @@ -0,0 +1,35 @@
> > +From ea9a59b26c3c86b498337e968ee8f68c4e263614 Mon Sep 17 00:00:00
> > 2001
> > +From: Olivier Matz <olivier.matz at 6wind.com>
> > +Date: Fri, 16 May 2014 10:18:59 +0200
> > +Subject: [PATCH] examples/qos_sched: fix makefile
> > +
> > +Upstream-Status: backport
> > +Imported patch from: http://dpdk.org/browse/dpdk/log/
> > +
> > +The example does not compile as the linker complains about duplicated
> > +symbols.
> > +
> > +Remove -lsched from LDLIBS, it is already present in rte.app.mk and
> > +added by the DPDK framework automatically.
> > +
> > +Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
> > +Acked-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> > +Signed-off-by: Chan Wei Sern <wei.sern.chan at intel.com>
> > +---
> > + examples/qos_sched/Makefile | 2 --
> > + 1 file changed, 2 deletions(-)
> > +
> > +diff --git a/examples/qos_sched/Makefile
> > b/examples/qos_sched/Makefile
> > +index b91fe37..9366efe 100755
> > +--- a/examples/qos_sched/Makefile
> > ++++ b/examples/qos_sched/Makefile
> > +@@ -54,6 +54,4 @@ CFLAGS += $(WERROR_FLAGS)  CFLAGS_args.o :=
> > +-D_GNU_SOURCE  CFLAGS_cfg_file.o := -D_GNU_SOURCE
> > +
> > +-LDLIBS += -lrte_sched
> > +-
> > + include $(RTE_SDK)/mk/rte.extapp.mk
> > +--
> > +1.9.1
> > +
> > 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 0000000..62beb73
> > --- /dev/null
> > +++ b/common/recipes-extended/dpdk/dpdk_1.6.0r2.bb
> > @@ -0,0 +1,166 @@
> > +DESCRIPTION = "Intel(r) Data Plane Development Kit"
> > +HOMEPAGE = "http://dpdk.org"
> > +LICENSE = "BSD & LGPLv2 & GPLv2"
> > +LIC_FILES_CHKSUM =
> > "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe"
> > +
> > +
> > +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"
> > +
> > +RDEPENDS_${PN} += "python-subprocess"
> > +
> > +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 = "${prefix}/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=${STAGING_DIR_HOST}" \
> > +		   EXTRA_CFLAGS=" --sysroot=${STAGING_DIR_HOST}" \
> > +		   CROSS="${TARGET_PREFIX}" \
> > +		   prefix=""  LDFLAGS=""  WERROR_FLAGS="-w" V=1
> > +
> > +
> > +
> > 	####################################################
> > ###############
> > +	### 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
> > +
> > +		[ `basename ${app}` = "dpdk_qat" -o `basename ${app}` =
> > "vhost"  -o
> > +`basename ${app}` == "vhost_xen" ] && continue;
> > +
> > +		cd ${app}
> > +		oe_runmake CROSS="${TARGET_PREFIX}"
> > +	done
> > +
> > +}
> > +
> > +
> > +do_install () {
> > +
> > +	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}${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 ${S}/${RTE_TARGET}/include/arch/*
> > 	${D}${includedir}/arch/
> > +	install -m 640 ${S}/${RTE_TARGET}/include/exec-env/*
> > 	${D}${includedir}/exec-env/
> > +	install -m 0755 ${S}/tools/igb_uio_bind.py
> > 	${D}/${INSTALL_PATH}/tools/
> > +	install -m 0755 ${S}/tools/cpu_layout.py
> > 	${D}/${INSTALL_PATH}/tools/
> > +
> > +
> > +	#Install test applications
> > +	install -m 0755 ${S}/${RTE_TARGET}/app/test
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +	install -m 0755 ${S}/${RTE_TARGET}/app/testpmd
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +	install -m 0755 ${S}/${RTE_TARGET}/app/dump_cfg
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +	install -m 0755 ${S}/${RTE_TARGET}/app/cmdline_test
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +
> > +
> > +	#Install example applications
> > +	for app in ${S}/examples/*
> > +	do
> > +		case `basename ${app}` in
> > +		"dpdk_qat" | "vhost" | "vhost_xen" ) continue
> > +		;;
> > +		"l2fwd-ivshmem")
> > +		install -m 0755 ${app}/guest/build/app/guest
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		install -m 0755 ${app}/host/build/app/host
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		continue
> > +		;;
> > +		"multi_process")
> > +		install -m 0755
> > ${app}/client_server_mp/mp_client/build/app/mp_client
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		install -m 0755
> > ${app}/client_server_mp/mp_server/build/app/mp_server
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		install -m 0755 ${app}/simple_mp/build/app/simple_mp
> > 			${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		install -m 0755
> > ${app}/symmetric_mp/build/app/symmetric_mp
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		continue
> > +		;;
> > +		"netmap_compat")
> > +		install -m 0755 ${app}/build/app/bridge
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		continue
> > +		;;
> > +		"quota_watermark")
> > +		install -m 0755 ${app}/qw/build/app/qw
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		install -m 0755 ${app}/qwctl/build/app/qwctl
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		continue
> > +		;;
> > +		"vmdq")
> > +		install -m 0755 ${app}/build/app/`basename ${app}`_app
> > 		${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		continue
> > +		;;
> > +		"vmdq_dcb")
> > +		install -m 0755 ${app}/build/app/`basename ${app}`_app
> > 		${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +		continue
> > +		;;
> > +		esac
> > +
> > +		install -m 0755 ${app}/build/app/`basename ${app}`
> > 	${D}/${INSTALL_PATH}/${RTE_TARGET}/app
> > +	done
> > +}
> > +
> > +
> > +FILES_${PN}-dbg += " \
> > +	${INSTALL_PATH}/.debug \
> > +	${INSTALL_PATH}/${RTE_TARGET}/app/.debug \
> > +	"
> > +
> > +
> > +FILES_${PN}-doc += "\
> > +	${INSTALL_PATH}/doc \
> > +	"
> > +
> > +
> > +FILES_${PN}-dev += " \
> > +	${INSTALL_PATH}/${RTE_TARGET}/.config \
> > +	${includedir} \
> > +	${includedir}/arch \
> > +	${includedir}/exec-env \
> > +	"
> > +
> > +FILES_${PN} +=  " ${INSTALL_PATH}/${RTE_TARGET}/app/ \
> > +		  ${INSTALL_PATH}/tools \
> > +		"
> > --
> > 1.9.1
> >
> > --
> > _______________________________________________
> > meta-intel mailing list
> > meta-intel at yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/meta-intel


More information about the meta-intel mailing list