All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH] netmap v2: add new package
@ 2015-08-09  0:08 Armin Kuster
  2015-08-20  0:41 ` Joe MacDonald
  0 siblings, 1 reply; 2+ messages in thread
From: Armin Kuster @ 2015-08-09  0:08 UTC (permalink / raw)
  To: openembedded-devel, joe_macdonald; +Cc: Armin Kuster

From: Armin Kuster <akuster@mvista.com>

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

Signed-off-by: Armin Kuster <akuster@mvista.com>
---
 .../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

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 0000000..e838653
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch
@@ -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 <akuster@mvista.com>
+
+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\"
+ 
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 0000000..00d334f
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
@@ -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
+}
diff --git a/meta-networking/recipes-kernel/netmap/netmap.inc b/meta-networking/recipes-kernel/netmap/netmap.inc
new file mode 100644
index 0000000..9083c69
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/netmap.inc
@@ -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'
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 0000000..0ee19d4
--- /dev/null
+++ b/meta-networking/recipes-kernel/netmap/netmap_git.bb
@@ -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"
-- 
2.3.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-networking][PATCH] netmap v2: add new package
  2015-08-09  0:08 [meta-networking][PATCH] netmap v2: add new package Armin Kuster
@ 2015-08-20  0:41 ` Joe MacDonald
  0 siblings, 0 replies; 2+ messages in thread
From: Joe MacDonald @ 2015-08-20  0:41 UTC (permalink / raw)
  To: Armin Kuster; +Cc: Armin Kuster, openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 8931 bytes --]

Hey Armin,

[[meta-networking][PATCH] netmap v2: add new package] On 15.08.09 (Sun 05:38) Armin Kuster wrote:

> From: Armin Kuster <akuster@mvista.com>
> 
> 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.

> 
> Signed-off-by: Armin Kuster <akuster@mvista.com>
> ---
>  .../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
> 
> 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 0000000..e838653
> --- /dev/null
> +++ b/meta-networking/recipes-kernel/netmap/files/makefile_fixup.patch
> @@ -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 <akuster@mvista.com>
> +
> +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\"
> + 
> 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 0000000..00d334f
> --- /dev/null
> +++ b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
> @@ -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
> +}
> diff --git a/meta-networking/recipes-kernel/netmap/netmap.inc b/meta-networking/recipes-kernel/netmap/netmap.inc
> new file mode 100644
> index 0000000..9083c69
> --- /dev/null
> +++ b/meta-networking/recipes-kernel/netmap/netmap.inc
> @@ -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'
> 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 0000000..0ee19d4
> --- /dev/null
> +++ b/meta-networking/recipes-kernel/netmap/netmap_git.bb
> @@ -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"
-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-20  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-09  0:08 [meta-networking][PATCH] netmap v2: add new package Armin Kuster
2015-08-20  0:41 ` Joe MacDonald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.