openvswitch: provide in-tree kmod builds

Open vSwitch 2.10 introduces meters support to the kernel datapath.  In
upstream Linux, the feature is only available since 4.15

This is mainly for make the newly introduced meter features in linux
kernel datapath more easily available

	root@OpenWrt:/# ovs-ofctl -OOpenFlow13 meter-features br0
	OFPST_METER_FEATURES reply (OF1.3) (xid=0x2):
	max_meter:4294967295 max_bands:1 max_color:0
	band_types: drop
	capabilities: kbps pktps burst stats
	root@OpenWrt:/#

Size comparison between in-tree and upstreamed modules are attached

	  2800 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-geneve-intree/lib/modules/4.14.67/vport-geneve.ko
	  2736 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-geneve/lib/modules/4.14.67/vport-geneve.ko
	  2596 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-gre-intree/lib/modules/4.14.67/vport-gre.ko
	  2536 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-gre/lib/modules/4.14.67/vport-gre.ko
	288320 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-intree/lib/modules/4.14.67/openvswitch.ko
	118984 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch/lib/modules/4.14.67/openvswitch.ko
	  2792 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-lisp-intree/lib/modules/4.14.67/vport-lisp.ko
	  2788 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-stt-intree/lib/modules/4.14.67/vport-stt.ko
	  3668 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-vxlan-intree/lib/modules/4.14.67/vport-vxlan.ko
	  3400 Sep  5 08:47 ipkg-mips_24kc/kmod-openvswitch-vxlan/lib/modules/4.14.67/vport-vxlan.ko

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou
2018-09-05 06:21:51 +00:00
parent 76e57b333d
commit f2bf8d3d4c
10 changed files with 190 additions and 69 deletions
@@ -1,7 +1,7 @@
From e4ac9741a99866976322c21605b312bc27633c92 Mon Sep 17 00:00:00 2001
From: Helmut Schaa <helmut.schaa@googlemail.com>
Date: Wed, 8 Jan 2014 13:48:33 +0100
Subject: [PATCH 100/106] netdev-linux: Use unsigned int for ifi_flags
Subject: [PATCH 100/107] netdev-linux: Use unsigned int for ifi_flags
ifi_flags is unsigned, the local equivalents should do the same.
@@ -1,7 +1,7 @@
From 9f4775d9a2541e8128ea99f3b02925cc1ee05374 Mon Sep 17 00:00:00 2001
From: Helmut Schaa <helmut.schaa@googlemail.com>
Date: Wed, 8 Jan 2014 13:48:49 +0100
Subject: [PATCH 101/106] netdev-linux: Let interface flag survive internal
Subject: [PATCH 101/107] netdev-linux: Let interface flag survive internal
port setup
Due to a race condition when bringing up an internal port on Linux
@@ -1,7 +1,7 @@
From e451d74788c73e8679e6a2268185a08901ac7f8c Mon Sep 17 00:00:00 2001
From: Yousong Zhou <zhouyousong@yunionyun.com>
Date: Tue, 21 Aug 2018 12:21:05 +0000
Subject: [PATCH 102/106] python: separate host/target python for cross-compile
Subject: [PATCH 102/107] python: separate host/target python for cross-compile
At the moment, python-six is a requirement for openvswitch python
library on target machine.
@@ -1,7 +1,7 @@
From 6b9732c8851c5466f2a363d88b5acae320801efe Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Wed, 14 Mar 2018 16:40:01 +0800
Subject: [PATCH 103/106] ovs-ctl: fix setting hostname
Subject: [PATCH 103/107] ovs-ctl: fix setting hostname
The command "hostname" is not available in OpenWrt by default.
@@ -1,7 +1,7 @@
From 940441e2982cb35765830060e8203e5dd1a0f967 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Wed, 14 Mar 2018 16:44:13 +0800
Subject: [PATCH 104/106] ovs-lib: fix install_dir()
Subject: [PATCH 104/107] ovs-lib: fix install_dir()
The command "install" is not available in OpenWrt by default
@@ -1,7 +1,7 @@
From d0cad5ac122aca722dc2013c1f53fda44c477cf2 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <zhouyousong@yunionyun.com>
Date: Tue, 21 Aug 2018 13:02:21 +0000
Subject: [PATCH 105/106] build: disable building tests
Subject: [PATCH 105/107] build: disable building tests
Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
---
@@ -1,7 +1,7 @@
From 2a59f2b60e8a22dc93d48c511b5c4255b429ff66 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <zhouyousong@yunionyun.com>
Date: Wed, 5 Sep 2018 12:32:54 +0000
Subject: [PATCH 106/106] ovs-save: compatible with busybox ip command
Subject: [PATCH 106/107] ovs-save: compatible with busybox ip command
Busybox ip command will have exit code 1 for `ip -V` or `ip help` etc.,
use `ip rule list` to cover both iproute2 and busybox ip command
@@ -0,0 +1,28 @@
From 1e859f407b94a0f549fc41fceec11ca12653878b Mon Sep 17 00:00:00 2001
From: Yousong Zhou <zhouyousong@yunionyun.com>
Date: Thu, 6 Sep 2018 11:48:20 +0000
Subject: [PATCH 107/107] datapath: use KARCH when building linux datapath
modules
Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
---
datapath/linux/Makefile.main.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/datapath/linux/Makefile.main.in b/datapath/linux/Makefile.main.in
index 7d18253be..039485d16 100644
--- a/datapath/linux/Makefile.main.in
+++ b/datapath/linux/Makefile.main.in
@@ -68,10 +68,10 @@ ifeq (,$(wildcard $(CONFIG_FILE)))
endif
default:
- $(MAKE) -C $(KSRC) M=$(builddir) modules
+ $(MAKE) -C $(KSRC) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules
modules_install:
- $(MAKE) -C $(KSRC) M=$(builddir) modules_install
+ $(MAKE) -C $(KSRC) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules_install
depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h`
endif