netmap v2: add new package
PATCH 1/1 netmap v2: add new package
From: Armin Kuster <[email protected]>
this adds netmap, the fast packet I/O framework
http://info.iet.unipi.it/~luigi/netmap/
v2:
fix config opt typo
fix compile on non x86 targets
exclude ppc and arm from builds do to issues with kernel headers
--- .../netmap/files/makefile_fixup.patch | 79 ++++++++++++++++++++++ .../recipes-kernel/netmap/netmap-modules_git.bb | 51 ++++++++++++++ meta-networking/recipes-kernel/netmap/netmap.inc | 17 +++++ .../recipes-kernel/netmap/netmap_git.bb | 34 ++++++++++ 4 files changed, 181 insertions(+) create mode 100644 meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch create mode 100644 meta-networking/recipes-kernel/netmap/netmap-modules_git.bb create mode 100644 meta-networking/recipes-kernel/netmap/netmap.inc create mode 100644 meta-networking/recipes-kernel/netmap/netmap_git.bb
meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch new file +79 -0
@@ -0,0 +1,79 @@ +The makefile assumes building locally. + +Upstream Status: Inappropriate [Native] + +The configure is not auto-make based + +Signed-of-by: Armin Kuster <[email protected]> + +Index: LINUX/netmap.mak.in +=================================================================== +--- a/LINUX/netmap.mak.in ++++ b/LINUX/netmap.mak.in +@@ -12,10 +12,8 @@ SRCDIR:=@SRCDIR@ + # The following commands are needed to build the modules as out-of-tree, + # in fact the kernel sources path must be specified. + +-PWD ?= $(CURDIR) +- + # Additional compile flags (e.g. header location) +-EXTRA_CFLAGS := -I$(PWD) -I$(SRCDIR) -I$(SRCDIR)/../sys -I$(SRCDIR)/../sys/dev -DCONFIG_NETMAP ++EXTRA_CFLAGS := -I$(SRCDIR) -I$(SRCDIR)/../sys -I$(SRCDIR)/../sys/dev -DCONFIG_NETMAP + EXTRA_CFLAGS += -Wno-unused-but-set-variable + EXTRA_CFLAGS += $(foreach s,$(SUBSYS),-DCONFIG_NETMAP_$(shell echo $s|tr a-z A-Z)) + +Index: LINUX/configure +=================================================================== +--- a/LINUX/configure ++++ b/LINUX/configure +@@ -311,34 +311,6 @@ reset_tests() { + NEXTTEST=1 + } + +-# run_tests: run all accumulated tests and exec the pertinent +-# success/failure actions for each one. +-run_tests() { +- local t= # prevent -EOF to eat the make TAB +- cat > $TMPDIR/Makefile <<-EOF +- ifneq (\$(KERNELRELEASE),) +- obj-m := $TESTOBJS +- else +- S_DRIVERS := $(drv print) +- all: \$(S_DRIVERS:%=get-%) +- $t \$(MAKE) -C $ksrc M=\$\$PWD $kopts +- +- -include $TOPDIR/drivers.mak +- EOF +- for d in $(drv print); do +- cat >> $TMPDIR/Makefile <<-EOF +- get-$d: +- $t [ -z "\$($d-src)" ] || cp -Rp \$($d-src) \$(if \$($d-dst),\$($d-dst),.) +- EOF +- done +- echo endif >> $TMPDIR/Makefile +- ( +- cd $TMPDIR +- make -k -j $(grep -c processor /proc/cpuinfo) +- ) >> config.log +- eval "$TESTPOSTPROC" +-} +- + configh=netmap_linux_config.h + # succes/failure actions are expected to write some macros + # in netma_linux_config.h. The following functions can be +@@ -555,7 +527,6 @@ configuration. Please check 'config.log' + + reset_tests + add_test true broken_buildsystem < /dev/null +-run_tests + + drvname2config() { + local name=$1 +@@ -1087,7 +1058,6 @@ cat > $configh <<-EOF + EOF + + # the TESTPOSTPROC script will add macros to $configh +-run_tests + + define DRIVER_SUFFIX \"$drvsuffix\" +
meta-networking/recipes-kernel/netmap/netmap-modules_git.bb new file +51 -0
51 lines not on this page · raw message
meta-networking/recipes-kernel/netmap/netmap.inc new file +17 -0
@@ -0,0 +1,17 @@ +SUMMARY = "netmap and VALE - very fast packet I/O from userspace (FreeBSD/Linux)" +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." +SECTION = "networking" +HOMEPAGE = "http://code.google.com/p/netmap/" +LICENSE = "GPLv2+" + +LIC_FILES_CHKSUM = "file://README;beginline=13;endline=14;md5=f64f2b172fe6903ff7b6272c6edde588" + +SRCREV = "a14a35b839fe7ab6855f25f1e86e306ee7ad8123" +PV = "master+git${SRCPV}" + +SRC_URI = "git://github.com/luigirizzo/netmap.git" +SRC_URI += "file://makefile_fixup.patch" + +S = "${WORKDIR}/git" + +COMPATIBLE_HOST = '(x86_64|i.86|mips|arm).*-linux'
meta-networking/recipes-kernel/netmap/netmap_git.bb new file +34 -0
@@ -0,0 +1,34 @@ +require netmap.inc + +DEPENDS = "netmap-modules" + +EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \ + --kernel-sources=${STAGING_KERNEL_DIR} \ + --no-drivers \ + --disable-generic \ + --prefix=${prefix} \ + --destdir=${D} \ + --cc='${CC}' \ + --ld='${LD}' \ + " + +do_fetch[depends] += "netmap-modules:do_fetch" + +do_configure () { + cd ${S}/LINUX + ./configure ${EXTRA_OECONF} +} + +do_compile () { + cd ${S}/LINUX + make apps +} + +do_install () { + cd ${S}/LINUX + make install-apps DESTDIR=${D} +} + +FILES_${PN} += "${bindir}" +RDEPENDS_${PN} = "kernel-module-netmap" +RRECOMMENDS_${PN} = "kernel-module-netmap"
Signature · 1 line
2.3.5
Hey Armin,
Quoted 9 lines · [[meta-networking][PATCH] netmap v2: add new package] On 15.08.09 (Sun 05:38)…
From: Armin Kuster <[email protected]>
this adds netmap, the fast packet I/O framework
http://info.iet.unipi.it/~luigi/netmap/v2:
fix config opt typo
fix compile on non x86 targets
exclude ppc and arm from builds do to issues with kernel headers
I was working on merging this one and ran into a number of failures, can you take another look at it?
The first I hit was netmap-modules fails to find makefile_fixup.patch because it is referenced in netmap.inc which is included in netmap-modules_git.bb, but makefile_fixup.patch lives in netmap/ and that doesn't show up in the default search path. I tried moving netmap/ to files/ so it would always get picked up but hit another failure, so then I moved the makefile_fixup.patch reference to netmap_git.bb only (obviously I didn't spend any time looking at whether it makes sense to apply the patch to both recipes).
The failure I hit is actually in Martin's world build too. I grabbed one of the relevant chunks and put it on Pastebin for you
(http://pastebin.com/kjYShFD6) so you don't have to search through the whole log.
-J.
Quoted 218 lines
Signed-off-by Armin Kuster <[email protected]>--- .../netmap/files/makefile_fixup.patch | 79 ++++++++++++++++++++++ .../recipes-kernel/netmap/netmap-modules_git.bb | 51 ++++++++++++++ meta-networking/recipes-kernel/netmap/netmap.inc | 17 +++++ .../recipes-kernel/netmap/netmap_git.bb | 34 ++++++++++ 4 files changed, 181 insertions(+) create mode 100644 meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch create mode 100644 meta-networking/recipes-kernel/netmap/netmap-modules_git.bb create mode 100644 meta-networking/recipes-kernel/netmap/netmap.inc create mode 100644 meta-networking/recipes-kernel/netmap/netmap_git.bbmeta-networking/recipes-kernel/netmap/files/makefile_fixup.patch new file +79
-0@@ -0,0 +1,79 @@ +The makefile assumes building locally. + +Upstream Status: Inappropriate [Native] + +The configure is not auto-make based + +Signed-of-by: Armin Kuster <[email protected]> + +Index: LINUX/netmap.mak.in +=================================================================== +--- a/LINUX/netmap.mak.in ++++ b/LINUX/netmap.mak.in +@@ -12,10 +12,8 @@ SRCDIR:=@SRCDIR@ + # The following commands are needed to build the modules as out-of-tree, + # in fact the kernel sources path must be specified. + +-PWD ?= $(CURDIR) +- + # Additional compile flags (e.g. header location) +-EXTRA_CFLAGS := -I$(PWD) -I$(SRCDIR) -I$(SRCDIR)/../sys -I$(SRCDIR)/../sys/dev -DCONFIG_NETMAP ++EXTRA_CFLAGS := -I$(SRCDIR) -I$(SRCDIR)/../sys -I$(SRCDIR)/../sys/dev -DCONFIG_NETMAP + EXTRA_CFLAGS += -Wno-unused-but-set-variable + EXTRA_CFLAGS += $(foreach s,$(SUBSYS),-DCONFIG_NETMAP_$(shell echo $s|tr a-z A-Z)) + +Index: LINUX/configure +=================================================================== +--- a/LINUX/configure ++++ b/LINUX/configure +@@ -311,34 +311,6 @@ reset_tests() { + NEXTTEST=1 + } + +-# run_tests: run all accumulated tests and exec the pertinent +-# success/failure actions for each one. +-run_tests() { +- local t= # prevent -EOF to eat the make TAB +- cat > $TMPDIR/Makefile <<-EOF +- ifneq (\$(KERNELRELEASE),) +- obj-m := $TESTOBJS +- else +- S_DRIVERS := $(drv print) +- all: \$(S_DRIVERS:%=get-%) +- $t \$(MAKE) -C $ksrc M=\$\$PWD $kopts +- +- -include $TOPDIR/drivers.mak +- EOF +- for d in $(drv print); do +- cat >> $TMPDIR/Makefile <<-EOF +- get-$d: +- $t [ -z "\$($d-src)" ] || cp -Rp \$($d-src) \$(if \$($d-dst),\$($d-dst),.) +- EOF +- done +- echo endif >> $TMPDIR/Makefile +- ( +- cd $TMPDIR +- make -k -j $(grep -c processor /proc/cpuinfo) +- ) >> config.log +- eval "$TESTPOSTPROC" +-} +- + configh=netmap_linux_config.h + # succes/failure actions are expected to write some macros + # in netma_linux_config.h. The following functions can be +@@ -555,7 +527,6 @@ configuration. Please check 'config.log' + + reset_tests + add_test true broken_buildsystem < /dev/null +-run_tests + + drvname2config() { + local name=$1 +@@ -1087,7 +1058,6 @@ cat > $configh <<-EOF + EOF + + # the TESTPOSTPROC script will add macros to $configh +-run_tests + + define DRIVER_SUFFIX \"$drvsuffix\" +meta-networking/recipes-kernel/netmap/netmap-modules_git.bb new file +51
-0@@ -0,0 +1,51 @@ +require netmap.inc + +DEPENDS = "virtual/kernel" +do_configure[depends] += "virtual/kernel:do_shared_workdir" + +inherit module + +CLEANBROKEN = "1" + +export INSTALL_MOD_DIR="kernel/netmap-modules" + +EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \ + --kernel-sources=${STAGING_KERNEL_DIR} \ + --install-mod-path=${D} \ + --driver-suffix="-netmap" \ + " + +LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,-O1', '')}" +LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,--as-needed', '')}" + +do_configure () { + cd ${S}/LINUX + ./configure ${EXTRA_OECONF} +} + +do_configure_append () { + cat >> ${S}/LINUX/netmap_linux_config.h <<EOF +#define NETMAP_LINUX_HAVE_HRTIMER_MODE_REL +#define NETMAP_LINUX_HAVE_HRTIMER_FORWARD_NOW +#define NETMAP_LINUX_HAVE_PHYS_ADDR_T +#define NETMAP_LINUX_HAVE_ACCESS_ONCE +#define NETMAP_LINUX_HAVE_NETDEV_OPS +#define NETMAP_LINUX_ALLOC_NETDEV_4ARGS +#define NETMAP_LINUX_HAVE_INIT_NET +#define NETMAP_LINUX_HAVE_LIVE_ADDR_CHANGE +#define NETMAP_LINUX_HAVE_TX_SKB_SHARING +#define NETMAP_LINUX_HAVE_UNLOCKED_IOCTL +#define NETMAP_LINUX_HAVE_PERNET_OPS_ID +#define NETMAP_LINUX_TIMER_RTYPE static enum hrtimer_restart +EOF +} + +do_compile () { + cd ${S}/LINUX + oe_runmake +} + +do_install () { + cd ${S}/LINUX + oe_runmake install +}meta-networking/recipes-kernel/netmap/netmap.inc new file +17
-0@@ -0,0 +1,17 @@ +SUMMARY = "netmap and VALE - very fast packet I/O from userspace (FreeBSD/Linux)" +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." +SECTION = "networking" +HOMEPAGE = "http://code.google.com/p/netmap/" +LICENSE = "GPLv2+" + +LIC_FILES_CHKSUM = "file://README;beginline=13;endline=14;md5=f64f2b172fe6903ff7b6272c6edde588" + +SRCREV = "a14a35b839fe7ab6855f25f1e86e306ee7ad8123" +PV = "master+git${SRCPV}" + +SRC_URI = "git://github.com/luigirizzo/netmap.git" +SRC_URI += "file://makefile_fixup.patch" + +S = "${WORKDIR}/git" + +COMPATIBLE_HOST = '(x86_64|i.86|mips|arm).*-linux'meta-networking/recipes-kernel/netmap/netmap_git.bb new file +34
-0@@ -0,0 +1,34 @@ +require netmap.inc + +DEPENDS = "netmap-modules" + +EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \ + --kernel-sources=${STAGING_KERNEL_DIR} \ + --no-drivers \ + --disable-generic \ + --prefix=${prefix} \ + --destdir=${D} \ + --cc='${CC}' \ + --ld='${LD}' \ + " + +do_fetch[depends] += "netmap-modules:do_fetch" + +do_configure () { + cd ${S}/LINUX + ./configure ${EXTRA_OECONF} +} + +do_compile () { + cd ${S}/LINUX + make apps +} + +do_install () { + cd ${S}/LINUX + make install-apps DESTDIR=${D} +} + +FILES_${PN} += "${bindir}" +RDEPENDS_${PN} = "kernel-module-netmap" +RRECOMMENDS_${PN} = "kernel-module-netmap"
Signature · 2 lines
-Joe MacDonald. :wq