diff options
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 0000000000..ea36b1cd91 --- /dev/null +++ b/meta-networking/recipes-kernel/netmap/files/0001-testmmap-fix-compile-issue-with-gcc-5.x.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | From c81bf54d6eb870286662a11d3b4a994717c47696 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Armin Kuster <akuster808@gmail.com> | ||
| 5 | Date: Tue, 8 Sep 2015 05:36:27 -0700 | ||
| 6 | Subject: [PATCH] testmmap: fix compile issue with gcc 5.x | ||
| 7 | |||
| 8 | this fixes: | ||
| 9 | examples/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 | |||
| 13 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
| 14 | --- | ||
| 15 | examples/testmmap.c | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/examples/testmmap.c b/examples/testmmap.c | ||
| 19 | index 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 | -- | ||
| 32 | 2.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 0000000000..b050bf0011 --- /dev/null +++ b/meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | The makefile assumes building locally. | ||
| 2 | |||
| 3 | Upstream Status: Inappropriate [Native] | ||
| 4 | |||
| 5 | The configure is not auto-make based | ||
| 6 | |||
| 7 | Signed-of-by: Armin Kuster <akuster@mvista.com> | ||
| 8 | |||
| 9 | Index: 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 | |||
| 25 | Index: 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 0000000000..f9ac9ccda1 --- /dev/null +++ b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | require netmap.inc | ||
| 2 | |||
| 3 | DEPENDS = "virtual/kernel" | ||
| 4 | do_configure[depends] += "virtual/kernel:do_shared_workdir" | ||
| 5 | |||
| 6 | inherit module | ||
| 7 | |||
| 8 | CLEANBROKEN = "1" | ||
| 9 | |||
| 10 | export INSTALL_MOD_DIR="kernel/netmap-modules" | ||
| 11 | |||
| 12 | EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \ | ||
| 13 | --kernel-sources=${STAGING_KERNEL_DIR} \ | ||
| 14 | --install-mod-path=${D} \ | ||
| 15 | --driver-suffix="-netmap" \ | ||
| 16 | " | ||
| 17 | |||
| 18 | LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,-O1', '')}" | ||
| 19 | LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,--as-needed', '')}" | ||
| 20 | |||
| 21 | do_configure () { | ||
| 22 | cd ${S}/LINUX | ||
| 23 | ./configure ${EXTRA_OECONF} | ||
| 24 | } | ||
| 25 | |||
| 26 | do_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 | ||
| 46 | EOF | ||
| 47 | } | ||
| 48 | |||
| 49 | do_compile () { | ||
| 50 | cd ${S}/LINUX | ||
| 51 | oe_runmake | ||
| 52 | } | ||
| 53 | |||
| 54 | do_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 0000000000..ab33e765d4 --- /dev/null +++ b/meta-networking/recipes-kernel/netmap/netmap.inc | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | SUMMARY = "netmap and VALE - very fast packet I/O from userspace (FreeBSD/Linux)" | ||
| 2 | DESCRIPTION= "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." | ||
| 3 | SECTION = "networking" | ||
| 4 | HOMEPAGE = "http://code.google.com/p/netmap/" | ||
| 5 | LICENSE = "GPLv2+" | ||
| 6 | |||
| 7 | LIC_FILES_CHKSUM = "file://README;beginline=13;endline=14;md5=56ae0b9c7ba0476ab9098de94c2714d6" | ||
| 8 | |||
| 9 | SRCREV = "da9e19e69b84e4f6f8ae125f8d01b42a4abade6a" | ||
| 10 | PV = "master+git${SRCPV}" | ||
| 11 | |||
| 12 | SRC_URI = "git://github.com/luigirizzo/netmap.git" | ||
| 13 | SRC_URI += "file://makefile_fixup.patch" | ||
| 14 | |||
| 15 | S = "${WORKDIR}/git" | ||
| 16 | |||
| 17 | COMPATIBLE_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 0000000000..f15a626cba --- /dev/null +++ b/meta-networking/recipes-kernel/netmap/netmap_git.bb | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | require netmap.inc | ||
| 2 | |||
| 3 | DEPENDS = "netmap-modules" | ||
| 4 | |||
| 5 | EXTRA_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 | " | ||
| 14 | SRC_URI += "file://0001-testmmap-fix-compile-issue-with-gcc-5.x.patch" | ||
| 15 | |||
| 16 | do_fetch[depends] += "netmap-modules:do_fetch" | ||
| 17 | |||
| 18 | do_configure () { | ||
| 19 | cd ${S}/LINUX | ||
| 20 | ./configure ${EXTRA_OECONF} | ||
| 21 | } | ||
| 22 | |||
| 23 | do_compile () { | ||
| 24 | cd ${S}/LINUX | ||
| 25 | make apps | ||
| 26 | } | ||
| 27 | |||
| 28 | do_install () { | ||
| 29 | cd ${S}/LINUX | ||
| 30 | make install-apps DESTDIR=${D} | ||
| 31 | } | ||
| 32 | |||
| 33 | FILES_${PN} += "${bindir}" | ||
| 34 | RDEPENDS_${PN} = "kernel-module-netmap" | ||
| 35 | RRECOMMENDS_${PN} = "kernel-module-netmap" | ||
