summaryrefslogtreecommitdiffstats
path: root/recipes-extended/dpdk
diff options
context:
space:
mode:
authorTing Liu <ting.liu@nxp.com>2021-10-14 16:33:00 +0800
committerTing Liu <ting.liu@nxp.com>2021-10-15 22:11:36 +0800
commit08ede515232af9922dc4dc03828dbb9fd99dd310 (patch)
tree2391315f74395d654d77945c63fbc44a1c9882f2 /recipes-extended/dpdk
parentdc6ada8f9515e92bfdc7e5e2c18ccef87b6e80f8 (diff)
downloadmeta-freescale-08ede515232af9922dc4dc03828dbb9fd99dd310.tar.gz
dpdk: add 20.11 recipe
Signed-off-by: Ting Liu <ting.liu@nxp.com>
Diffstat (limited to 'recipes-extended/dpdk')
-rw-r--r--recipes-extended/dpdk/dpdk-20.11.inc15
-rw-r--r--recipes-extended/dpdk/dpdk-20.11/0001-Makefile-add-makefile.patch74
-rw-r--r--recipes-extended/dpdk/dpdk-20.11/0001-drivers-net-enetfec-enet_uio.c-fix-multiple-definiti.patch30
-rw-r--r--recipes-extended/dpdk/dpdk-20.11/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch35
-rw-r--r--recipes-extended/dpdk/dpdk-20.11/0001-meson.build-march-and-mcpu-already-passed-by-Yocto.patch38
-rw-r--r--recipes-extended/dpdk/dpdk-module_20.11.bb41
-rw-r--r--recipes-extended/dpdk/dpdk_20.11.bb93
7 files changed, 326 insertions, 0 deletions
diff --git a/recipes-extended/dpdk/dpdk-20.11.inc b/recipes-extended/dpdk/dpdk-20.11.inc
new file mode 100644
index 00000000..00aed60d
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-20.11.inc
@@ -0,0 +1,15 @@
1DESCRIPTION = "Data Plane Development Kit"
2HOMEPAGE = "http://dpdk.org"
3LICENSE = "BSD-3-Clause & LGPLv2.1 & GPLv2"
4LIC_FILES_CHKSUM = "file://license/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
5 file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \
6 file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444"
7
8SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/dpdk;nobranch=1"
9SRCREV = "f74b8bd5ab1c6ff76e956fc202a56aea2d200270"
10
11S = "${WORKDIR}/git"
12
13COMPATIBLE_MACHINE = "(qoriq-arm64)"
14
15CVE_PRODUCT = "data_plane_development_kit"
diff --git a/recipes-extended/dpdk/dpdk-20.11/0001-Makefile-add-makefile.patch b/recipes-extended/dpdk/dpdk-20.11/0001-Makefile-add-makefile.patch
new file mode 100644
index 00000000..18b75fb6
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-20.11/0001-Makefile-add-makefile.patch
@@ -0,0 +1,74 @@
1From 768cef60957d5e840071d1d6514d4add3f3c2904 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Wed, 14 Apr 2021 17:25:53 +0800
4Subject: [PATCH] Makefile: add makefile
5
6Current meson build for kernel module build does not fit in Yocto.
7So added Makefile to build rte_kni.ko
8
9Upstream-Status: Inappropriate
10
11Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
12---
13 kernel/linux/kni/Kbuild | 6 ------
14 kernel/linux/kni/Makefile | 35 +++++++++++++++++++++++++++++++++++
15 2 files changed, 35 insertions(+), 6 deletions(-)
16 delete mode 100644 kernel/linux/kni/Kbuild
17 create mode 100644 kernel/linux/kni/Makefile
18
19diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild
20deleted file mode 100644
21index e5452d6c00..0000000000
22--- a/kernel/linux/kni/Kbuild
23+++ /dev/null
24@@ -1,6 +0,0 @@
25-# SPDX-License-Identifier: BSD-3-Clause
26-# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
27-
28-ccflags-y := $(MODULE_CFLAGS)
29-obj-m := rte_kni.o
30-rte_kni-y := $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/*.c))
31diff --git a/kernel/linux/kni/Makefile b/kernel/linux/kni/Makefile
32new file mode 100644
33index 0000000000..19897ee06e
34--- /dev/null
35+++ b/kernel/linux/kni/Makefile
36@@ -0,0 +1,35 @@
37+#
38+# Makefile for building rte_kni.ko
39+#
40+MODULE_CFLAGS += -include $(S)/config/rte_config.h
41+MODULE_CFLAGS += -I$(S)/lib/librte_eal/include
42+MODULE_CFLAGS += -I$(S)/lib/librte_kni
43+MODULE_CFLAGS += -I$(S)/kernel/linux/kni
44+MODULE_CFLAGS += -I$(S)
45+MODULE_CFLAGS += -I$(STAGING_INCDIR)
46+
47+rte_kni-objs = kni_misc.o kni_net.o
48+
49+ccflags-y := $(MODULE_CFLAGS)
50+cflags-y := $(MODULE_CFLAGS)
51+obj-m := rte_kni.o
52+
53+
54+KERNEL_MAKE_OPTS := -C $(STAGING_KERNEL_DIR) M=$(CURDIR)
55+ifneq ($(ARCH),)
56+KERNEL_MAKE_OPTS += ARCH=$(ARCH)
57+endif
58+ifneq ($(CROSS_COMPILE),)
59+KERNEL_MAKE_OPTS += CROSS_COMPILE=$(CROSS_COMPILE)
60+endif
61+
62+build:
63+ $(MAKE) $(KERNEL_MAKE_OPTS) modules
64+
65+install: modules_install
66+
67+modules_install:
68+ $(MAKE) $(KERNEL_MAKE_OPTS) modules_install
69+
70+clean:
71+ $(MAKE) $(KERNEL_MAKE_OPTS) clean
72--
732.17.1
74
diff --git a/recipes-extended/dpdk/dpdk-20.11/0001-drivers-net-enetfec-enet_uio.c-fix-multiple-definiti.patch b/recipes-extended/dpdk/dpdk-20.11/0001-drivers-net-enetfec-enet_uio.c-fix-multiple-definiti.patch
new file mode 100644
index 00000000..f19b2b32
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-20.11/0001-drivers-net-enetfec-enet_uio.c-fix-multiple-definiti.patch
@@ -0,0 +1,30 @@
1From 6fe85f3a12d15e25345ef0547035a929351a179c Mon Sep 17 00:00:00 2001
2From: Ting Liu <ting.liu@nxp.com>
3Date: Fri, 17 Sep 2021 12:53:53 +0530
4Subject: [PATCH] drivers/net/enetfec/enet_uio.c: fix multiple definition
5
6.../drivers/net/enetfec/enet_uio.c:22: multiple definition of `count';
7.../examples/flow_classify/flow_classify.c:170: first defined here
8collect2: error: ld returned 1 exit status
9
10Signed-off-by: Ting Liu <ting.liu@nxp.com>
11---
12 drivers/net/enetfec/enet_uio.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/drivers/net/enetfec/enet_uio.c b/drivers/net/enetfec/enet_uio.c
16index b64dc522e8..9e09f9beb6 100644
17--- a/drivers/net/enetfec/enet_uio.c
18+++ b/drivers/net/enetfec/enet_uio.c
19@@ -19,7 +19,7 @@
20 #include "enet_uio.h"
21
22 static struct uio_job enetfec_uio_job;
23-int count;
24+static int count;
25
26 /** @brief Reads first line from a file.
27 * Composes file name as: root/subdir/filename
28--
292.25.1
30
diff --git a/recipes-extended/dpdk/dpdk-20.11/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch b/recipes-extended/dpdk/dpdk-20.11/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch
new file mode 100644
index 00000000..4df28c40
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-20.11/0001-ifpga-meson-Fix-finding-librt-using-find_library.patch
@@ -0,0 +1,35 @@
1From 308409d72671b7978b20d40748ad985a235b6c86 Mon Sep 17 00:00:00 2001
2From: Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com>
3Date: Thu, 24 Jun 2021 11:30:09 +0800
4Subject: [PATCH] ifpga/meson: Fix finding librt using find_library()
5
6Finding with "librt" keyword would give the output
7with full path of librt such as /usr/lib/librt.so
8instead of -lrt.
9
10Assume find_library() will prepend "lib", thus remove
11"lib" from "librt" keyword. The output will shows as
12-lrt.
13
14Upstream-Status: Submitted [https://mails.dpdk.org/archives/stable/2021-June/031840.html]
15
16Signed-off-by: Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com>
17---
18 drivers/raw/ifpga/base/meson.build | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/drivers/raw/ifpga/base/meson.build b/drivers/raw/ifpga/base/meson.build
22index da2d6e33c..949f7f127 100644
23--- a/drivers/raw/ifpga/base/meson.build
24+++ b/drivers/raw/ifpga/base/meson.build
25@@ -25,7 +25,7 @@ sources = [
26
27 rtdep = dependency('librt', required: false)
28 if not rtdep.found()
29- rtdep = cc.find_library('librt', required: false)
30+ rtdep = cc.find_library('rt', required: false)
31 endif
32 if not rtdep.found()
33 build = false
34--
352.32.0
diff --git a/recipes-extended/dpdk/dpdk-20.11/0001-meson.build-march-and-mcpu-already-passed-by-Yocto.patch b/recipes-extended/dpdk/dpdk-20.11/0001-meson.build-march-and-mcpu-already-passed-by-Yocto.patch
new file mode 100644
index 00000000..bef1f45b
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-20.11/0001-meson.build-march-and-mcpu-already-passed-by-Yocto.patch
@@ -0,0 +1,38 @@
1From cf8f15824dc2dd306d9c7e111641bef045d623c2 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Wed, 14 Apr 2021 16:03:10 +0800
4Subject: [PATCH] meson.build:-march and -mcpu already passed by Yocto
5
6Upstream-Status: Inappropriate
7
8Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
9---
10 config/meson.build | 12 ++++++------
11 1 file changed, 6 insertions(+), 6 deletions(-)
12
13diff --git a/config/meson.build b/config/meson.build
14index 2f150de3b8..41bb3e9ec4 100644
15--- a/config/meson.build
16+++ b/config/meson.build
17@@ -94,12 +94,12 @@ dpdk_conf.set('RTE_MACHINE', machine)
18 machine_args = []
19
20 # ppc64 does not support -march= at all, use -mcpu and -mtune for that
21-if host_machine.cpu_family().startswith('ppc')
22- machine_args += '-mcpu=' + machine
23- machine_args += '-mtune=' + machine
24-else
25- machine_args += '-march=' + machine
26-endif
27+#if host_machine.cpu_family().startswith('ppc')
28+# machine_args += '-mcpu=' + machine
29+# machine_args += '-mtune=' + machine
30+#else
31+# machine_args += '-march=' + machine
32+#endif
33
34 toolchain = cc.get_id()
35 dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
36--
372.17.1
38
diff --git a/recipes-extended/dpdk/dpdk-module_20.11.bb b/recipes-extended/dpdk/dpdk-module_20.11.bb
new file mode 100644
index 00000000..180b140b
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-module_20.11.bb
@@ -0,0 +1,41 @@
1include dpdk-20.11.inc
2
3FILESEXTRAPATHS:prepend := "${THISDIR}/dpdk-${PV}:"
4
5SRC_URI += " \
6 file://0001-Makefile-add-makefile.patch \
7"
8
9inherit module
10
11#kernel module needs 'rte_build_config.h', which is generated at buid time
12DEPENDS += "dpdk"
13
14export S
15export STAGING_KERNEL_DIR
16export STAGING_INCDIR
17export INSTALL_MOD_DIR="dpdk"
18
19do_configure[noexec] = "1"
20
21do_compile() {
22 cd ${S}/kernel/linux/kni
23 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
24 oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
25 KERNEL_VERSION=${KERNEL_VERSION} \
26 CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
27 AR="${KERNEL_AR}" \
28 O=${STAGING_KERNEL_BUILDDIR} \
29 KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" \
30 ${MAKE_TARGETS}
31}
32
33do_install() {
34 cd ${S}/kernel/linux/kni
35 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
36 oe_runmake DEPMOD=echo MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
37 INSTALL_FW_PATH="${D}${nonarch_base_libdir}/firmware" \
38 CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
39 O=${STAGING_KERNEL_BUILDDIR} \
40 ${MODULES_INSTALL_TARGET}
41}
diff --git a/recipes-extended/dpdk/dpdk_20.11.bb b/recipes-extended/dpdk/dpdk_20.11.bb
new file mode 100644
index 00000000..2d27adc5
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk_20.11.bb
@@ -0,0 +1,93 @@
1include dpdk-20.11.inc
2
3SRC_URI += " \
4 file://0001-meson.build-march-and-mcpu-already-passed-by-Yocto.patch \
5 file://0001-ifpga-meson-Fix-finding-librt-using-find_library.patch \
6 file://0001-drivers-net-enetfec-enet_uio.c-fix-multiple-definiti.patch \
7"
8
9MESON_BUILDTYPE = "release"
10
11# kernel module is provide by dpdk-module recipe, so disable here
12EXTRA_OEMESON = " -Denable_kmods=false \
13 -Dexamples=all \
14 -Doptimization=3 \
15"
16
17PACKAGECONFIG ??= "openssl"
18PACKAGECONFIG[afxdp] = ",,libbpf"
19PACKAGECONFIG[libvirt] = ",,libvirt"
20PACKAGECONFIG[openssl] = ",,openssl"
21
22RDEPENDS:${PN} += "bash pciutils python3-core"
23RDEPENDS:${PN}-examples += "bash"
24DEPENDS = "numactl"
25
26inherit meson
27
28INSTALL_PATH = "${prefix}/share/dpdk"
29
30do_configure:prepend() {
31 sed -i "/implementor_/d" ${WORKDIR}/meson.cross
32 sed -i "/\[properties]/aimplementor_id = 'dpaa'" ${WORKDIR}/meson.cross
33 sed -i "/\[properties]/aimplementor_pn = 'default'" ${WORKDIR}/meson.cross
34 sed -i "s/cpu =.*/cpu = 'armv8-a'/" ${WORKDIR}/meson.cross
35}
36
37do_install:append(){
38 # remove source files
39 rm -rf ${D}/${INSTALL_PATH}/examples/*
40
41 # Install examples
42 install -m 0755 -d ${D}/${INSTALL_PATH}/examples/
43 for dirname in ${B}/examples/dpdk-*
44 do
45 if [ ! -d ${dirname} ] && [ -x ${dirname} ]; then
46 install -m 0755 ${dirname} ${D}/${INSTALL_PATH}/examples/
47 fi
48 done
49 cp -rf ${S}/nxp/* ${D}/${INSTALL_PATH}/
50}
51
52PACKAGES =+ "${PN}-tools ${PN}-examples ${PN}-misc"
53
54FILES:${PN}-tools = " \
55 ${bindir}/dpdk-testpmd \
56 ${INSTALL_PATH}/examples/dpdk-l2fwd \
57 ${INSTALL_PATH}/examples/dpdk-l2fwd-crypto \
58 ${INSTALL_PATH}/examples/dpdk-l3fwd \
59 ${INSTALL_PATH}/examples/dpdk-ipsec-secgw \
60"
61
62FILES:${PN}-examples = " \
63 ${bindir}/dpdk-proc-info \
64 ${bindir}/dpdk-test \
65 ${bindir}/dpdk-test-crypto-perf \
66 ${bindir}/dpdk-*.py \
67 ${INSTALL_PATH}/examples/dpdk-cmdif \
68 ${INSTALL_PATH}/examples/dpdk-cmdline \
69 ${INSTALL_PATH}/examples/dpdk-ethtool \
70 ${INSTALL_PATH}/examples/dpdk-ip_fragmentation \
71 ${INSTALL_PATH}/examples/dpdk-ip_reassembly \
72 ${INSTALL_PATH}/examples/dpdk-kni \
73 ${INSTALL_PATH}/examples/dpdk-l2fwd-keepalive \
74 ${INSTALL_PATH}/examples/dpdk-l2fwd-qdma \
75 ${INSTALL_PATH}/examples/dpdk-l3fwd-acl \
76 ${INSTALL_PATH}/examples/dpdk-link_status_interrupt \
77 ${INSTALL_PATH}/examples/dpdk-mp_client \
78 ${INSTALL_PATH}/examples/dpdk-mp_server \
79 ${INSTALL_PATH}/examples/dpdk-qdma_demo \
80 ${INSTALL_PATH}/examples/dpdk-simple_mp \
81 ${INSTALL_PATH}/examples/dpdk-symmetric_mp \
82 ${INSTALL_PATH}/examples/dpdk-symmetric_mp_qdma \
83 ${INSTALL_PATH}/examples/dpdk-timer \
84"
85
86FILES:${PN}-misc = " \
87 ${bindir}/dpdk-pdump \
88 ${bindir}/dpdk-test-* \
89 ${bindir}/dpdk-*.py \
90 ${INSTALL_PATH}/examples/* \
91"
92
93INSANE_SKIP:${PN} = "dev-so"