1 DESCRIPTION = "Intel(r) Data Plane Development Kit"
2 HOMEPAGE = "http://dpdk.org"
8 SRC_URI = "git://dpdk.org/dpdk${STABLE};branch=${BRANCH} \
9 file://dpdk-16.04-add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
10 file://dpdk-16.07-add-sysroot-option-within-app-makefile.patch \
13 COMPATIBLE_MACHINE = "null"
14 COMPATIBLE_HOST_libc-musl_class-target = "null"
15 COMPATIBLE_HOST_linux-gnux32 = "null"
17 # dpdk example apps dpdk_qat and vhost have dependancy on fuse and qat.
18 # fuse is in meta-filesystems and qat is not yet upstreamed.
19 # So adding mechanism to explicitly disable the use of fuse and qat.
20 # To enable, uncomment the below line or include in .bbappend.
21 # PACKAGECONFIG ?= " dpdk_qat vhost libvirt"
23 PACKAGECONFIG[dpdk_qat] = ",,virtual/qat"
24 PACKAGECONFIG[vhost] = ",,fuse"
25 PACKAGECONFIG[libvirt] = ",,libvirt"
26 PACKAGECONFIG[numa] = ",,numactl"
28 export CONFIG_EXAMPLE_DPDK_QAT = "${@bb.utils.contains('PACKAGECONFIG', 'dpdk_qat', 'y', 'n', d)}"
29 export CONFIG_EXAMPLE_VM_POWER_MANAGER = "${@bb.utils.contains('PACKAGECONFIG', 'libvirt', 'y', 'n', d)}"
30 export CONFIG_VHOST_ENABLED = "${@bb.utils.contains('PACKAGECONFIG', 'vhost', 'y', 'n', d)}"
31 export CONFIG_HAVE_NUMA = "${@bb.utils.contains('PACKAGECONFIG', 'numa', 'y', 'n', d)}"
33 # Don't use the default value of datadir and let the dpdk set it to a dpdk
35 datadir[unexport] = "1"
37 RDEPENDS_${PN} += "python-subprocess"
38 DEPENDS = "virtual/kernel"
39 do_configure[depends] += "virtual/kernel:do_shared_workdir"
43 export MODULE_DIR="/lib/modules/${KERNEL_VERSION}/kernel/drivers/net"
44 export RTE_SDK = "${S}"
46 export ICP_ROOT = "${PKG_CONFIG_SYSROOT_DIR}/usr/include"
47 export ICP_LIB_ROOT= "${PKG_CONFIG_SYSROOT_DIR}/usr/lib"
48 export RTE_KERNELDIR = "${STAGING_KERNEL_DIR}"
49 export RTE_KERNELDIR_OUT = "${STAGING_KERNEL_BUILDDIR}"
50 export INSTALL_PATH = "${prefix}/share/dpdk"
51 export RTE_OUTPUT = "${S}/${RTE_TARGET}"
52 export ETHTOOL_LIB_PATH = "${S}/examples/ethtool/lib/${RTE_TARGET}/"
53 export SYSROOTPATH = "--sysroot=${STAGING_DIR_HOST}"
54 export DPDK_TARGET_MACH = "${@get_dpdk_target_mach(bb,d)}"
55 export ICP_LAC_API_DIR = "${STAGING_DIR_TARGET}${includedir}/lac"
57 export EXAMPLES_BUILD_DIR = "${RTE_TARGET}"
58 export ARCHDIR = "generic"
60 DPDK_RTE_TARGET_x86-64 = "x86_64-native-linuxapp-gcc"
61 DPDK_RTE_TARGET_x86 = "i686-native-linuxapp-gcc"
62 DPDK_RTE_TARGET_aarch64 = "arm64-${DPDK_TARGET_MACH}-linuxapp-gcc"
63 export RTE_TARGET = "${DPDK_RTE_TARGET}"
65 # The list of intel Comms platforms and their target machine
66 # process mapping. The supported target machine is listed under
68 def get_dpdk_target_mach(bb, d):
69 target_arch = d.getVar('DPDK_TARGET_MACHINE', True)
75 #############################################################
76 ### default value for prefix is "usr", unsetting it, so it
77 ### will not be concatenated in ${RTE_TARGET}/Makefile
78 ### which will cause compilation failure
79 #############################################################
82 # Fix-up CONFIG_RTE_MACHINE based on target machine
83 sed -e "s#CONFIG_RTE_MACHINE=\"native\"#CONFIG_RTE_MACHINE=\"${DPDK_TARGET_MACH}\"#" -i ${S}/config/defconfig_${RTE_TARGET}
85 # Fix-up vhost configs based on package config
86 sed -e "s#CONFIG_RTE_KNI_VHOST=n#CONFIG_RTE_KNI_VHOST=${CONFIG_VHOST_ENABLED}#" -i ${S}/config/common_linux
87 sed -e "s#CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n#CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=${CONFIG_VHOST_ENABLED}#" -i ${S}/config/common_linux
88 sed -e "s#CONFIG_RTE_LIBRTE_VHOST=n#CONFIG_RTE_LIBRTE_VHOST=${CONFIG_VHOST_ENABLED}#" -i ${S}/config/common_linux
89 sed -e "s#CONFIG_RTE_LIBRTE_VHOST_NUMA=.*#CONFIG_RTE_LIBRTE_VHOST_NUMA=${CONFIG_HAVE_NUMA}#" -i ${S}/config/common_linux
90 sed -e "s#CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=.*#CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=${CONFIG_HAVE_NUMA}#" -i ${S}/config/common_linux
92 # Fix-up CONFIG_RTE_LIBRTE_POWER based on package config for libvirt
93 sed -e "s#CONFIG_RTE_LIBRTE_POWER=y#CONFIG_RTE_LIBRTE_POWER=${CONFIG_EXAMPLE_VM_POWER_MANAGER}#" -i ${S}/config/common_linux
95 make O=$RTE_TARGET T=$RTE_TARGET config
99 unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
101 cd ${S}/${RTE_TARGET}
102 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" \
103 EXTRA_CFLAGS="${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -I${STAGING_INCDIR}" \
104 CROSS="${TARGET_PREFIX}" \
105 prefix="" LDFLAGS="${TUNE_LDARGS}" WERROR_FLAGS="-w" V=1
108 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu -fuse-ld=bfd" \
109 EXTRA_CFLAGS="${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -I${STAGING_INCDIR}" \
110 CROSS="${TARGET_PREFIX}" O="${S}/examples/$@/"
113 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu -fuse-ld=bfd" \
114 EXTRA_CFLAGS="${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -I${STAGING_INCDIR}" \
115 CROSS="${TARGET_PREFIX}" O="${S}/app/test/$@/"
119 oe_runmake O=${RTE_OUTPUT} T= install-runtime DESTDIR=${D}
120 oe_runmake O=${RTE_OUTPUT} T= install-kmod DESTDIR=${D} kerneldir=${MODULE_DIR}
121 oe_runmake O=${RTE_OUTPUT} T= install-sdk DESTDIR=${D}
124 for dirname in ${S}/examples/*
126 install -m 0755 -d ${D}/${INSTALL_PATH}/examples/`basename ${dirname}`
128 for appname in `find ${dirname} -regex ".*${EXAMPLES_BUILD_DIR}\/app\/[-0-9a-zA-Z0-9/_]*$"`
130 install -m 755 ${appname} ${D}/${INSTALL_PATH}/examples/`basename ${dirname}`/
135 for dirname in ${S}/app/test/app/*
137 install -m 0755 -d ${D}/${INSTALL_PATH}/test
139 for appname in `find ${dirname} -regex ".*test\/app\/[-0-9a-zA-Z0-9/_]*$"`
141 install -m 755 ${appname} ${D}/${INSTALL_PATH}/test
145 cp -r ${S}/mk ${D}${INSTALL_PATH}/
148 PACKAGES += "${PN}-examples ${PN}-test"
150 FILES_${PN}-dbg += " \
151 ${INSTALL_PATH}/.debug \
152 ${INSTALL_PATH}/examples/*/.debug \
155 FILES_${PN}-doc += "\
156 ${INSTALL_PATH}/doc \
159 FILES_${PN}-dev += " \
160 ${INSTALL_PATH}/${RTE_TARGET}/.config \
162 ${includedir}/${ARCHDIR} \
163 ${includedir}/exec-env \
164 ${INSTALL_PATH}/buildtools/ \
165 ${INSTALL_PATH}/${RTE_TARGET}/include \
166 ${INSTALL_PATH}/${RTE_TARGET}/lib \
170 FILES_${PN} += " ${INSTALL_PATH}/usertools/ \
175 FILES_${PN}-examples += " \
176 ${INSTALL_PATH}/examples/* \
179 FILES_${PN}-test += " \
180 ${INSTALL_PATH}/test \