diff options
| author | Chan Wei Sern <wei.sern.chan@intel.com> | 2014-07-03 16:43:54 +0800 |
|---|---|---|
| committer | Tom Zanussi <tom.zanussi@intel.com> | 2014-07-17 15:18:30 -0500 |
| commit | c249763d3cb92bd06742b7986f08cf844ddb1d51 (patch) | |
| tree | cd58960f992fce86c081bb057fee5d63f656eb3e | |
| parent | fef1cbc31ce64d29dedd880274ae6c8a90e0b162 (diff) | |
| download | meta-intel-c249763d3cb92bd06742b7986f08cf844ddb1d51.tar.gz | |
meta-intel/common: Initial Intel DPDK recipe under recipes-extended
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.
Signed-off-by: Chan Wei Sern <wei.sern.chan@intel.com>
Acked-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
4 files changed, 288 insertions, 0 deletions
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 00000000..87d2ef77 --- /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 @@ | |||
| 1 | From cf953d2bfa7df9aa67459b333db4d4d8a9e72fd6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 3 | Date: Fri, 27 Jun 2014 11:21:11 +0200 | ||
| 4 | Subject: [PATCH] app/test: fix build switches to enable cmdline tests | ||
| 5 | |||
| 6 | Upstream-Status: backport | ||
| 7 | Imported patch from: http://dpdk.org/browse/dpdk/log/ | ||
| 8 | |||
| 9 | There were 2 typos since these commits (in 1.6.0 releases): | ||
| 10 | 21a7f4e264 fix build without librte_cmdline | ||
| 11 | cac6d08c8b replace --use-device option by --pci-whitelist and --vdev | ||
| 12 | In makefiles, the build options are prefixed with CONFIG_RTE_ | ||
| 13 | but in .c file, it is only RTE_. | ||
| 14 | |||
| 15 | These typos were disabling cmdline unit tests and test of "--vdev eth_ring" option. | ||
| 16 | |||
| 17 | Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 18 | Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 19 | Signed-off-by: Chan Wei Sern <wei.sern.chan@intel.com> | ||
| 20 | --- | ||
| 21 | app/test/test_cmdline.c | 2 +- | ||
| 22 | app/test/test_eal_flags.c | 2 +- | ||
| 23 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c | ||
| 26 | index 77475c4..10a3f77 100644 | ||
| 27 | --- a/app/test/test_cmdline.c | ||
| 28 | +++ b/app/test/test_cmdline.c | ||
| 29 | @@ -39,7 +39,7 @@ | ||
| 30 | int | ||
| 31 | test_cmdline(void) | ||
| 32 | { | ||
| 33 | -#ifdef CONFIG_RTE_LIBRTE_CMDLINE | ||
| 34 | +#ifdef RTE_LIBRTE_CMDLINE | ||
| 35 | printf("Testind parsing ethernet addresses...\n"); | ||
| 36 | if (test_parse_etheraddr_valid() < 0) | ||
| 37 | return -1; | ||
| 38 | diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c | ||
| 39 | index a862654..1b80b80 100644 | ||
| 40 | --- a/app/test/test_eal_flags.c | ||
| 41 | +++ b/app/test/test_eal_flags.c | ||
| 42 | @@ -317,7 +317,7 @@ test_whitelist_flag(void) | ||
| 43 | const char *wlval3[] = {prgname, prefix, mp_flag, "-n", "1", "-c", "1", | ||
| 44 | pci_whitelist, "09:0B.3,type=test", | ||
| 45 | pci_whitelist, "08:00.1,type=normal", | ||
| 46 | -#ifdef CONFIG_RTE_LIBRTE_PMD_RING | ||
| 47 | +#ifdef RTE_LIBRTE_PMD_RING | ||
| 48 | vdev, "eth_ring,arg=test", | ||
| 49 | #endif | ||
| 50 | }; | ||
| 51 | -- | ||
| 52 | 1.9.1 | ||
| 53 | |||
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 00000000..e724591e --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From be1816f59e772e427fc5815281f9458a9314973a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 3 | Date: Thu, 19 Jun 2014 16:35:22 +0100 | ||
| 4 | Subject: [PATCH] eal: fix option --base-virtaddr | ||
| 5 | |||
| 6 | Upstream-Status: backport | ||
| 7 | Imported patch from: http://dpdk.org/browse/dpdk/log/ | ||
| 8 | |||
| 9 | When parsing EAL option --base-virtaddr | ||
| 10 | errno was not being set to 0 before calling strtoull, | ||
| 11 | therefore function might fail unnecesarily. | ||
| 12 | |||
| 13 | Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 14 | Signed-off-by: Aaron Campbell <aaron@arbor.net> | ||
| 15 | Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> | ||
| 16 | Signed-off-by: Chan Wei Sern <wei.sern.chan@intel.com> | ||
| 17 | --- | ||
| 18 | lib/librte_eal/linuxapp/eal/eal.c | 1 + | ||
| 19 | 1 file changed, 1 insertion(+) | ||
| 20 | |||
| 21 | diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c | ||
| 22 | index 6994303..d204387 100644 | ||
| 23 | --- a/lib/librte_eal/linuxapp/eal/eal.c | ||
| 24 | +++ b/lib/librte_eal/linuxapp/eal/eal.c | ||
| 25 | @@ -562,6 +562,7 @@ eal_parse_base_virtaddr(const char *arg) | ||
| 26 | char *end; | ||
| 27 | uint64_t addr; | ||
| 28 | |||
| 29 | + errno = 0; | ||
| 30 | addr = strtoull(arg, &end, 16); | ||
| 31 | |||
| 32 | /* check for errors */ | ||
| 33 | -- | ||
| 34 | 1.9.1 | ||
| 35 | |||
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 00000000..47b5ece7 --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From ea9a59b26c3c86b498337e968ee8f68c4e263614 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Olivier Matz <olivier.matz@6wind.com> | ||
| 3 | Date: Fri, 16 May 2014 10:18:59 +0200 | ||
| 4 | Subject: [PATCH] examples/qos_sched: fix makefile | ||
| 5 | |||
| 6 | Upstream-Status: backport | ||
| 7 | Imported patch from: http://dpdk.org/browse/dpdk/log/ | ||
| 8 | |||
| 9 | The example does not compile as the linker complains about duplicated | ||
| 10 | symbols. | ||
| 11 | |||
| 12 | Remove -lsched from LDLIBS, it is already present in rte.app.mk and | ||
| 13 | added by the DPDK framework automatically. | ||
| 14 | |||
| 15 | Signed-off-by: Olivier Matz <olivier.matz@6wind.com> | ||
| 16 | Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 17 | Signed-off-by: Chan Wei Sern <wei.sern.chan@intel.com> | ||
| 18 | --- | ||
| 19 | examples/qos_sched/Makefile | 2 -- | ||
| 20 | 1 file changed, 2 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile | ||
| 23 | index b91fe37..9366efe 100755 | ||
| 24 | --- a/examples/qos_sched/Makefile | ||
| 25 | +++ b/examples/qos_sched/Makefile | ||
| 26 | @@ -54,6 +54,4 @@ CFLAGS += $(WERROR_FLAGS) | ||
| 27 | CFLAGS_args.o := -D_GNU_SOURCE | ||
| 28 | CFLAGS_cfg_file.o := -D_GNU_SOURCE | ||
| 29 | |||
| 30 | -LDLIBS += -lrte_sched | ||
| 31 | - | ||
| 32 | include $(RTE_SDK)/mk/rte.extapp.mk | ||
| 33 | -- | ||
| 34 | 1.9.1 | ||
| 35 | |||
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 00000000..cf06c4c5 --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk_1.6.0r2.bb | |||
| @@ -0,0 +1,165 @@ | |||
| 1 | DESCRIPTION = "Intel(r) Data Plane Development Kit" | ||
| 2 | HOMEPAGE = "http://dpdk.org" | ||
| 3 | LICENSE = "BSD & LGPLv2 & GPLv2" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe" | ||
| 5 | |||
| 6 | |||
| 7 | SRC_URI = "http://dpdk.org/browse/dpdk/snapshot/dpdk-${PV}.tar.gz;name=dpdk \ | ||
| 8 | file://dpdk-1.6.0r2-examples-qos_sched-fix-makefile.patch \ | ||
| 9 | file://dpdk-1.6.0r2-app-test-fix-build-switches-to-enable-cmdline-tests.patch \ | ||
| 10 | file://dpdk-1.6.0r2-eal-fix-option-base-virtaddr.patch \ | ||
| 11 | " | ||
| 12 | |||
| 13 | |||
| 14 | SRC_URI[dpdk.md5sum] = "f406d027320fc8e724bff20db5397cbb" | ||
| 15 | SRC_URI[dpdk.sha256sum] = "e72fdebcf8a899fc58e60c9b6493b7457576eece60b08dea6aee96c9087df4b2" | ||
| 16 | |||
| 17 | RDEPENDS_${PN} += "python-subprocess" | ||
| 18 | |||
| 19 | inherit module | ||
| 20 | |||
| 21 | export MODULE_DIR="/lib/modules/${KERNEL_VERSION}/kernel/drivers/net" | ||
| 22 | export RTE_SDK = "${S}" | ||
| 23 | export RTE_TARGET="${TARGET_ARCH}-ivshmem-${TARGET_OS}app-gcc" | ||
| 24 | export ICP_ROOT = "${PKG_CONFIG_SYSROOT_DIR}/usr/include" | ||
| 25 | export ICP_LIB_ROOT= "${PKG_CONFIG_SYSROOT_DIR}/usr/lib" | ||
| 26 | export RTE_KERNELDIR = "${STAGING_KERNEL_DIR}" | ||
| 27 | export INSTALL_PATH = "${prefix}/dpdk" | ||
| 28 | |||
| 29 | |||
| 30 | do_configure () { | ||
| 31 | ############################################################# | ||
| 32 | ### default value for prefix is "usr", unsetting it, so it | ||
| 33 | ### will not be concatenated in ${RTE_TARGET}/Makefile | ||
| 34 | ### which will cause compilation failure | ||
| 35 | ############################################################# | ||
| 36 | unset prefix | ||
| 37 | |||
| 38 | make O=$RTE_TARGET T=$RTE_TARGET config | ||
| 39 | |||
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | do_compile () { | ||
| 44 | unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS | ||
| 45 | |||
| 46 | cd ${S}/${RTE_TARGET} | ||
| 47 | oe_runmake EXTRA_LDFLAGS=" --sysroot=${STAGING_DIR_HOST}" \ | ||
| 48 | EXTRA_CFLAGS=" --sysroot=${STAGING_DIR_HOST}" \ | ||
| 49 | CROSS="${TARGET_PREFIX}" \ | ||
| 50 | prefix="" LDFLAGS="" WERROR_FLAGS="-w" V=1 | ||
| 51 | |||
| 52 | |||
| 53 | ################################################################### | ||
| 54 | ### Compilation for examples | ||
| 55 | ### Skip dpdk_qat due to it has dependency with qat source code | ||
| 56 | ### Skip vhost due to it has dependency to fuse libraries | ||
| 57 | ### Skip vhost_xen due to it has dependency to xen libraries | ||
| 58 | ################################################################### | ||
| 59 | for app in ${S}/examples/* | ||
| 60 | do | ||
| 61 | |||
| 62 | [ `basename ${app}` = "dpdk_qat" -o `basename ${app}` = "vhost" -o `basename ${app}` = "vhost_xen" ] && continue; | ||
| 63 | |||
| 64 | cd ${app} | ||
| 65 | oe_runmake CROSS="${TARGET_PREFIX}" | ||
| 66 | done | ||
| 67 | |||
| 68 | } | ||
| 69 | |||
| 70 | |||
| 71 | do_install () { | ||
| 72 | |||
| 73 | install -m 0755 -d ${D}/${INSTALL_PATH} \ | ||
| 74 | ${D}/${INSTALL_PATH}/doc \ | ||
| 75 | ${D}/${INSTALL_PATH}/tools \ | ||
| 76 | ${D}/${INSTALL_PATH}/${RTE_TARGET} \ | ||
| 77 | ${D}/${INSTALL_PATH}/${RTE_TARGET}/app \ | ||
| 78 | ${D}${includedir} \ | ||
| 79 | ${D}${includedir}/arch \ | ||
| 80 | ${D}${includedir}/exec-env \ | ||
| 81 | ${D}${libdir} \ | ||
| 82 | ${D}${MODULE_DIR} | ||
| 83 | |||
| 84 | install -m 0755 ${S}/${RTE_TARGET}/kmod/igb_uio.ko ${D}${MODULE_DIR}/ | ||
| 85 | install -m 0755 ${S}/${RTE_TARGET}/kmod/rte_kni.ko ${D}${MODULE_DIR}/ | ||
| 86 | |||
| 87 | install -m 640 ${S}/${RTE_TARGET}/lib/*.a ${D}${libdir} | ||
| 88 | |||
| 89 | install -m 640 ${S}/${RTE_TARGET}/.config ${D}/${INSTALL_PATH}/${RTE_TARGET}/ | ||
| 90 | install -m 640 ${S}/${RTE_TARGET}/include/*.h ${D}${includedir}/ | ||
| 91 | install -m 640 ${S}/${RTE_TARGET}/include/arch/* ${D}${includedir}/arch/ | ||
| 92 | install -m 640 ${S}/${RTE_TARGET}/include/exec-env/* ${D}${includedir}/exec-env/ | ||
| 93 | install -m 0755 ${S}/tools/igb_uio_bind.py ${D}/${INSTALL_PATH}/tools/ | ||
| 94 | install -m 0755 ${S}/tools/cpu_layout.py ${D}/${INSTALL_PATH}/tools/ | ||
| 95 | |||
| 96 | |||
| 97 | #Install test applications | ||
| 98 | install -m 0755 ${S}/${RTE_TARGET}/app/test ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 99 | install -m 0755 ${S}/${RTE_TARGET}/app/testpmd ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 100 | install -m 0755 ${S}/${RTE_TARGET}/app/dump_cfg ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 101 | install -m 0755 ${S}/${RTE_TARGET}/app/cmdline_test ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 102 | |||
| 103 | |||
| 104 | #Install example applications | ||
| 105 | for app in ${S}/examples/* | ||
| 106 | do | ||
| 107 | case `basename ${app}` in | ||
| 108 | "dpdk_qat" | "vhost" | "vhost_xen" ) continue | ||
| 109 | ;; | ||
| 110 | "l2fwd-ivshmem") | ||
| 111 | install -m 0755 ${app}/guest/build/app/guest ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 112 | install -m 0755 ${app}/host/build/app/host ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 113 | continue | ||
| 114 | ;; | ||
| 115 | "multi_process") | ||
| 116 | install -m 0755 ${app}/client_server_mp/mp_client/build/app/mp_client ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 117 | install -m 0755 ${app}/client_server_mp/mp_server/build/app/mp_server ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 118 | install -m 0755 ${app}/simple_mp/build/app/simple_mp ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 119 | install -m 0755 ${app}/symmetric_mp/build/app/symmetric_mp ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 120 | continue | ||
| 121 | ;; | ||
| 122 | "netmap_compat") | ||
| 123 | install -m 0755 ${app}/build/app/bridge ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 124 | continue | ||
| 125 | ;; | ||
| 126 | "quota_watermark") | ||
| 127 | install -m 0755 ${app}/qw/build/app/qw ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 128 | install -m 0755 ${app}/qwctl/build/app/qwctl ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 129 | continue | ||
| 130 | ;; | ||
| 131 | "vmdq") | ||
| 132 | install -m 0755 ${app}/build/app/`basename ${app}`_app ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 133 | continue | ||
| 134 | ;; | ||
| 135 | "vmdq_dcb") | ||
| 136 | install -m 0755 ${app}/build/app/`basename ${app}`_app ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 137 | continue | ||
| 138 | ;; | ||
| 139 | esac | ||
| 140 | |||
| 141 | install -m 0755 ${app}/build/app/`basename ${app}` ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | ||
| 142 | done | ||
| 143 | } | ||
| 144 | |||
| 145 | PACKAGES += "${PN}-examples" | ||
| 146 | |||
| 147 | FILES_${PN}-dbg += " \ | ||
| 148 | ${INSTALL_PATH}/.debug \ | ||
| 149 | ${INSTALL_PATH}/${RTE_TARGET}/app/.debug \ | ||
| 150 | " | ||
| 151 | |||
| 152 | FILES_${PN}-doc += "\ | ||
| 153 | ${INSTALL_PATH}/doc \ | ||
| 154 | " | ||
| 155 | |||
| 156 | FILES_${PN}-dev += " \ | ||
| 157 | ${INSTALL_PATH}/${RTE_TARGET}/.config \ | ||
| 158 | ${includedir} \ | ||
| 159 | ${includedir}/arch \ | ||
| 160 | ${includedir}/exec-env \ | ||
| 161 | " | ||
| 162 | |||
| 163 | FILES_${PN} += " ${INSTALL_PATH}/tools/ " | ||
| 164 | |||
| 165 | FILES_${PN}-examples += " ${INSTALL_PATH}/${RTE_TARGET}/app/ " | ||
