summaryrefslogtreecommitdiffstats
path: root/recipes-networking/dpdk/dpdk_git.bb
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2014-06-26 11:48:23 (GMT)
committerAdrian Dudau <adrian.dudau@enea.com>2014-06-26 11:48:23 (GMT)
commit1b6242fc583a6b871304fb995af6dc211b58f69b (patch)
treeb5d434d90dedae24792906aa304897c23a134386 /recipes-networking/dpdk/dpdk_git.bb
downloadmeta-ip-1b6242fc583a6b871304fb995af6dc211b58f69b.tar.gz
initial commit for Enea Linux 4.0daisy-enea
Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'recipes-networking/dpdk/dpdk_git.bb')
-rw-r--r--recipes-networking/dpdk/dpdk_git.bb139
1 files changed, 139 insertions, 0 deletions
diff --git a/recipes-networking/dpdk/dpdk_git.bb b/recipes-networking/dpdk/dpdk_git.bb
new file mode 100644
index 0000000..ed4c2b3
--- /dev/null
+++ b/recipes-networking/dpdk/dpdk_git.bb
@@ -0,0 +1,139 @@
1SUMMARY = "DPDK"
2DESCRIPTION = "DPDK - a novel framework for fast packet I/O"
3HOMEPAGE = "http://dpdk.org"
4SECTION = "devel"
5LICENSE = "GPLv2 | LGPLv2 | BSD"
6LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe \
7 file://LICENSE.LGPL;md5=4fbd65380cdd255951079008b364516c \
8 file://lib/librte_eal/common/include/rte_version.h;beginline=1;endline=33;md5=ab6d502a4a25ded2bbabf031720bd1f4"
9
10PR = "r1"
11PV = "1.6.0"
12DEPENDS += "virtual/kernel"
13
14inherit module-base
15
16addtask make_scripts after do_patch before do_compile
17do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
18do_make_scripts[deptask] = "do_populate_sysroot"
19
20SRCREV = "v1.6.0r1"
21SRC_URI = "git://dpdk.org/git/dpdk;protocol=http;branch=1.6.0 \
22 file://unbreak-makefiles.patch \
23 file://runtest.patch \
24 file://run-ptest \
25 file://igb_ethdev_loopback.patch \
26 file://l2fwd-lpbk \
27 file://machine-flags.patch \
28 file://rte_kni_module_1_6.patch.x \
29 "
30
31DPDK_TARGET_DEFAULT = "${TARGET_ARCH}-default-linuxapp-gcc"
32DPDK_TARGET_IVSHMEM = "${TARGET_ARCH}-ivshmem-linuxapp-gcc"
33
34DPDK_BUILD_DIR = "build"
35DPDK_VAR_O = "${S}/${DPDK_BUILD_DIR}"
36DPDK_VAR_DESTDIR = "${WORKDIR}/install"
37
38DPDK_SRC_PATH = "/usr/src/dpdk"
39DPDK_INSTALL_PATH = "/opt/dpdk"
40
41S = "${WORKDIR}/git"
42B = "${S}"
43
44PACKAGES = "${PN}-dbg ${PN} ${PN}-mk ${PN}-scripts"
45PACKAGES += "${PN}-default-dbg ${PN}-default-staticdev ${PN}-default"
46
47RDEPENDS_${PN} += "pciutils"
48RDEPENDS_${PN}-default = "${PN}-mk ${PN}-scripts ${PN}-default-staticdev pciutils"
49RRECOMMENDS_${PN} += "kernel-module-uio kernel-module-pci-stub"
50
51FILES_${PN} = "${DPDK_SRC_PATH}"
52FILES_${PN}-dbg = "/usr/src/debug"
53FILES_${PN}-mk = "${DPDK_INSTALL_PATH}/mk"
54FILES_${PN}-scripts = "${DPDK_INSTALL_PATH}/scripts"
55
56FILES_${PN}-default = "${DPDK_INSTALL_PATH}/${TARGET_ARCH}-default-linuxapp-gcc"
57FILES_${PN}-default-dbg = "${DPDK_INSTALL_PATH}/${TARGET_ARCH}-default-linuxapp-gcc/app/.debug"
58FILES_${PN}-default-staticdev = "${DPDK_INSTALL_PATH}/${TARGET_ARCH}-default-linuxapp-gcc/lib"
59
60do_compile() {
61 cd ${S} && oe_runmake install \
62 RTE_KERNELDIR=${STAGING_KERNEL_DIR} \
63 RTE_MACHINE=default \
64 prefix="" \
65 V=1 KBUILD_VERBOSE=1 CROSS=${TARGET_SYS}- \
66 O=${DPDK_VAR_O} \
67 T=${DPDK_TARGET_DEFAULT} \
68 DESTDIR=${DPDK_VAR_DESTDIR} \
69 MACHINE_CFLAGS_ALT="${TARGET_CC_ARCH}"
70
71 #patched version of IVSHMEM target for OVS-DPDK - installed to staging only
72 cd ${S} && git apply ${WORKDIR}/rte_kni_module_1_6.patch.x && \
73 oe_runmake install \
74 RTE_KERNELDIR=${STAGING_KERNEL_DIR} \
75 RTE_MACHINE=default \
76 prefix="" \
77 V=1 KBUILD_VERBOSE=1 CROSS=${TARGET_SYS}- \
78 O=${DPDK_VAR_O} \
79 T=${DPDK_TARGET_IVSHMEM} \
80 DESTDIR=${DPDK_VAR_DESTDIR} \
81 MACHINE_CFLAGS_ALT="${TARGET_CC_ARCH}" \
82 EXTRA_CFLAGS=-fPIC && \
83 git apply --reverse ${WORKDIR}/rte_kni_module_1_6.patch.x \
84}
85
86do_install() {
87 # dpdk
88 install -d ${D}${DPDK_SRC_PATH}
89 cd ${S} && find . -depth -not -path "./${DPDK_BUILD_DIR}*" -not -path "./patches*" -not -path "./.*" -print0 |\
90 cpio --null -pdlu ${D}${DPDK_SRC_PATH}
91
92 # install sources to staging
93 cd ${S} && find . -depth -not -path "./${DPDK_BUILD_DIR}*" -not -path "./patches*" -not -path "./.*" -print0 |\
94 cpio --null -pdlu ${STAGING_DIR_HOST}${DPDK_SRC_PATH}
95
96 # install build to staging
97 cd ${DPDK_VAR_DESTDIR} && find . -print0 | cpio --null -pdlu ${STAGING_DIR_HOST}${DPDK_INSTALL_PATH}
98
99 # install build output - skip OVS-DPDK IVSHMEM
100 install -d ${D}${DPDK_INSTALL_PATH}
101 cd ${DPDK_VAR_DESTDIR} && find . -depth -not -path "./${DPDK_TARGET_IVSHMEM}*" -print0 |\
102 cpio --null -pdlu ${D}${DPDK_INSTALL_PATH}
103
104 # add "scripts" directory to build output and staging, relpath.sh is needed by makefiles
105 cp -r ${S}/scripts ${D}${DPDK_INSTALL_PATH}
106 cp -r ${S}/scripts ${STAGING_DIR_HOST}${DPDK_INSTALL_PATH}
107 # relpath.sh use of $prefix breaks openvswitch
108 sed -i 's/prefix/path_prefix/g' ${STAGING_DIR_HOST}${DPDK_INSTALL_PATH}/scripts/relpath.sh
109}
110
111COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux.*)'
112
113#test default target
114
115inherit ptest
116
117RDEPENDS_${PN}-ptest += "\
118 make \
119 python-pexpect \
120 ${PN}-default \
121 ${PN} \
122 "
123
124do_compile_ptest () {
125 cd ${WORKDIR}/l2fwd-lpbk && oe_runmake RTE_SDK="${DPDK_VAR_DESTDIR}" \
126 RTE_TARGET="${DPDK_TARGET_DEFAULT}" RTE_ARCH="${TARGET_ARCH}"
127 sed -i 's|RTE_SDK=.*|RTE_SDK=${DPDK_INSTALL_PATH}|g' ${WORKDIR}/run-ptest
128 sed -i 's|RTE_TARGET=.*|RTE_TARGET=${DPDK_TARGET_DEFAULT}|g' ${WORKDIR}/run-ptest
129 sed -i 's|RTE_ARCH=.*|RTE_ARCH=${TARGET_ARCH}|g' ${WORKDIR}/run-ptest
130}
131
132do_install_ptest () {
133 #install l2fwd loopback app
134 install ${WORKDIR}/l2fwd-lpbk/build/app/l2fwd-lpbk ${D}${PTEST_PATH}
135
136 #install original test file to be used by autotest.py
137 install ${DPDK_VAR_O}/${DPDK_TARGET_DEFAULT}/app/test ${D}${PTEST_PATH}
138}
139