summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-kernel
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2015-08-09 05:38:30 +0530
committerJoe MacDonald <joe_macdonald@mentor.com>2015-09-15 10:49:30 -0400
commit1692d5c3020434404fc1ee6911a60b88287a5efb (patch)
treec705c4f059c63ff69d06da14a2a8d6800db90190 /meta-networking/recipes-kernel
parent1624ca2f9f94a0b9eb76a1d37d5984d6efdda695 (diff)
downloadmeta-openembedded-1692d5c3020434404fc1ee6911a60b88287a5efb.tar.gz
netmap: add new package
this adds netmap, the fast packet I/O framework http://info.iet.unipi.it/~luigi/netmap/ - updated to latest version to get kernel 4.1 support - fixed printf type issue - Fixed manual config options Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-kernel')
-rw-r--r--meta-networking/recipes-kernel/netmap/files/0001-testmmap-fix-compile-issue-with-gcc-5.x.patch33
-rw-r--r--meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch97
-rw-r--r--meta-networking/recipes-kernel/netmap/netmap-modules_git.bb57
-rw-r--r--meta-networking/recipes-kernel/netmap/netmap.inc17
-rw-r--r--meta-networking/recipes-kernel/netmap/netmap_git.bb35
5 files changed, 239 insertions, 0 deletions
diff --git a/meta-networking/recipes-kernel/netmap/files/0001-testmmap-fix-compile-issue-with-gcc-5.x.patch b/meta-networking/recipes-kernel/netmap/files/0001-testmmap-fix-compile-issue-with-gcc-5.x.patch
new file mode 100644
index 000000000..ea36b1cd9
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/files/0001-testmmap-fix-compile-issue-with-gcc-5.x.patch
@@ -0,0 +1,33 @@
1Upstream-Status: Pending
2
3From c81bf54d6eb870286662a11d3b4a994717c47696 Mon Sep 17 00:00:00 2001
4From: Armin Kuster <akuster808@gmail.com>
5Date: Tue, 8 Sep 2015 05:36:27 -0700
6Subject: [PATCH] testmmap: fix compile issue with gcc 5.x
7
8this fixes:
9examples/testmmap.c:540:10: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t {aka const int}' [-Werror=format=]
10| printf("ring_ofs[%d] %ld\n", i, nifp->ring_ofs[i]);
11| ^
12
13Signed-off-by: Armin Kuster <akuster808@gmail.com>
14---
15 examples/testmmap.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/examples/testmmap.c b/examples/testmmap.c
19index d7f6acc..934489a 100644
20--- a/examples/testmmap.c
21+++ b/examples/testmmap.c
22@@ -537,7 +537,7 @@ do_if()
23 for (i = 0; i < 5; i++)
24 printf("spare1[%d] %u\n", i, nifp->ni_spare1[i]);
25 for (i = 0; i < (nifp->ni_tx_rings + nifp->ni_rx_rings + 2); i++)
26- printf("ring_ofs[%d] %ld\n", i, nifp->ring_ofs[i]);
27+ printf("ring_ofs[%d] %zd\n", i, nifp->ring_ofs[i]);
28 }
29
30 struct netmap_ring *
31--
322.3.5
33
diff --git a/meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch b/meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch
new file mode 100644
index 000000000..b050bf001
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch
@@ -0,0 +1,97 @@
1The makefile assumes building locally.
2
3Upstream Status: Inappropriate [Native]
4
5The configure is not auto-make based
6
7Signed-of-by: Armin Kuster <akuster@mvista.com>
8
9Index: LINUX/netmap.mak.in
10===================================================================
11--- a/LINUX/netmap.mak.in
12+++ b/LINUX/netmap.mak.in
13@@ -12,10 +12,9 @@ SRCDIR:=@SRCDIR@
14 # The following commands are needed to build the modules as out-of-tree,
15 # in fact the kernel sources path must be specified.
16
17-PWD ?= $(CURDIR)
18
19 # Additional compile flags (e.g. header location)
20-EXTRA_CFLAGS := -I$(PWD) -I$(SRCDIR) -I$(SRCDIR)/../sys -I$(SRCDIR)/../sys/dev -DCONFIG_NETMAP
21+EXTRA_CFLAGS := -I$(SRCDIR) -I$(SRCDIR)/../sys -I$(SRCDIR)/../sys/dev -DCONFIG_NETMAP
22 EXTRA_CFLAGS += -Wno-unused-but-set-variable
23 EXTRA_CFLAGS += $(foreach s,$(SUBSYS),-DCONFIG_NETMAP_$(shell echo $s|tr a-z- A-Z_))
24
25Index: LINUX/configure
26===================================================================
27--- a/LINUX/configure
28+++ b/LINUX/configure
29@@ -349,52 +349,6 @@ reset_tests() {
30 EOF
31 }
32
33-# run_tests: run all accumulated tests and exec the pertinent
34-# success/failure actions for each one.
35-run_tests() {
36- local t= # prevent -EOF to eat the make TAB
37- cat > $TMPDIR/Makefile <<-EOF
38- ifneq (\$(KERNELRELEASE),)
39- obj-m := $TESTOBJS
40- else
41- S_DRIVERS := $(drv print)
42- all: \$(S_DRIVERS:%=get-%)
43- $t \$(MAKE) -C $ksrc M=\$\$PWD $kopts
44-
45- -include $TOPDIR/drivers.mak
46- EOF
47- for d in $(drv print); do
48- cat >> $TMPDIR/Makefile <<-EOF
49- get-$d:
50- $t [ -z "\$($d-src)" ] || cp -Rp \$($d-src) \$(if \$($d-dst),\$($d-dst),.)
51- $t touch get-$d
52- EOF
53- done
54- echo endif >> $TMPDIR/Makefile
55- {
56- cat <<-EOF
57-##############################################################################
58-## BEGIN RUNNING TESTS: $(date)
59-##############################################################################
60-## Makefile:
61- EOF
62- cat $TMPDIR/Makefile
63- cat <<-EOF
64-##############################################################################
65- EOF
66- } >> config.log
67- (
68- cd $TMPDIR
69- make -k -j $(grep -c processor /proc/cpuinfo)
70- ) >> config.log
71- eval "$TESTPOSTPROC"
72- cat >> config.log <<-EOF
73-##############################################################################
74-## END RUNNING TESTS: $(date)
75-##############################################################################
76- EOF
77-}
78-
79 configh=netmap_linux_config.h
80 # succes/failure actions are expected to write some macros
81 # in netma_linux_config.h. The following functions can be
82@@ -619,7 +573,6 @@ configuration. Please check 'config.log'
83 reset_tests
84 rm -f drivers.mak
85 add_test true broken_buildsystem < /dev/null
86-run_tests
87
88 drvname2config() {
89 local name=$1
90@@ -1280,7 +1233,6 @@ cat > $configh <<-EOF
91 EOF
92
93 # the TESTPOSTPROC script will add macros to $configh
94-run_tests
95
96 define DRIVER_SUFFIX \"$drvsuffix\"
97
diff --git a/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
new file mode 100644
index 000000000..f9ac9ccda
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
@@ -0,0 +1,57 @@
1require netmap.inc
2
3DEPENDS = "virtual/kernel"
4do_configure[depends] += "virtual/kernel:do_shared_workdir"
5
6inherit module
7
8CLEANBROKEN = "1"
9
10export INSTALL_MOD_DIR="kernel/netmap-modules"
11
12EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \
13 --kernel-sources=${STAGING_KERNEL_DIR} \
14 --install-mod-path=${D} \
15 --driver-suffix="-netmap" \
16 "
17
18LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,-O1', '')}"
19LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,--as-needed', '')}"
20
21do_configure () {
22 cd ${S}/LINUX
23 ./configure ${EXTRA_OECONF}
24}
25
26do_configure_append () {
27 cat >> ${S}/LINUX/netmap_linux_config.h <<EOF
28#define NETMAP_LINUX_HAVE_HRTIMER_MODE_REL
29#define NETMAP_LINUX_HAVE_HRTIMER_FORWARD_NOW
30#define NETMAP_LINUX_HAVE_PHYS_ADDR_T
31#define NETMAP_LINUX_HAVE_ACCESS_ONCE
32#define NETMAP_LINUX_HAVE_NETDEV_OPS
33#define NETMAP_LINUX_ALLOC_NETDEV_4ARGS
34#define NETMAP_LINUX_HAVE_INIT_NET
35#define NETMAP_LINUX_HAVE_LIVE_ADDR_CHANGE
36#define NETMAP_LINUX_HAVE_TX_SKB_SHARING
37#define NETMAP_LINUX_HAVE_UNLOCKED_IOCTL
38#define NETMAP_LINUX_HAVE_PERNET_OPS_ID
39#define NETMAP_LINUX_VIRTIO_FUNCTIONS
40#define NETMAP_LINUX_VIRTIO_FREE_PAGES
41#define NETMAP_LINUX_VIRTIO_GET_VRSIZE
42#define NETMAP_LINUX_TIMER_RTYPE enum hrtimer_restart
43#define NETMAP_LINUX_VIRTIO_MULTI_QUEUE
44#define NETMAP_LINUX_HAVE_E1000E_EXT_RXDESC
45#define NETMAP_LINUX_HAVE_E1000E_DOWN2
46EOF
47}
48
49do_compile () {
50 cd ${S}/LINUX
51 oe_runmake
52}
53
54do_install () {
55 cd ${S}/LINUX
56 oe_runmake install
57}
diff --git a/meta-networking/recipes-kernel/netmap/netmap.inc b/meta-networking/recipes-kernel/netmap/netmap.inc
new file mode 100644
index 000000000..ab33e765d
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/netmap.inc
@@ -0,0 +1,17 @@
1SUMMARY = "netmap and VALE - very fast packet I/O from userspace (FreeBSD/Linux)"
2DESCRIPTION= "NETMAP is a framework for very fast packet I/O from userspace. VALE is an equally fast in-kernel software switch using the netmap API. Both are implemented as a single kernel module for FreeBSD and Linux, and can deal with line rate on real or emulated 10 Gbit ports."
3SECTION = "networking"
4HOMEPAGE = "http://code.google.com/p/netmap/"
5LICENSE = "GPLv2+"
6
7LIC_FILES_CHKSUM = "file://README;beginline=13;endline=14;md5=56ae0b9c7ba0476ab9098de94c2714d6"
8
9SRCREV = "da9e19e69b84e4f6f8ae125f8d01b42a4abade6a"
10PV = "master+git${SRCPV}"
11
12SRC_URI = "git://github.com/luigirizzo/netmap.git"
13SRC_URI += "file://makefile_fixup.patch"
14
15S = "${WORKDIR}/git"
16
17COMPATIBLE_HOST = '(x86_64|i.86|mips|arm).*-linux'
diff --git a/meta-networking/recipes-kernel/netmap/netmap_git.bb b/meta-networking/recipes-kernel/netmap/netmap_git.bb
new file mode 100644
index 000000000..f15a626cb
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/netmap_git.bb
@@ -0,0 +1,35 @@
1require netmap.inc
2
3DEPENDS = "netmap-modules"
4
5EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \
6 --kernel-sources=${STAGING_KERNEL_DIR} \
7 --no-drivers \
8 --disable-generic \
9 --prefix=${prefix} \
10 --destdir=${D} \
11 --cc='${CC}' \
12 --ld='${LD}' \
13 "
14SRC_URI += "file://0001-testmmap-fix-compile-issue-with-gcc-5.x.patch"
15
16do_fetch[depends] += "netmap-modules:do_fetch"
17
18do_configure () {
19 cd ${S}/LINUX
20 ./configure ${EXTRA_OECONF}
21}
22
23do_compile () {
24 cd ${S}/LINUX
25 make apps
26}
27
28do_install () {
29 cd ${S}/LINUX
30 make install-apps DESTDIR=${D}
31}
32
33FILES_${PN} += "${bindir}"
34RDEPENDS_${PN} = "kernel-module-netmap"
35RRECOMMENDS_${PN} = "kernel-module-netmap"