Browse Source

enable ovs 2.6.1 with NSH

1. port from https://github.com/yyang13/ovs_nsh_patches/
2. todo: ovs 2.6.1 with NSH & DPDK 16.07

Change-Id: If887bdf072e891d2220b37c34ea7aac433fa8d66
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Guo Ruijing 2 years ago
parent
commit
db6380e405

+ 7
- 5
deployment_scripts/install.sh View File

@@ -10,19 +10,21 @@ nsh=$2
10 10
 dpdk=$3
11 11
 dpdk_socket_mem=${4:-''}
12 12
 
13
+apt-get install -y dkms
14
+
13 15
 if [ $nsh = 'true' ]
14 16
 then
15 17
     curl  http://$host:8080/plugins/fuel-plugin-ovs-1.0/repositories/ubuntu/ovs-nsh-dpdk.tar.gz | tar -xzv
16
-    dpkg -i openvswitch-datapath-dkms_2.5.90-1.nsh_all.deb
17
-    dpkg -i openvswitch-common_2.5.90-1.nsh_amd64.deb
18
-    dpkg -i openvswitch-switch_2.5.90-1.nsh_amd64.deb
19
-    dpkg -i python-openvswitch_2.5.90-1.nsh_all.deb
18
+    dpkg -i openvswitch-datapath-dkms_2.6.1-1.nsh_all.deb
19
+    dpkg -i openvswitch-common_2.6.1-1.nsh_amd64.deb
20
+    dpkg -i openvswitch-switch_2.6.1-1.nsh_amd64.deb
21
+    dpkg -i python-openvswitch_2.6.1-1.nsh_all.deb
20 22
     if [ $dpdk = 'true' ]
21 23
     then
22 24
         dpkg -i libxenstore3.0*.deb
23 25
         dpkg -i libdpdk0_2.2.0-1_amd64.deb
24 26
         dpkg -i dpdk_2.2.0-1_amd64.deb
25
-        dpkg -i openvswitch-switch-dpdk_2.5.90-1.nsh_amd64.deb
27
+        dpkg -i openvswitch-switch-dpdk_2.6.1-1.nsh_amd64.deb
26 28
     fi
27 29
 else
28 30
     curl  http://$host:8080/plugins/fuel-plugin-ovs-1.0/repositories/ubuntu/ovs-dpdk.tar.gz | tar -xzv

+ 8
- 61
ovs_build/build-ovs-nsh-dpdk.sh View File

@@ -2,100 +2,47 @@
2 2
 
3 3
 set -eux
4 4
 
5
-OVS_COMMIT=7d433ae57ebb90cd68e8fa948a096f619ac4e2d8
5
+OVS_COMMIT=f4b0e64cffb4777ff03d48621c3eadcf1d8c19f3
6 6
 URL_OVS=https://github.com/openvswitch/ovs.git
7
-OVS_VER=${OVS_VER:-2.5.90}
7
+OVS_VER=${OVS_VER:-2.6.1}
8 8
 BUILD_HOME=$HOME/nsh
9 9
 BUILD_DEST=${BUILD_DEST:-/deb}
10 10
 DIR="$(dirname `readlink -f $0`)"
11 11
 
12 12
 export DEB_BUILD_OPTIONS='parallel=8 nocheck'
13 13
 
14
-sudo apt-get build-dep openvswitch -y
15 14
 sudo apt-get -y install devscripts dpkg-dev git wget
16 15
 
17 16
 rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
18 17
 
19 18
 cd ${BUILD_HOME}
20
-wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
21
-wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
22
-wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
23
-dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
24 19
 
25 20
 # copy from debian/control
26
-sudo apt-get install -y debhelper \
27
-               dh-python \
28
-               dh-systemd \
29
-               doxygen  \
30
-               graphviz  \
31
-               inkscape  \
32
-               libcap-dev  \
33
-               libpcap-dev  \
34
-               libxen-dev  \
35
-               libxenstore3.0  \
36
-               python  \
37
-               python-sphinx  \
38
-               texlive-fonts-recommended  \
39
-               texlive-latex-extra
40
-
41
-cd dpdk-2.2.0; rm -rf debian/patches/;
42
-cat << EOF > debian/changelog
43
-dpdk (2.2.0-1) unstable; urgency=low
44
-  * DPDK 2.2.0
45
- -- DPDK team <dev@dpdk.org>  $(date --rfc-2822)
46
-EOF
47
-debian/rules build; fakeroot debian/rules binary
48
-cd ${BUILD_HOME}; sudo dpkg -i *.deb
49
-apt-get download libxenstore3.0
50
-
51
-cd ${BUILD_HOME}
52
-wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0.orig.tar.gz
53
-wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
54
-wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.debian.tar.xz
55
-dpkg-source -x openvswitch-dpdk_2.4.0-0ubuntu1.dsc
56
-
57
-# copy from debian/control
58
-sudo apt-get install -y autoconf \
21
+sudo apt-get install -y \
22
+               graphviz \
23
+               autoconf \
59 24
                automake \
60 25
                bzip2 \
61 26
                debhelper \
62 27
                dh-autoreconf \
63
-               dh-systemd \
64
-               graphviz \
65
-               libdpdk-dev \
66
-               libfuse-dev \
67 28
                libssl-dev \
68 29
                libtool \
69 30
                openssl \
70 31
                procps \
71 32
                python-all \
72
-               python-qt4 \
73 33
                python-twisted-conch \
74 34
                python-zopeinterface \
75 35
                python-six
76 36
 
77 37
 git clone https://github.com/openvswitch/ovs.git
78 38
 cd ovs; git checkout ${OVS_COMMIT}
79
-PATCHES=$(cd ${DIR}/patches; echo *patch)
39
+PATCHES=$(cd ${DIR}/ovs_nsh_patches/v2.6.1/; echo *patch)
80 40
 for patch in ${PATCHES}
81 41
 do
82
-    patch -p1 < ${DIR}/patches/${patch}
42
+    patch -p1 < ${DIR}/ovs_nsh_patches/v2.6.1/${patch}
83 43
 done
84
-cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
85
-rm -rf openvswitch-dpdk-${OVS_VER}*
86
-cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
87
-cd ../openvswitch-dpdk-${OVS_VER}
88
-sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
89
-sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/'  acinclude.m4
90
-autoreconf --install
91
-rm -rf debian/patches/ .git;
92
-cat << EOF > debian/changelog
93
-openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
94
-  * Support NSH
95
- -- Open vSwitch team <dev@openvswitch.org>  $(date --rfc-2822)
96
-EOF
97
-debian/rules build; fakeroot debian/rules binary
98 44
 
45
+# build ovs
99 46
 cd ${BUILD_HOME}/ovs
100 47
 cat << EOF > debian/changelog
101 48
 openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low

ovs_build/patches/0001-ovs-vxlan-gpe-vxlan-extension-to-support-vxlan-gpe-t.patch → ovs_build/ovs_nsh_patches/v2.6.1/0001-Enable-current-VxLAN-gpe-work-and-meet-NSH-requireme.patch View File

@@ -1,34 +1,31 @@
1
-From 5d79831435ec4e5bea20cc36c3f83eacf6fd065c Mon Sep 17 00:00:00 2001
1
+From 9f7148f9dc03053a4a3231a7cf819c447a178a17 Mon Sep 17 00:00:00 2001
2 2
 From: Yi Yang <yi.y.yang@intel.com>
3
-Date: Mon, 11 Apr 2016 15:58:14 +0800
4
-Subject: [PATCH 1/6] ovs-vxlan-gpe: vxlan extension to support vxlan-gpe
5
- tunnel port
3
+Date: Fri, 11 Nov 2016 11:13:18 +0800
4
+Subject: [PATCH 1/8] Enable current VxLAN-gpe work and meet NSH requirements
6 5
 
7
-Signed-off-by: Mengke Liu <mengke.liu@intel.com>
8
-Signed-off-by: Ricky Li <ricky.li@intel.com>
9
-Signed-off-by: Johnson Li <johnson.li@intel.com>
10 6
 Signed-off-by: Yi Yang <yi.y.yang@intel.com>
11 7
 ---
12 8
  datapath/flow_netlink.c                           |  8 +-
13 9
  datapath/linux/compat/include/linux/openvswitch.h |  1 +
14
- datapath/linux/compat/include/net/vxlan.h         | 73 +++++++++++++++++++
15
- datapath/linux/compat/vxlan.c                     | 30 ++++++++
10
+ datapath/linux/compat/include/net/vxlan.h         |  1 +
11
+ datapath/linux/compat/vxlan.c                     |  4 +-
12
+ datapath/vport-netdev.c                           |  3 +-
16 13
  datapath/vport-vxlan.c                            | 15 ++++
14
+ include/openvswitch/match.h                       |  4 +
15
+ include/openvswitch/meta-flow.h                   | 28 +++++++
16
+ include/openvswitch/packets.h                     |  4 +-
17 17
  lib/flow.c                                        |  8 ++
18 18
  lib/match.c                                       | 34 +++++++++
19
- lib/match.h                                       |  4 +
20 19
  lib/meta-flow.c                                   | 36 +++++++++
21
- lib/meta-flow.h                                   | 28 +++++++
22 20
  lib/netdev-vport.c                                |  2 +
23 21
  lib/nx-match.c                                    |  4 +
24 22
  lib/odp-util.c                                    | 89 ++++++++++++++++++++++-
25
- lib/packets.h                                     |  4 +-
26 23
  tests/ofproto.at                                  |  4 +-
27 24
  tests/ovs-ofctl.at                                |  4 +
28
- 16 files changed, 340 insertions(+), 4 deletions(-)
25
+ 17 files changed, 241 insertions(+), 8 deletions(-)
29 26
 
30 27
 diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
31
-index 6ffcc53..351a504 100644
28
+index 0f32664..2dcae07 100644
32 29
 --- a/datapath/flow_netlink.c
33 30
 +++ b/datapath/flow_netlink.c
34 31
 @@ -309,6 +309,7 @@ size_t ovs_key_attr_size(void)
@@ -39,7 +36,7 @@ index 6ffcc53..351a504 100644
39 36
  };
40 37
  
41 38
  static const struct ovs_len_tbl ovs_tunnel_key_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] = {
42
-@@ -521,6 +522,9 @@ static int vxlan_tun_opt_from_nlattr(const struct nlattr *attr,
39
+@@ -523,6 +524,9 @@ static int vxlan_tun_opt_from_nlattr(const struct nlattr *attr,
43 40
  		case OVS_VXLAN_EXT_GBP:
44 41
  			opts.gbp = nla_get_u32(a);
45 42
  			break;
@@ -49,7 +46,7 @@ index 6ffcc53..351a504 100644
49 46
  		default:
50 47
  			OVS_NLERR(log, "Unknown VXLAN extension attribute %d",
51 48
  				  type);
52
-@@ -677,7 +681,9 @@ static int vxlan_opt_to_nlattr(struct sk_buff *skb,
49
+@@ -709,7 +713,9 @@ static int vxlan_opt_to_nlattr(struct sk_buff *skb,
53 50
  	if (!nla)
54 51
  		return -EMSGSIZE;
55 52
  
@@ -61,10 +58,10 @@ index 6ffcc53..351a504 100644
61 58
  
62 59
  	nla_nest_end(skb, nla);
63 60
 diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h
64
-index 3b39ebb..44adb81 100644
61
+index 12260d8..44b7ce4 100644
65 62
 --- a/datapath/linux/compat/include/linux/openvswitch.h
66 63
 +++ b/datapath/linux/compat/include/linux/openvswitch.h
67
-@@ -287,6 +287,7 @@ enum ovs_vport_attr {
64
+@@ -291,6 +291,7 @@ enum ovs_vport_attr {
68 65
  enum {
69 66
  	OVS_VXLAN_EXT_UNSPEC,
70 67
  	OVS_VXLAN_EXT_GBP,      /* Flag or __u32 */
@@ -73,172 +70,57 @@ index 3b39ebb..44adb81 100644
73 70
  };
74 71
  
75 72
 diff --git a/datapath/linux/compat/include/net/vxlan.h b/datapath/linux/compat/include/net/vxlan.h
76
-index 75a5a7a..2bfc3f8 100644
73
+index 5bc8969..5a994b2 100644
77 74
 --- a/datapath/linux/compat/include/net/vxlan.h
78 75
 +++ b/datapath/linux/compat/include/net/vxlan.h
79
-@@ -84,6 +84,75 @@ struct vxlanhdr_gbp {
80
- #define VXLAN_GBP_POLICY_APPLIED	(BIT(3) << 16)
81
- #define VXLAN_GBP_ID_MASK		(0xFFFF)
76
+@@ -201,6 +201,7 @@ reserved_flags2:2;
82 77
  
83
-+/*
84
-+ * VXLAN Generic Protocol Extension Extension:
85
-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
86
-+ * |R|R|Ver|I|P|R|O|R|R|R|R|R|R|R|R|R|R|R|R|R|R|R|R|  Next Proto   |
87
-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
88
-+ * |                VXLAN Network Identifier (VNI) |   Reserved    |
89
-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
90
-+ * Ver = Version. Indicates VXLAN GPE protocol version.  The initial
91
-+ *      version is 0.  If a receiver does not support the version
92
-+ *      indicated it MUST drop the packet.
93
-+ *
94
-+ * I = Instance Bit. The I bit MUST be set to indicate a valid VNI.
95
-+ *
96
-+ * P = Next Protocol Bit. The P bit is set to indicate that the
97
-+ *     Next Protocol field is present.
98
-+ *
99
-+ * O = OAM Flag Bit. The O bit is set to indicate that the packet
100
-+ *     is an OAM packet.
101
-+ *
102
-+ * [1] https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-01.txt
103
-+ */
104
-+
105
-+struct vxlanhdr_gpe {
106
-+#ifdef __LITTLE_ENDIAN_BITFIELD
107
-+       uint8_t    oam_flag:1;
108
-+       uint8_t    reserved_flags1:1;
109
-+       uint8_t    np_applied:1;
110
-+       uint8_t    instance_applied:1;
111
-+       uint8_t    gpe_version:2;
112
-+       uint8_t    reserved_flags2:2;
113
-+#elif defined(__BIG_ENDIAN_BITFIELD)
114
-+       uint8_t    reserved_flags2:2;
115
-+       uint8_t    gpe_version:2;
116
-+       uint8_t    instance_applied:1;
117
-+       uint8_t    np_applied:1;
118
-+       uint8_t    reserved_flags1:1;
119
-+       uint8_t    oam_flag:1;
120
-+#else
121
-+#error "Please fix <asm/byteorder.h>"
122
-+#endif
123
-+    uint8_t    reserved_flags3;
124
-+    uint8_t    reserved_flags4;
125
-+    uint8_t    next_proto;
126
-+    __be32        vx_vni;
127
-+};
128
-+
129
-+/* VxLAN-GPE Header Next Protocol */
130
-+#define VXLAN_GPE_NP_IPV4        0x01
131
-+#define VXLAN_GPE_NP_IPV6        0x02
132
-+#define VXLAN_GPE_NP_ETHERNET    0x03
133
-+#define VXLAN_GPE_NP_NSH        0x04
134
-+
135
-+/* skb->mark mapping
136
-+ *
137
-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
138
-+ * |R|R|Ver|I|P|R|O|R|R|R|R|R|R|R|R|R|R|R|R|R|R|R|R|  Next Proto   |
139
-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
140
-+ */
141
-+
142
-+#define VXLAN_GPE_OAM_FLAG                     (BIT(0) << 24)
143
-+#define VXLAN_GPE_NP_APPLIED           (BIT(0) << 26)
144
-+#define VXLAN_GPE_INSTANCE_APPLIED     (BIT(0) << 27)
145
-+#define VXLAN_GPE_VERSION                      ((BIT(0) << 28) | (BIT(0) << 29))
146
-+
147
-+#define VXLAN_GPE_NP_MASK                      (0xFF)
148
-+
149
-+#define VXLAN_GPE_USED_BITS (VXLAN_GPE_OAM_FLAG | VXLAN_GPE_NP_APPLIED \
150
-+                           | VXLAN_GPE_INSTANCE_APPLIED | VXLAN_GPE_VERSION | 0xFF)
151
-+
152
- /* VXLAN protocol header:
153
-  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
154
-  * |G|R|R|R|I|R|R|C|               Reserved                        |
155
-@@ -104,6 +173,7 @@ struct vxlanhdr {
156
- #define VXLAN_HF_RCO BIT(21)
157
- #define VXLAN_HF_VNI BIT(27)
158
- #define VXLAN_HF_GBP BIT(31)
159
-+#define VXLAN_HF_GPE BIT(26)
160
- 
161
- /* Remote checksum offload header option */
162
- #define VXLAN_RCO_MASK  0x7f    /* Last byte of vni field */
163
-@@ -120,6 +190,7 @@ struct vxlanhdr {
164 78
  struct vxlan_metadata {
165
- 	__be32          vni;
166
- 	u32             gbp;
167
-+	u32             gpe;
79
+ 	u32		gbp;
80
++	u32		gpe;
168 81
  };
169 82
  
170
- #define VNI_HASH_BITS	10
171
-@@ -205,11 +276,13 @@ struct vxlan_dev {
172
- #define VXLAN_F_GBP			0x800
173
- #define VXLAN_F_REMCSUM_NOPARTIAL	0x1000
174
- #define VXLAN_F_COLLECT_METADATA	0x2000
175
-+#define VXLAN_F_GPE                     0x4000
176
- 
177
- /* Flags that are used in the receive path. These flags must match in
178
-  * order for a socket to be shareable
179
-  */
180
- #define VXLAN_F_RCV_FLAGS		(VXLAN_F_GBP |			\
181
-+                                         VXLAN_F_GPE |                  \
182
- 					 VXLAN_F_UDP_ZERO_CSUM6_RX |	\
183
- 					 VXLAN_F_REMCSUM_RX |		\
184
- 					 VXLAN_F_REMCSUM_NOPARTIAL |	\
83
+ /* per UDP socket information */
185 84
 diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
186
-index 4faa18f..7ef051c 100644
85
+index d5dbe8d..a80610b 100644
187 86
 --- a/datapath/linux/compat/vxlan.c
188 87
 +++ b/datapath/linux/compat/vxlan.c
189
-@@ -971,6 +971,18 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
190
- 			md->gbp |= VXLAN_GBP_POLICY_APPLIED;
191
- 
192
- 		flags &= ~VXLAN_GBP_USED_BITS;
193
-+	} else if ((flags & VXLAN_HF_GPE) && (vs->flags & VXLAN_F_GPE)) {
194
-+		struct vxlanhdr_gpe *gpe;
195
-+
196
-+		gpe = (struct vxlanhdr_gpe *)vxh;
197
-+		md->gpe = ntohs(gpe->next_proto);
198
-+
199
-+		buf.dst.u.tun_info.key.tun_flags |= TUNNEL_VXLAN_OPT;
200
-+
201
-+		if (gpe->oam_flag)
202
-+			md->gpe |= VXLAN_GPE_OAM_FLAG;
203
-+
204
-+		flags &= ~VXLAN_GPE_USED_BITS;
88
+@@ -705,7 +705,6 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
89
+ 	if (vs->flags & VXLAN_F_GPE) {
90
+ 		if (!vxlan_parse_gpe_hdr(&unparsed, &protocol, skb, vs->flags))
91
+ 			goto drop;
92
+-		raw_proto = true;
205 93
  	}
206 94
  
207
- 	if (flags || vni & ~VXLAN_VNI_MASK) {
208
-@@ -1023,6 +1035,22 @@ static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, u32 vxflags,
209
- 	gbp->policy_id = htons(md->gbp & VXLAN_GBP_ID_MASK);
210
- }
211
- 
212
-+static void vxlan_build_gpe_hdr(struct vxlanhdr *vxh, u32 vxflags,
213
-+                                struct vxlan_metadata *md)
214
-+{
215
-+       struct vxlanhdr_gpe *gpe;
216
-+
217
-+       if (!md->gpe)
218
-+               return;
219
-+
220
-+       gpe = (struct vxlanhdr_gpe*)vxh;
221
-+       vxh->vx_flags |= htonl(VXLAN_HF_GPE);
222
-+
223
-+       if (md->gpe & VXLAN_GPE_OAM_FLAG)
224
-+               gpe->oam_flag = 1;
225
-+       gpe->next_proto = md->gpe & VXLAN_GPE_NP_MASK;
226
-+}
227
-+
228
- #if IS_ENABLED(CONFIG_IPV6)
229
- static int vxlan6_xmit_skb(struct dst_entry *dst, struct sock *sk,
230
- 			   struct sk_buff *skb,
231
-@@ -1106,6 +1134,8 @@ static int vxlan6_xmit_skb(struct dst_entry *dst, struct sock *sk,
232
- 
95
+ 	if (__iptunnel_pull_header(skb, VXLAN_HLEN, protocol, raw_proto,
96
+@@ -896,10 +895,9 @@ static int vxlan_build_skb(struct sk_buff *skb, struct dst_entry *dst,
233 97
  	if (vxflags & VXLAN_F_GBP)
234 98
  		vxlan_build_gbp_hdr(vxh, vxflags, md);
235
-+	else if (vxflags & VXLAN_F_GPE)
236
-+		vxlan_build_gpe_hdr(vxh, vxflags, md);
99
+ 	if (vxflags & VXLAN_F_GPE) {
100
+-		err = vxlan_build_gpe_hdr(vxh, vxflags, skb->protocol);
101
++		err = vxlan_build_gpe_hdr(vxh, vxflags, inner_protocol);
102
+ 		if (err < 0)
103
+ 			goto out_free;
104
+-		inner_protocol = skb->protocol;
105
+ 	}
237 106
  
238
- 	ovs_skb_set_inner_protocol(skb, htons(ETH_P_TEB));
107
+ 	ovs_skb_set_inner_protocol(skb, inner_protocol);
108
+diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c
109
+index 970f7d3..0ee076b 100644
110
+--- a/datapath/vport-netdev.c
111
++++ b/datapath/vport-netdev.c
112
+@@ -102,7 +102,8 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name)
113
+ 	}
239 114
  
115
+ 	if (vport->dev->flags & IFF_LOOPBACK ||
116
+-	    vport->dev->type != ARPHRD_ETHER ||
117
++	    (vport->dev->type != ARPHRD_ETHER &&
118
++             vport->dev->type != ARPHRD_NONE) ||
119
+ 	    ovs_is_internal_dev(vport->dev)) {
120
+ 		err = -EINVAL;
121
+ 		goto error_put;
240 122
 diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c
241
-index c05f5d4..5d775cc 100644
123
+index 11965c0..e32c970 100644
242 124
 --- a/datapath/vport-vxlan.c
243 125
 +++ b/datapath/vport-vxlan.c
244 126
 @@ -52,6 +52,18 @@ static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb)
@@ -277,11 +159,80 @@ index c05f5d4..5d775cc 100644
277 159
  
278 160
  	return 0;
279 161
  }
162
+diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h
163
+index 3b7f32f..93af1b8 100644
164
+--- a/include/openvswitch/match.h
165
++++ b/include/openvswitch/match.h
166
+@@ -89,6 +89,10 @@ void match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, ovs_be16
167
+ void match_set_tun_gbp_id(struct match *match, ovs_be16 gbp_id);
168
+ void match_set_tun_gbp_flags_masked(struct match *match, uint8_t flags, uint8_t mask);
169
+ void match_set_tun_gbp_flags(struct match *match, uint8_t flags);
170
++void match_set_tun_gpe_np_masked(struct match *match, uint8_t gpe_np, uint8_t mask);
171
++void match_set_tun_gpe_np(struct match *match, uint8_t gpe_np);
172
++void match_set_tun_gpe_flags_masked(struct match *match, uint8_t flags, uint8_t mask);
173
++void match_set_tun_gpe_flags(struct match *match, uint8_t flags);
174
+ void match_set_in_port(struct match *, ofp_port_t ofp_port);
175
+ void match_set_pkt_mark(struct match *, uint32_t pkt_mark);
176
+ void match_set_pkt_mark_masked(struct match *, uint32_t pkt_mark, uint32_t mask);
177
+diff --git a/include/openvswitch/meta-flow.h b/include/openvswitch/meta-flow.h
178
+index b091c1b..9e569ef 100644
179
+--- a/include/openvswitch/meta-flow.h
180
++++ b/include/openvswitch/meta-flow.h
181
+@@ -493,6 +493,34 @@ enum OVS_PACKED_ENUM mf_field_id {
182
+      */
183
+     MFF_TUN_GBP_FLAGS,
184
+ 
185
++     /* "tun_gpe_np".
186
++     *
187
++     * VXLAN Generic Protocol Extension next_proto
188
++     *
189
++     * Type: u8.
190
++     * Maskable: bitwise.
191
++     * Formatting: hexadecimal.
192
++     * Prerequisites: none.
193
++     * Access: read/write.
194
++     * NXM: NXM_NX_TUN_GPE_NP(200) since v2.4.
195
++     * OXM: none.
196
++     */
197
++    MFF_TUN_GPE_NP,
198
++
199
++     /* "tun_gpe_flags".
200
++     *
201
++     * VXLAN Generic Protocol Extension flag
202
++     *
203
++     * Type: u8.
204
++     * Maskable: bitwise.
205
++     * Formatting: hexadecimal.
206
++     * Prerequisites: none.
207
++     * Access: read/write.
208
++     * NXM: NXM_NX_TUN_GPE_FLAGS(201) since v2.4.
209
++     * OXM: none.
210
++     */
211
++    MFF_TUN_GPE_FLAGS,
212
++
213
+ #if TUN_METADATA_NUM_OPTS == 64
214
+     /* "tun_metadata<N>".
215
+      *
216
+diff --git a/include/openvswitch/packets.h b/include/openvswitch/packets.h
217
+index 5d97309..1e82df0 100644
218
+--- a/include/openvswitch/packets.h
219
++++ b/include/openvswitch/packets.h
220
+@@ -34,7 +34,9 @@ struct flow_tnl {
221
+     ovs_be16 tp_dst;
222
+     ovs_be16 gbp_id;
223
+     uint8_t  gbp_flags;
224
+-    uint8_t  pad1[5];        /* Pad to 64 bits. */
225
++    uint8_t  gpe_np;
226
++    uint8_t  gpe_flags;
227
++    uint8_t  pad1[3];        /* Pad to 64 bits. */
228
+     struct tun_metadata metadata;
229
+ };
230
+ 
280 231
 diff --git a/lib/flow.c b/lib/flow.c
281
-index b9ce331..d24bdc9 100644
232
+index ba4f8c7..375979b 100644
282 233
 --- a/lib/flow.c
283 234
 +++ b/lib/flow.c
284
-@@ -870,6 +870,12 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata)
235
+@@ -897,6 +897,12 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata)
285 236
      if (flow->tunnel.gbp_flags) {
286 237
          match_set_tun_gbp_flags(flow_metadata, flow->tunnel.gbp_flags);
287 238
      }
@@ -294,7 +245,7 @@ index b9ce331..d24bdc9 100644
294 245
      tun_metadata_get_fmd(&flow->tunnel, flow_metadata);
295 246
      if (flow->metadata != htonll(0)) {
296 247
          match_set_metadata(flow_metadata, flow->metadata);
297
-@@ -1265,6 +1271,8 @@ void flow_wildcards_init_for_packet(struct flow_wildcards *wc,
248
+@@ -1292,6 +1298,8 @@ void flow_wildcards_init_for_packet(struct flow_wildcards *wc,
298 249
          WC_MASK_FIELD(wc, tunnel.tp_dst);
299 250
          WC_MASK_FIELD(wc, tunnel.gbp_id);
300 251
          WC_MASK_FIELD(wc, tunnel.gbp_flags);
@@ -304,10 +255,10 @@ index b9ce331..d24bdc9 100644
304 255
          if (!(flow->tunnel.flags & FLOW_TNL_F_UDPIF)) {
305 256
              if (flow->tunnel.metadata.present.map) {
306 257
 diff --git a/lib/match.c b/lib/match.c
307
-index fd571d9..52437c9 100644
258
+index d78e6a1..f19648d 100644
308 259
 --- a/lib/match.c
309 260
 +++ b/lib/match.c
310
-@@ -289,6 +289,32 @@ match_set_tun_gbp_flags(struct match *match, uint8_t flags)
261
+@@ -305,6 +305,32 @@ match_set_tun_gbp_flags(struct match *match, uint8_t flags)
311 262
  }
312 263
  
313 264
  void
@@ -340,7 +291,7 @@ index fd571d9..52437c9 100644
340 291
  match_set_in_port(struct match *match, ofp_port_t ofp_port)
341 292
  {
342 293
      match->wc.masks.in_port.ofp_port = u16_to_ofp(UINT16_MAX);
343
-@@ -1013,6 +1039,14 @@ format_flow_tunnel(struct ds *s, const struct match *match)
294
+@@ -1029,6 +1055,14 @@ format_flow_tunnel(struct ds *s, const struct match *match)
344 295
          ds_put_format(s, "tun_gbp_flags=%#"PRIx8",", tnl->gbp_flags);
345 296
      }
346 297
  
@@ -355,23 +306,8 @@ index fd571d9..52437c9 100644
355 306
      if (wc->masks.tunnel.ip_tos) {
356 307
          ds_put_format(s, "tun_tos=%"PRIx8",", tnl->ip_tos);
357 308
      }
358
-diff --git a/lib/match.h b/lib/match.h
359
-index 0a6ac29..48aa0b1 100644
360
---- a/lib/match.h
361
-+++ b/lib/match.h
362
-@@ -86,6 +86,10 @@ void match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, ovs_be16
363
- void match_set_tun_gbp_id(struct match *match, ovs_be16 gbp_id);
364
- void match_set_tun_gbp_flags_masked(struct match *match, uint8_t flags, uint8_t mask);
365
- void match_set_tun_gbp_flags(struct match *match, uint8_t flags);
366
-+void match_set_tun_gpe_np_masked(struct match *match, uint8_t gpe_np, uint8_t mask);
367
-+void match_set_tun_gpe_np(struct match *match, uint8_t gpe_np);
368
-+void match_set_tun_gpe_flags_masked(struct match *match, uint8_t flags, uint8_t mask);
369
-+void match_set_tun_gpe_flags(struct match *match, uint8_t flags);
370
- void match_set_in_port(struct match *, ofp_port_t ofp_port);
371
- void match_set_pkt_mark(struct match *, uint32_t pkt_mark);
372
- void match_set_pkt_mark_masked(struct match *, uint32_t pkt_mark, uint32_t mask);
373 309
 diff --git a/lib/meta-flow.c b/lib/meta-flow.c
374
-index 721152c..ab77fca 100644
310
+index d07f927..5d0721f 100644
375 311
 --- a/lib/meta-flow.c
376 312
 +++ b/lib/meta-flow.c
377 313
 @@ -213,6 +213,10 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
@@ -385,7 +321,7 @@ index 721152c..ab77fca 100644
385 321
      CASE_MFF_TUN_METADATA:
386 322
          return !ULLONG_GET(wc->masks.tunnel.metadata.present.map,
387 323
                             mf->id - MFF_TUN_METADATA0);
388
-@@ -515,6 +519,8 @@ mf_is_value_valid(const struct mf_field *mf, const union mf_value *value)
324
+@@ -434,6 +438,8 @@ mf_is_value_valid(const struct mf_field *mf, const union mf_value *value)
389 325
      case MFF_TUN_TTL:
390 326
      case MFF_TUN_GBP_ID:
391 327
      case MFF_TUN_GBP_FLAGS:
@@ -394,7 +330,7 @@ index 721152c..ab77fca 100644
394 330
      CASE_MFF_TUN_METADATA:
395 331
      case MFF_METADATA:
396 332
      case MFF_IN_PORT:
397
-@@ -648,6 +654,12 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
333
+@@ -568,6 +574,12 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
398 334
      case MFF_TUN_GBP_FLAGS:
399 335
          value->u8 = flow->tunnel.gbp_flags;
400 336
          break;
@@ -407,7 +343,7 @@ index 721152c..ab77fca 100644
407 343
      case MFF_TUN_TTL:
408 344
          value->u8 = flow->tunnel.ip_ttl;
409 345
          break;
410
-@@ -899,6 +911,12 @@ mf_set_value(const struct mf_field *mf,
346
+@@ -823,6 +835,12 @@ mf_set_value(const struct mf_field *mf,
411 347
      case MFF_TUN_GBP_FLAGS:
412 348
           match_set_tun_gbp_flags(match, value->u8);
413 349
           break;
@@ -420,7 +356,7 @@ index 721152c..ab77fca 100644
420 356
      case MFF_TUN_TOS:
421 357
          match_set_tun_tos(match, value->u8);
422 358
          break;
423
-@@ -1216,6 +1234,12 @@ mf_set_flow_value(const struct mf_field *mf,
359
+@@ -1161,6 +1179,12 @@ mf_set_flow_value(const struct mf_field *mf,
424 360
      case MFF_TUN_GBP_FLAGS:
425 361
          flow->tunnel.gbp_flags = value->u8;
426 362
          break;
@@ -433,7 +369,7 @@ index 721152c..ab77fca 100644
433 369
      case MFF_TUN_TOS:
434 370
          flow->tunnel.ip_tos = value->u8;
435 371
          break;
436
-@@ -1535,6 +1559,12 @@ mf_set_wild(const struct mf_field *mf, struct match *match, char **err_str)
372
+@@ -1484,6 +1508,12 @@ mf_set_wild(const struct mf_field *mf, struct match *match, char **err_str)
437 373
      case MFF_TUN_GBP_FLAGS:
438 374
          match_set_tun_gbp_flags_masked(match, 0, 0);
439 375
          break;
@@ -446,7 +382,7 @@ index 721152c..ab77fca 100644
446 382
      case MFF_TUN_TOS:
447 383
          match_set_tun_tos_masked(match, 0, 0);
448 384
          break;
449
-@@ -1838,6 +1868,12 @@ mf_set(const struct mf_field *mf,
385
+@@ -1793,6 +1823,12 @@ mf_set(const struct mf_field *mf,
450 386
      case MFF_TUN_GBP_FLAGS:
451 387
          match_set_tun_gbp_flags_masked(match, value->u8, mask->u8);
452 388
          break;
@@ -459,50 +395,11 @@ index 721152c..ab77fca 100644
459 395
      case MFF_TUN_TTL:
460 396
          match_set_tun_ttl_masked(match, value->u8, mask->u8);
461 397
          break;
462
-diff --git a/lib/meta-flow.h b/lib/meta-flow.h
463
-index c73a1af..4bd9ff6 100644
464
---- a/lib/meta-flow.h
465
-+++ b/lib/meta-flow.h
466
-@@ -491,6 +491,34 @@ enum OVS_PACKED_ENUM mf_field_id {
467
-      */
468
-     MFF_TUN_GBP_FLAGS,
469
- 
470
-+     /* "tun_gpe_np".
471
-+     *
472
-+     * VXLAN Generic Protocol Extension next_proto
473
-+     *
474
-+     * Type: u8.
475
-+     * Maskable: bitwise.
476
-+     * Formatting: hexadecimal.
477
-+     * Prerequisites: none.
478
-+     * Access: read/write.
479
-+     * NXM: NXM_NX_TUN_GPE_NP(111) since v2.4.
480
-+     * OXM: none.
481
-+     */
482
-+    MFF_TUN_GPE_NP,
483
-+
484
-+     /* "tun_gpe_flags".
485
-+     *
486
-+     * VXLAN Generic Protocol Extension flag
487
-+     *
488
-+     * Type: u8.
489
-+     * Maskable: bitwise.
490
-+     * Formatting: hexadecimal.
491
-+     * Prerequisites: none.
492
-+     * Access: read/write.
493
-+     * NXM: NXM_NX_TUN_GPE_FLAGS(112) since v2.4.
494
-+     * OXM: none.
495
-+     */
496
-+    MFF_TUN_GPE_FLAGS,
497
-+
498
- #if TUN_METADATA_NUM_OPTS == 64
499
-     /* "tun_metadata<N>".
500
-      *
501 398
 diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
502
-index e398562..92ceec1 100644
399
+index ac31da6..cff0f5c 100644
503 400
 --- a/lib/netdev-vport.c
504 401
 +++ b/lib/netdev-vport.c
505
-@@ -583,6 +583,8 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args)
402
+@@ -526,6 +526,8 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args)
506 403
              while (ext) {
507 404
                  if (!strcmp(type, "vxlan") && !strcmp(ext, "gbp")) {
508 405
                      tnl_cfg.exts |= (1 << OVS_VXLAN_EXT_GBP);
@@ -512,10 +409,10 @@ index e398562..92ceec1 100644
512 409
                      VLOG_WARN("%s: unknown extension '%s'", name, ext);
513 410
                  }
514 411
 diff --git a/lib/nx-match.c b/lib/nx-match.c
515
-index 9f0f452..0eecac7 100644
412
+index b03ccf2..65d7ee3 100644
516 413
 --- a/lib/nx-match.c
517 414
 +++ b/lib/nx-match.c
518
-@@ -1037,6 +1037,10 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
415
+@@ -1036,6 +1036,10 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
519 416
                  flow->tunnel.gbp_id, match->wc.masks.tunnel.gbp_id);
520 417
      nxm_put_8m(b, MFF_TUN_GBP_FLAGS, oxm,
521 418
                 flow->tunnel.gbp_flags, match->wc.masks.tunnel.gbp_flags);
@@ -527,10 +424,10 @@ index 9f0f452..0eecac7 100644
527 424
  
528 425
      /* Registers. */
529 426
 diff --git a/lib/odp-util.c b/lib/odp-util.c
530
-index b4689cc..7983720 100644
427
+index 6d29b67..b9e8aa7 100644
531 428
 --- a/lib/odp-util.c
532 429
 +++ b/lib/odp-util.c
533
-@@ -1727,6 +1727,7 @@ odp_actions_from_string(const char *s, const struct simap *port_names,
430
+@@ -1755,6 +1755,7 @@ odp_actions_from_string(const char *s, const struct simap *port_names,
534 431
  
535 432
  static const struct attr_len_tbl ovs_vxlan_ext_attr_lens[OVS_VXLAN_EXT_MAX + 1] = {
536 433
      [OVS_VXLAN_EXT_GBP]                 = { .len = 4 },
@@ -538,7 +435,7 @@ index b4689cc..7983720 100644
538 435
  };
539 436
  
540 437
  static const struct attr_len_tbl ovs_tun_key_attr_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] = {
541
-@@ -1888,7 +1889,10 @@ odp_tun_key_from_attr__(const struct nlattr *attr,
438
+@@ -1916,7 +1917,10 @@ odp_tun_key_from_attr__(const struct nlattr *attr,
542 439
              break;
543 440
          case OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS: {
544 441
              static const struct nl_policy vxlan_opts_policy[] = {
@@ -550,7 +447,7 @@ index b4689cc..7983720 100644
550 447
              };
551 448
              struct nlattr *ext[ARRAY_SIZE(vxlan_opts_policy)];
552 449
  
553
-@@ -1902,6 +1906,12 @@ odp_tun_key_from_attr__(const struct nlattr *attr,
450
+@@ -1930,6 +1934,12 @@ odp_tun_key_from_attr__(const struct nlattr *attr,
554 451
                  tun->gbp_id = htons(gbp & 0xFFFF);
555 452
                  tun->gbp_flags = (gbp >> 16) & 0xFF;
556 453
              }
@@ -563,7 +460,7 @@ index b4689cc..7983720 100644
563 460
  
564 461
              break;
565 462
          }
566
-@@ -1988,6 +1998,13 @@ tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key,
463
+@@ -2016,6 +2026,13 @@ tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key,
567 464
          nl_msg_put_u32(a, OVS_VXLAN_EXT_GBP,
568 465
                         (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id));
569 466
          nl_msg_end_nested(a, vxlan_opts_ofs);
@@ -577,7 +474,7 @@ index b4689cc..7983720 100644
577 474
      }
578 475
      tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
579 476
  
580
-@@ -2383,6 +2400,26 @@ format_odp_tun_vxlan_opt(const struct nlattr *attr,
477
+@@ -2410,6 +2427,26 @@ format_odp_tun_vxlan_opt(const struct nlattr *attr,
581 478
              ds_put_cstr(ds, "),");
582 479
              break;
583 480
          }
@@ -604,7 +501,7 @@ index b4689cc..7983720 100644
604 501
  
605 502
          default:
606 503
              format_unknown_key(ds, a, ma);
607
-@@ -3670,6 +3707,40 @@ scan_vxlan_gbp(const char *s, uint32_t *key, uint32_t *mask)
504
+@@ -3705,6 +3742,40 @@ scan_vxlan_gbp(const char *s, uint32_t *key, uint32_t *mask)
608 505
  }
609 506
  
610 507
  static int
@@ -645,7 +542,7 @@ index b4689cc..7983720 100644
645 542
  scan_geneve(const char *s, struct geneve_scan *key, struct geneve_scan *mask)
646 543
  {
647 544
      const char *s_base = s;
648
-@@ -3796,6 +3867,21 @@ vxlan_gbp_to_attr(struct ofpbuf *a, const void *data_)
545
+@@ -3831,6 +3902,21 @@ vxlan_gbp_to_attr(struct ofpbuf *a, const void *data_)
649 546
  }
650 547
  
651 548
  static void
@@ -667,7 +564,7 @@ index b4689cc..7983720 100644
667 564
  geneve_to_attr(struct ofpbuf *a, const void *data_)
668 565
  {
669 566
      const struct geneve_scan *geneve = data_;
670
-@@ -4031,6 +4117,7 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names,
567
+@@ -4066,6 +4152,7 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names,
671 568
          SCAN_FIELD_NESTED("tp_src=", ovs_be16, be16, OVS_TUNNEL_KEY_ATTR_TP_SRC);
672 569
          SCAN_FIELD_NESTED("tp_dst=", ovs_be16, be16, OVS_TUNNEL_KEY_ATTR_TP_DST);
673 570
          SCAN_FIELD_NESTED_FUNC("vxlan(gbp(", uint32_t, vxlan_gbp, vxlan_gbp_to_attr);
@@ -675,35 +572,20 @@ index b4689cc..7983720 100644
675 572
          SCAN_FIELD_NESTED_FUNC("geneve(", struct geneve_scan, geneve,
676 573
                                 geneve_to_attr);
677 574
          SCAN_FIELD_NESTED_FUNC("flags(", uint16_t, tun_flags, tun_flags_to_attr);
678
-diff --git a/lib/packets.h b/lib/packets.h
679
-index a8ea24b..dc97333 100644
680
---- a/lib/packets.h
681
-+++ b/lib/packets.h
682
-@@ -49,7 +49,9 @@ struct flow_tnl {
683
-     ovs_be16 tp_dst;
684
-     ovs_be16 gbp_id;
685
-     uint8_t  gbp_flags;
686
--    uint8_t  pad1[5];        /* Pad to 64 bits. */
687
-+    uint8_t  gpe_np;
688
-+    uint8_t  gpe_flags;
689
-+    uint8_t  pad1[3];        /* Pad to 64 bits. */
690
-     struct tun_metadata metadata;
691
- };
692
- 
693 575
 diff --git a/tests/ofproto.at b/tests/ofproto.at
694
-index fbb6d71..6c7217d 100644
576
+index 6e55270..7b7f02b 100644
695 577
 --- a/tests/ofproto.at
696 578
 +++ b/tests/ofproto.at
697
-@@ -1775,7 +1775,7 @@ head_table () {
579
+@@ -2190,7 +2190,7 @@ head_table () {
698 580
        instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
699 581
        Write-Actions and Apply-Actions features:
700 582
          actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
701 583
 -        supported on Set-Field: tun_id tun_src tun_dst tun_ipv6_src tun_ipv6_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 dnl
702 584
 +        supported on Set-Field: tun_id tun_src tun_dst tun_ipv6_src tun_ipv6_dst tun_flags tun_gbp_id tun_gbp_flags tun_gpe_np tun_gpe_flags tun_metadata0 dnl
703 585
  tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 dnl
704
- metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc mpls_ttl ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll
586
+ metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 reg10 reg11 reg12 reg13 reg14 reg15 xreg0 xreg1 xreg2 xreg3 xreg4 xreg5 xreg6 xreg7 xxreg0 xxreg1 xxreg2 xxreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc mpls_ttl ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll
705 587
      matching:
706
-@@ -1790,6 +1790,8 @@ metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4
588
+@@ -2205,6 +2205,8 @@ metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4
707 589
        tun_flags: arbitrary mask
708 590
        tun_gbp_id: arbitrary mask
709 591
        tun_gbp_flags: arbitrary mask
@@ -713,7 +595,7 @@ index fbb6d71..6c7217d 100644
713 595
        tun_metadata1: arbitrary mask
714 596
        tun_metadata2: arbitrary mask
715 597
 diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
716
-index f26f622..dde603d 100644
598
+index cbb818e..2267be0 100644
717 599
 --- a/tests/ovs-ofctl.at
718 600
 +++ b/tests/ovs-ofctl.at
719 601
 @@ -17,6 +17,10 @@ for test_case in \
@@ -728,5 +610,5 @@ index f26f622..dde603d 100644
728 610
      'tun_metadata0=0/0x1                         NXM,OXM' \
729 611
      'tun_metadata0                               NXM,OXM' \
730 612
 -- 
731
-1.9.3
613
+2.1.0
732 614
 

ovs_build/ovs_nsh_patches/v2.6.1/0002-Add-NSH-support-in-kernel-and-userspace-data-planes.patch
File diff suppressed because it is too large
View File


ovs_build/patches/0004-Fix-too-large-stack-frame-size.patch → ovs_build/ovs_nsh_patches/v2.6.1/0003-Fix-too-large-stack-frame-size.patch View File

@@ -1,7 +1,7 @@
1
-From e6f9b1f96a3ac4066c9d7d4c0a9da7e8abb1597f Mon Sep 17 00:00:00 2001
1
+From 9bd18a89542f910ce12b09fe3e03f08a22b691dd Mon Sep 17 00:00:00 2001
2 2
 From: Yi Yang <yi.y.yang@intel.com>
3
-Date: Wed, 13 Apr 2016 18:17:21 +0800
4
-Subject: [PATCH 4/6] Fix too large stack frame size
3
+Date: Mon, 14 Nov 2016 13:12:51 +0800
4
+Subject: [PATCH 3/8] Fix too large stack frame size
5 5
 
6 6
 Signed-off-by: Yi Yang <yi.y.yang@intel.com>
7 7
 ---
@@ -9,10 +9,10 @@ Signed-off-by: Yi Yang <yi.y.yang@intel.com>
9 9
  1 file changed, 78 insertions(+), 14 deletions(-)
10 10
 
11 11
 diff --git a/datapath/datapath.c b/datapath/datapath.c
12
-index 5bec072..4baf242 100644
12
+index db8a18a..ae6555f 100644
13 13
 --- a/datapath/datapath.c
14 14
 +++ b/datapath/datapath.c
15
-@@ -928,7 +928,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
15
+@@ -939,7 +939,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
16 16
  	struct sw_flow_mask mask;
17 17
  	struct sk_buff *reply;
18 18
  	struct datapath *dp;
@@ -21,7 +21,7 @@ index 5bec072..4baf242 100644
21 21
  	struct sw_flow_actions *acts;
22 22
  	struct sw_flow_match match;
23 23
  	u32 ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]);
24
-@@ -946,6 +946,12 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
24
+@@ -957,6 +957,12 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
25 25
  		goto error;
26 26
  	}
27 27
  
@@ -34,7 +34,7 @@ index 5bec072..4baf242 100644
34 34
  	/* Most of the time we need to allocate a new flow, do it before
35 35
  	 * locking.
36 36
  	 */
37
-@@ -956,17 +962,17 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
37
+@@ -967,17 +973,17 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
38 38
  	}
39 39
  
40 40
  	/* Extract key. */
@@ -55,7 +55,7 @@ index 5bec072..4baf242 100644
55 55
  	if (error)
56 56
  		goto err_kfree_flow;
57 57
  
58
-@@ -996,7 +1002,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
58
+@@ -1007,7 +1013,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
59 59
  	if (ovs_identifier_is_ufid(&new_flow->id))
60 60
  		flow = ovs_flow_tbl_lookup_ufid(&dp->table, &new_flow->id);
61 61
  	if (!flow)
@@ -64,7 +64,7 @@ index 5bec072..4baf242 100644
64 64
  	if (likely(!flow)) {
65 65
  		rcu_assign_pointer(new_flow->sf_acts, acts);
66 66
  
67
-@@ -1066,6 +1072,10 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
67
+@@ -1077,6 +1083,10 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
68 68
  
69 69
  	if (reply)
70 70
  		ovs_notify(&dp_flow_genl_family, &ovs_dp_flow_multicast_group, reply, info);
@@ -75,7 +75,7 @@ index 5bec072..4baf242 100644
75 75
  	return 0;
76 76
  
77 77
  err_unlock_ovs:
78
-@@ -1076,6 +1086,10 @@ err_kfree_acts:
78
+@@ -1087,6 +1097,10 @@ err_kfree_acts:
79 79
  err_kfree_flow:
80 80
  	ovs_flow_free(new_flow, false);
81 81
  error:
@@ -86,7 +86,7 @@ index 5bec072..4baf242 100644
86 86
  	return error;
87 87
  }
88 88
  
89
-@@ -1106,7 +1120,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
89
+@@ -1117,7 +1131,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
90 90
  	struct net *net = sock_net(skb->sk);
91 91
  	struct nlattr **a = info->attrs;
92 92
  	struct ovs_header *ovs_header = info->userhdr;
@@ -95,7 +95,7 @@ index 5bec072..4baf242 100644
95 95
  	struct sw_flow *flow;
96 96
  	struct sw_flow_mask mask;
97 97
  	struct sk_buff *reply = NULL;
98
-@@ -1119,6 +1133,12 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
98
+@@ -1130,9 +1144,15 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
99 99
  	bool log = !a[OVS_FLOW_ATTR_PROBE];
100 100
  	bool ufid_present;
101 101
  
@@ -105,28 +105,23 @@ index 5bec072..4baf242 100644
105 105
 +               goto error;
106 106
 +        }
107 107
 +
108
- 	/* Extract key. */
109
- 	error = -EINVAL;
110
- 	if (!a[OVS_FLOW_ATTR_KEY]) {
111
-@@ -1127,7 +1147,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
112
- 	}
113
- 
114 108
  	ufid_present = ovs_nla_get_ufid(&sfid, a[OVS_FLOW_ATTR_UFID], log);
115
--	ovs_match_init(&match, &key, &mask);
116
-+	ovs_match_init(&match, key, &mask);
117
- 	error = ovs_nla_get_match(net, &match, a[OVS_FLOW_ATTR_KEY],
118
- 				  a[OVS_FLOW_ATTR_MASK], log);
119
- 	if (error)
120
-@@ -1135,7 +1155,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
109
+ 	if (a[OVS_FLOW_ATTR_KEY]) {
110
+-		ovs_match_init(&match, &key, &mask);
111
++		ovs_match_init(&match, key, &mask);
112
+ 		error = ovs_nla_get_match(net, &match, a[OVS_FLOW_ATTR_KEY],
113
+ 					  a[OVS_FLOW_ATTR_MASK], log);
114
+ 	} else if (!ufid_present) {
115
+@@ -1152,7 +1172,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
116
+ 			goto error;
117
+ 		}
121 118
  
122
- 	/* Validate actions. */
123
- 	if (a[OVS_FLOW_ATTR_ACTIONS]) {
124 119
 -		acts = get_flow_actions(net, a[OVS_FLOW_ATTR_ACTIONS], &key,
125 120
 +		acts = get_flow_actions(net, a[OVS_FLOW_ATTR_ACTIONS], key,
126 121
  					&mask, log);
127 122
  		if (IS_ERR(acts)) {
128 123
  			error = PTR_ERR(acts);
129
-@@ -1203,6 +1223,10 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
124
+@@ -1220,6 +1240,10 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
130 125
  	if (old_acts)
131 126
  		ovs_nla_free_flow_actions_rcu(old_acts);
132 127
  
@@ -137,7 +132,7 @@ index 5bec072..4baf242 100644
137 132
  	return 0;
138 133
  
139 134
  err_unlock_ovs:
140
-@@ -1211,6 +1235,10 @@ err_unlock_ovs:
135
+@@ -1228,6 +1252,10 @@ err_unlock_ovs:
141 136
  err_kfree_acts:
142 137
  	ovs_nla_free_flow_actions(acts);
143 138
  error:
@@ -148,7 +143,7 @@ index 5bec072..4baf242 100644
148 143
  	return error;
149 144
  }
150 145
  
151
-@@ -1219,7 +1247,7 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
146
+@@ -1236,7 +1264,7 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
152 147
  	struct nlattr **a = info->attrs;
153 148
  	struct ovs_header *ovs_header = info->userhdr;
154 149
  	struct net *net = sock_net(skb->sk);
@@ -157,7 +152,7 @@ index 5bec072..4baf242 100644
157 152
  	struct sk_buff *reply;
158 153
  	struct sw_flow *flow;
159 154
  	struct datapath *dp;
160
-@@ -1230,9 +1258,15 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
155
+@@ -1247,9 +1275,15 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
161 156
  	bool log = !a[OVS_FLOW_ATTR_PROBE];
162 157
  	bool ufid_present;
163 158
  
@@ -174,7 +169,7 @@ index 5bec072..4baf242 100644
174 169
  		err = ovs_nla_get_match(net, &match, a[OVS_FLOW_ATTR_KEY], NULL,
175 170
  					log);
176 171
  	} else if (!ufid_present) {
177
-@@ -1240,9 +1274,13 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
172
+@@ -1257,9 +1291,13 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
178 173
  			  "Flow get message rejected, Key attribute missing.");
179 174
  		err = -EINVAL;
180 175
  	}
@@ -190,7 +185,7 @@ index 5bec072..4baf242 100644
190 185
  	ovs_lock();
191 186
  	dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
192 187
  	if (!dp) {
193
-@@ -1267,9 +1305,17 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
188
+@@ -1284,9 +1322,17 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
194 189
  	}
195 190
  
196 191
  	ovs_unlock();
@@ -208,7 +203,7 @@ index 5bec072..4baf242 100644
208 203
  	return err;
209 204
  }
210 205
  
211
-@@ -1278,7 +1324,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
206
+@@ -1295,7 +1341,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
212 207
  	struct nlattr **a = info->attrs;
213 208
  	struct ovs_header *ovs_header = info->userhdr;
214 209
  	struct net *net = sock_net(skb->sk);
@@ -217,7 +212,7 @@ index 5bec072..4baf242 100644
217 212
  	struct sk_buff *reply;
218 213
  	struct sw_flow *flow = NULL;
219 214
  	struct datapath *dp;
220
-@@ -1289,12 +1335,22 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
215
+@@ -1306,12 +1352,22 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
221 216
  	bool log = !a[OVS_FLOW_ATTR_PROBE];
222 217
  	bool ufid_present;
223 218
  
@@ -241,7 +236,7 @@ index 5bec072..4baf242 100644
241 236
  			return err;
242 237
  	}
243 238
  
244
-@@ -1344,9 +1400,17 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
239
+@@ -1361,9 +1417,17 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
245 240
  	}
246 241
  
247 242
  	ovs_flow_free(flow, true);
@@ -260,5 +255,5 @@ index 5bec072..4baf242 100644
260 255
  }
261 256
  
262 257
 -- 
263
-1.9.3
258
+2.1.0
264 259
 

+ 127
- 0
ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch View File

@@ -0,0 +1,127 @@
1
+From 861f91c172c97b3ea787a1ad30617f31d77f1379 Mon Sep 17 00:00:00 2001
2
+From: Yi Yang <yi.y.yang@intel.com>
3
+Date: Wed, 30 Nov 2016 10:22:57 +0800
4
+Subject: [PATCH 4/8] Fix vxlangpe issues on DPDK netdev
5
+
6
+ - Fix a potential deadlock issue
7
+ - Use Ethernet header before NSH header in VxLAN-gpe
8
+   to ensure we have uniform behaviour in OVS DPDK and
9
+   OVS
10
+ - Correct VxLAN-gpe check in netdev_vxlan_pop_header
11
+
12
+Signed-off-by: Yi Yang <yi.y.yang@intel.com>
13
+---
14
+ lib/dpif-netdev.c       |  5 +----
15
+ lib/netdev-native-tnl.c |  9 +++++----
16
+ lib/netdev-vport.c      | 10 ++++++++++
17
+ lib/netdev-vport.h      |  2 ++
18
+ ofproto/tunnel.c        |  1 -
19
+ 5 files changed, 18 insertions(+), 9 deletions(-)
20
+
21
+diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
22
+index c779c78..257a174 100644
23
+--- a/lib/dpif-netdev.c
24
++++ b/lib/dpif-netdev.c
25
+@@ -1217,11 +1217,8 @@ static void add_vxlan_gpe_exts(struct netdev *netdev, uint32_t exts)
26
+ {
27
+     const char *type = netdev_get_type(netdev);
28
+     if (!strcmp(type, "vxlan")) {
29
+-        struct netdev_tunnel_config *cfg;
30
+-        cfg = netdev_get_tunnel_config(netdev);
31
+-
32
+         if(exts & (1 << OVS_VXLAN_EXT_GPE))
33
+-            cfg->exts |= (1 << OVS_VXLAN_EXT_GPE);
34
++            netdev_set_tunnel_config_exts(netdev, exts);
35
+     }
36
+ }
37
+ 
38
+diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
39
+index 2fe2722..a677ec8 100644
40
+--- a/lib/netdev-native-tnl.c
41
++++ b/lib/netdev-native-tnl.c
42
+@@ -243,6 +243,7 @@ eth_build_header(struct ovs_action_push_tnl *data,
43
+     uint16_t eth_proto = params->is_ipv6 ? ETH_TYPE_IPV6 : ETH_TYPE_IP;
44
+     struct eth_header *eth;
45
+ 
46
++    data->exts = 0;
47
+     memset(data->header, 0, sizeof data->header);
48
+ 
49
+     eth = (struct eth_header *)data->header;
50
+@@ -499,9 +500,9 @@ netdev_vxlan_pop_header(struct dp_packet *packet)
51
+     flag = get_16aligned_be32(&vxh->vx_flags);
52
+     vni = get_16aligned_be32(&vxh->vx_vni);
53
+ 
54
+-    if (flag & VXLAN_HF_GPE) {
55
+-        flag &= ~VXLAN_GPE_USED_BITS;
56
+-        if ((flag & ~VXLAN_GPE_USED_BITS) ||
57
++    if (flag & htonl(VXLAN_HF_GPE)) {
58
++        flag &= htonl(~VXLAN_GPE_USED_BITS);
59
++        if ((flag != htonl(VXLAN_FLAGS)) ||
60
+             (vni & htonl(0xff))) {
61
+ 
62
+             VLOG_WARN_RL(&err_rl, "invalid vxlan flags=%#x vni=%#x\n for vxlan-gpe",
63
+@@ -578,7 +579,7 @@ netdev_vxlan_build_header(const struct netdev *netdev,
64
+         put_16aligned_be32(&vxh->vx_vni, htonl(ntohll(params->flow->tunnel.tun_id) << 8));
65
+ 
66
+         if (!params->flow->tunnel.gpe_np)
67
+-            return -1;
68
++            gpe->next_protocol = VXLAN_GPE_NP_ETHERNET;
69
+         else
70
+             gpe->next_protocol = params->flow->tunnel.gpe_np;
71
+ 
72
+diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
73
+index 841a070..0aca632 100644
74
+--- a/lib/netdev-vport.c
75
++++ b/lib/netdev-vport.c
76
+@@ -85,6 +85,16 @@ get_netdev_tunnel_config(const struct netdev *netdev)
77
+     return &netdev_vport_cast(netdev)->tnl_cfg;
78
+ }
79
+ 
80
++void netdev_set_tunnel_config_exts(struct netdev *netdev, uint32_t exts)
81
++{
82
++    struct netdev_vport *dev = netdev_vport_cast(netdev);
83
++    dev->tnl_cfg.exts = exts;
84
++    ovs_mutex_lock(&dev->mutex);
85
++    tunnel_check_status_change__(dev);
86
++    netdev_change_seq_changed(netdev);
87
++    ovs_mutex_unlock(&dev->mutex);
88
++}
89
++
90
+ bool
91
+ netdev_vport_is_patch(const struct netdev *netdev)
92
+ {
93
+diff --git a/lib/netdev-vport.h b/lib/netdev-vport.h
94
+index b19cbd2..e093dde 100644
95
+--- a/lib/netdev-vport.h
96
++++ b/lib/netdev-vport.h
97
+@@ -19,6 +19,7 @@
98
+ 
99
+ #include <stdbool.h>
100
+ #include <stddef.h>
101
++#include <inttypes.h>
102
+ #include "compiler.h"
103
+ 
104
+ struct dpif_netlink_vport;
105
+@@ -42,6 +43,7 @@ void netdev_vport_inc_tx(const struct netdev *,
106
+ 
107
+ bool netdev_vport_is_vport_class(const struct netdev_class *);
108
+ const char *netdev_vport_class_get_dpif_port(const struct netdev_class *);
109
++void netdev_set_tunnel_config_exts(struct netdev *netdev, uint32_t exts);
110
+ 
111
+ #ifndef _WIN32
112
+ enum { NETDEV_VPORT_NAME_BUFSIZE = 16 };
113
+diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
114
+index acaec82..9a69071 100644
115
+--- a/ofproto/tunnel.c
116
++++ b/ofproto/tunnel.c
117
+@@ -701,7 +701,6 @@ tnl_port_build_header(const struct ofport_dpif *ofport,
118
+     tnl_port = tnl_find_ofport(ofport);
119
+     ovs_assert(tnl_port);
120
+     res = netdev_build_header(tnl_port->netdev, data, params);
121
+-    data->exts = 0;
122
+     fat_rwlock_unlock(&rwlock);
123
+ 
124
+     return res;
125
+-- 
126
+2.1.0
127
+

+ 197
- 0
ovs_build/ovs_nsh_patches/v2.6.1/0005-Change-match-field-IDs-and-action-IDs-to-adapt-to-OD.patch View File

@@ -0,0 +1,197 @@
1
+From b6fb68aaf672af71e60ecff9b6b03f1d5f42be0c Mon Sep 17 00:00:00 2001
2
+From: Yi Yang <yi.y.yang@intel.com>
3
+Date: Wed, 30 Nov 2016 12:22:19 +0800
4
+Subject: [PATCH 5/8] Change match field IDs and action IDs to adapt to ODL
5
+
6
+Signed-off-by: Yi Yang <yi.y.yang@intel.com>
7
+---
8
+ include/openvswitch/meta-flow.h | 42 ++++++++++++++++++++---------------------
9
+ lib/ofp-actions.c               | 10 +++++-----
10
+ 2 files changed, 26 insertions(+), 26 deletions(-)
11
+
12
+diff --git a/include/openvswitch/meta-flow.h b/include/openvswitch/meta-flow.h
13
+index fa4129c..190c3d6 100644
14
+--- a/include/openvswitch/meta-flow.h
15
++++ b/include/openvswitch/meta-flow.h
16
+@@ -502,7 +502,7 @@ enum OVS_PACKED_ENUM mf_field_id {
17
+      * Formatting: hexadecimal.
18
+      * Prerequisites: none.
19
+      * Access: read/write.
20
+-     * NXM: NXM_NX_TUN_GPE_NP(200) since v2.4.
21
++     * NXM: NXM_NX_TUN_GPE_NP(111) since v2.4.
22
+      * OXM: none.
23
+      */
24
+     MFF_TUN_GPE_NP,
25
+@@ -516,7 +516,7 @@ enum OVS_PACKED_ENUM mf_field_id {
26
+      * Formatting: hexadecimal.
27
+      * Prerequisites: none.
28
+      * Access: read/write.
29
+-     * NXM: NXM_NX_TUN_GPE_FLAGS(201) since v2.4.
30
++     * NXM: NXM_NX_TUN_GPE_FLAGS(112) since v2.4.
31
+      * OXM: none.
32
+      */
33
+     MFF_TUN_GPE_FLAGS,
34
+@@ -966,14 +966,14 @@ enum OVS_PACKED_ENUM mf_field_id {
35
+      * Formatting: hexadecimal.
36
+      * Prerequisites: none.
37
+      * Access: read/write.
38
+-     * NXM: NXM_NX_XXREG0(111) since v2.6.              <0>
39
+-     * NXM: NXM_NX_XXREG1(112) since v2.6.              <1>
40
+-     * NXM: NXM_NX_XXREG2(113) since v2.6.              <2>
41
+-     * NXM: NXM_NX_XXREG3(114) since v2.6.              <3>
42
+-     * NXM: NXM_NX_XXREG4(115) since vX.Y.              <4>
43
+-     * NXM: NXM_NX_XXREG5(116) since vX.Y.              <5>
44
+-     * NXM: NXM_NX_XXREG6(117) since vX.Y.              <6>
45
+-     * NXM: NXM_NX_XXREG7(118) since vX.Y.              <7>
46
++     * NXM: NXM_NX_XXREG0(124) since v2.6.              <0>
47
++     * NXM: NXM_NX_XXREG1(125) since v2.6.              <1>
48
++     * NXM: NXM_NX_XXREG2(126) since v2.6.              <2>
49
++     * NXM: NXM_NX_XXREG3(127) since v2.6.              <3>
50
++     * NXM: NXM_NX_XXREG4(128) since vX.Y.              <4>
51
++     * NXM: NXM_NX_XXREG5(129) since vX.Y.              <5>
52
++     * NXM: NXM_NX_XXREG6(130) since vX.Y.              <6>
53
++     * NXM: NXM_NX_XXREG7(131) since vX.Y.              <7>
54
+      * OXM: none.
55
+      */
56
+     MFF_XXREG0,
57
+@@ -1813,7 +1813,7 @@ enum OVS_PACKED_ENUM mf_field_id {
58
+      * Formatting: hexadecimal.
59
+      * Prerequisites: none.
60
+      * Access: read/write.
61
+-     * NXM: NXM_NX_NSP(202) since v1.1.
62
++     * NXM: NXM_NX_NSP(113) since v1.1.
63
+      * OXM: none.
64
+      * Prefix lookup member: nsp.
65
+      */
66
+@@ -1829,7 +1829,7 @@ enum OVS_PACKED_ENUM mf_field_id {
67
+      * Formatting: decimal.
68
+      * Prerequisites: none.
69
+      * Access: read/write.
70
+-     * NXM: NXM_NX_NSI(203) since v1.1.
71
++     * NXM: NXM_NX_NSI(114) since v1.1.
72
+      * OXM: none.
73
+      * Prefix lookup member: nsi.
74
+      */
75
+@@ -1846,7 +1846,7 @@ enum OVS_PACKED_ENUM mf_field_id {
76
+      * Formatting: hexadecimal.
77
+      * Prerequisites: none.
78
+      * Access: read/write.
79
+-     * NXM: NXM_NX_NSH_C1(204) since v1.1.
80
++     * NXM: NXM_NX_NSH_C1(115) since v1.1.
81
+      * OXM: none.
82
+      * Prefix lookup member: nshc1.
83
+      */
84
+@@ -1863,7 +1863,7 @@ enum OVS_PACKED_ENUM mf_field_id {
85
+      * Formatting: hexadecimal.
86
+      * Prerequisites: none.
87
+      * Access: read/write.
88
+-     * NXM: NXM_NX_NSH_C2(205) since v1.1.
89
++     * NXM: NXM_NX_NSH_C2(116) since v1.1.
90
+      * OXM: none.
91
+      * Prefix lookup member: nshc2.
92
+      */
93
+@@ -1880,7 +1880,7 @@ enum OVS_PACKED_ENUM mf_field_id {
94
+      * Formatting: hexadecimal.
95
+      * Prerequisites: none.
96
+      * Access: read/write.
97
+-     * NXM: NXM_NX_NSH_C3(206) since v1.1.
98
++     * NXM: NXM_NX_NSH_C3(117) since v1.1.
99
+      * OXM: none.
100
+      * Prefix lookup member: nshc3.
101
+      */
102
+@@ -1897,7 +1897,7 @@ enum OVS_PACKED_ENUM mf_field_id {
103
+      * Formatting: hexadecimal.
104
+      * Prerequisites: none.
105
+      * Access: read/write.
106
+-     * NXM: NXM_NX_NSH_C4(207) since v1.1.
107
++     * NXM: NXM_NX_NSH_C4(118) since v1.1.
108
+      * OXM: none.
109
+      * Prefix lookup member: nshc4.
110
+      */
111
+@@ -1913,7 +1913,7 @@ enum OVS_PACKED_ENUM mf_field_id {
112
+      * Formatting: decimal.
113
+      * Prerequisites: none.
114
+      * Access: read/write.
115
+-     * NXM: NXM_NX_NSH_MDTYPE(208) since v1.1.
116
++     * NXM: NXM_NX_NSH_MDTYPE(119) since v1.1.
117
+      * OXM: none.
118
+      */
119
+     MFF_NSH_MDTYPE,
120
+@@ -1928,7 +1928,7 @@ enum OVS_PACKED_ENUM mf_field_id {
121
+       * Formatting: decimal.
122
+       * Prerequisites: none.
123
+       * Access: read/write.
124
+-      * NXM: NXM_NX_NSH_NP(209) since v1.1.
125
++      * NXM: NXM_NX_NSH_NP(120) since v1.1.
126
+       * OXM: none.
127
+       */
128
+      MFF_NSH_NP,
129
+@@ -1942,7 +1942,7 @@ enum OVS_PACKED_ENUM mf_field_id {
130
+      * Formatting: Ethernet.
131
+      * Prerequisites: none.
132
+      * Access: read/write.
133
+-     * NXM: NXM_NX_ENCAP_ETH_SRC(210) since v1.1.
134
++     * NXM: NXM_NX_ENCAP_ETH_SRC(121) since v1.1.
135
+      * OXM: none.
136
+      */
137
+     MFF_ENCAP_ETH_SRC,
138
+@@ -1956,7 +1956,7 @@ enum OVS_PACKED_ENUM mf_field_id {
139
+      * Formatting: Ethernet.
140
+      * Prerequisites: none.
141
+      * Access: read/write.
142
+-     * NXM: NXM_NX_ENCAP_ETH_DST(211) since v1.1.
143
++     * NXM: NXM_NX_ENCAP_ETH_DST(122) since v1.1.
144
+      * OXM: none.
145
+      */
146
+     MFF_ENCAP_ETH_DST,
147
+@@ -1970,7 +1970,7 @@ enum OVS_PACKED_ENUM mf_field_id {
148
+      * Formatting: hexadecimal.
149
+      * Prerequisites: none.
150
+      * Access: read-only.
151
+-     * NXM: NXM_NX_ENCAP_ETH_TYPE(212) since v1.1.
152
++     * NXM: NXM_NX_ENCAP_ETH_TYPE(123) since v1.1.
153
+      * OXM: none.
154
+      */
155
+     MFF_ENCAP_ETH_TYPE,
156
+diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
157
+index 2935ca6..4939ef2 100644
158
+--- a/lib/ofp-actions.c
159
++++ b/lib/ofp-actions.c
160
+@@ -196,7 +196,7 @@ enum ofp_raw_action_type {
161
+     /* NX1.0(4), OF1.1+(21): uint32_t. */
162
+     OFPAT_RAW_SET_QUEUE,
163
+ 
164
+-    /* NX1.0(40), OF1.1+(22): uint32_t. */
165
++    /* NX1.0(42), OF1.1+(22): uint32_t. */
166
+     OFPAT_RAW_GROUP,
167
+ 
168
+     /* OF1.1+(23): uint8_t. */
169
+@@ -289,7 +289,7 @@ enum ofp_raw_action_type {
170
+ 
171
+     /* NX1.0+(29): struct nx_action_sample. */
172
+     NXAST_RAW_SAMPLE,
173
+-    /* NX1.0+(38): struct nx_action_sample2. */
174
++    /* NX1.0+(40): struct nx_action_sample2. */
175
+     NXAST_RAW_SAMPLE2,
176
+ 
177
+     /* NX1.0+(34): struct nx_action_conjunction. */
178
+@@ -301,13 +301,13 @@ enum ofp_raw_action_type {
179
+     /* NX1.0+(36): struct nx_action_nat, ... */
180
+     NXAST_RAW_NAT,
181
+ 
182
+-    /* NX1.0+(39): struct nx_action_output_trunc. */
183
++    /* NX1.0+(41): struct nx_action_output_trunc. */
184
+     NXAST_RAW_OUTPUT_TRUNC,
185
+ 
186
+-    /* NX1.0+(200): void. */
187
++    /* NX1.0+(38): void. */
188
+     NXAST_RAW_PUSH_NSH,
189
+ 
190
+-    /* NX1.0+(201): void. */
191
++    /* NX1.0+(39): void. */
192
+     NXAST_RAW_POP_NSH,
193
+ 
194
+ /* ## ------------------ ## */
195
+-- 
196
+2.1.0
197
+

+ 31
- 0
ovs_build/ovs_nsh_patches/v2.6.1/0006-To-be-compatible-with-vpp_nsh.patch View File

@@ -0,0 +1,31 @@
1
+From 622fe1bb00d38a70110d838eecc9e10c0d62cf7c Mon Sep 17 00:00:00 2001
2
+From: Yi Yang <yi.y.yang@intel.com>
3
+Date: Wed, 30 Nov 2016 17:27:11 +0800
4
+Subject: [PATCH 6/8] To be compatible with vpp_nsh
5
+
6
+Signed-off-by: Yi Yang <yi.y.yang@intel.com>
7
+---
8
+ lib/netdev-native-tnl.c | 7 ++++---
9
+ 1 file changed, 4 insertions(+), 3 deletions(-)
10
+
11
+diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
12
+index a677ec8..2dd4954 100644
13
+--- a/lib/netdev-native-tnl.c
14
++++ b/lib/netdev-native-tnl.c
15
+@@ -578,9 +578,10 @@ netdev_vxlan_build_header(const struct netdev *netdev,
16
+         put_16aligned_be32(&vxh->vx_flags, htonl(VXLAN_FLAGS | VXLAN_HF_GPE));
17
+         put_16aligned_be32(&vxh->vx_vni, htonl(ntohll(params->flow->tunnel.tun_id) << 8));
18
+ 
19
+-        if (!params->flow->tunnel.gpe_np)
20
+-            gpe->next_protocol = VXLAN_GPE_NP_ETHERNET;
21
+-        else
22
++        if (!params->flow->tunnel.gpe_np) {
23
++            gpe->next_protocol = VXLAN_GPE_NP_NSH;
24
++            data->exts |= 1 << VXLAN_GPE_POP_ETH;
25
++        } else
26
+             gpe->next_protocol = params->flow->tunnel.gpe_np;
27
+ 
28
+         if (params->flow->tunnel.gpe_flags & 0x01)
29
+-- 
30
+2.1.0
31
+

+ 67
- 0
ovs_build/ovs_nsh_patches/v2.6.1/0007-Fix-struct-ovs_gso_cb-size-issue.patch View File

@@ -0,0 +1,67 @@
1
+From dfbdc2b4e12dd5e2aff617e1bc2757e9fc39d1f6 Mon Sep 17 00:00:00 2001
2
+From: Yi Yang <yi.y.yang@intel.com>
3
+Date: Thu, 1 Dec 2016 13:36:23 +0800
4
+Subject: [PATCH 7/8] Fix struct ovs_gso_cb size issue
5
+
6
+Signed-off-by: Yi Yang <yi.y.yang@intel.com>
7
+---
8
+ datapath/actions.c  | 6 +++---
9
+ datapath/datapath.h | 2 --
10
+ datapath/flow.c     | 2 --
11
+ 3 files changed, 3 insertions(+), 7 deletions(-)
12
+
13
+diff --git a/datapath/actions.c b/datapath/actions.c
14
+index c979596..936a015 100644
15
+--- a/datapath/actions.c
16
++++ b/datapath/actions.c
17
+@@ -278,6 +278,7 @@ static int pop_nsh(struct sk_buff *skb, struct sw_flow_key *key)
18
+ static int push_nsh(struct sk_buff *skb, struct sw_flow_key *key,
19
+ 		     const struct ovs_action_push_nsh *nsh)
20
+ {
21
++        struct encap_eth_hdr *encap_eth_header = NULL;
22
+ 
23
+ 	if (nsh->nsh_mdtype == NSH_M_TYPE1) {
24
+ 		if (skb_cow_head(skb, ETH_NSH_TYPE1_HEADER_SIZE) < 0) {
25
+@@ -285,10 +286,9 @@ static int push_nsh(struct sk_buff *skb, struct sw_flow_key *key,
26
+                 }
27
+ 
28
+ 		skb_push(skb, ETH_NSH_TYPE1_HEADER_SIZE);
29
+-		OVS_CB(skb)->encap_eth_header = (struct encap_eth_hdr *)skb->data;
30
+-		OVS_CB(skb)->nsh_header = (struct nsh_hdr *)(skb->data + ENCAP_ETH_LEN);
31
++		encap_eth_header = (struct encap_eth_hdr *)skb->data;
32
+ 		memcpy(skb->data, nsh->header, ETH_NSH_TYPE1_HEADER_SIZE);
33
+-                OVS_CB(skb)->encap_eth_header->encap_eth_type = htons(ETH_P_NSH);
34
++                encap_eth_header->encap_eth_type = htons(ETH_P_NSH);
35
+ 	}
36
+ 	else
37
+ 		return -EINVAL;
38
+diff --git a/datapath/datapath.h b/datapath/datapath.h
39
+index a6b2a44..22bbaac 100644
40
+--- a/datapath/datapath.h
41
++++ b/datapath/datapath.h
42
+@@ -108,8 +108,6 @@ struct ovs_skb_cb {
43
+ 	struct vport		*input_vport;
44
+ 	u16			mru;
45
+ 	u32			cutlen;
46
+-	struct nsh_hdr          *nsh_header;
47
+-	struct encap_eth_hdr    *encap_eth_header;
48
+ };
49
+ #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
50
+ 
51
+diff --git a/datapath/flow.c b/datapath/flow.c
52
+index 8c4d583..c712517 100644
53
+--- a/datapath/flow.c
54
++++ b/datapath/flow.c
55
+@@ -327,9 +327,7 @@ static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key)
56
+ static int parse_nsh(struct sk_buff *skb, struct sw_flow_key *key){
57
+         struct nsh_hdr *nsh_hdr = NULL;
58
+ 
59
+-        OVS_CB(skb)->encap_eth_header = (struct encap_eth_hdr *)skb->data;
60
+ 	nsh_hdr = (struct nsh_hdr *)((const char *)skb->data + ENCAP_ETH_LEN);
61
+-	OVS_CB(skb)->nsh_header = nsh_hdr;
62
+ 	memcpy(&key->nsh.encap_eth_dst, skb->data, ENCAP_ETH_LEN);
63
+ 	key->nsh.nsh_mdtype = nsh_hdr->base.mdtype;
64
+ 	if (key->nsh.nsh_mdtype != NSH_M_TYPE1)
65
+-- 
66
+2.1.0
67
+

+ 84
- 0
ovs_build/ovs_nsh_patches/v2.6.1/0008-tunnel-set-udp-dst-port-in-tunnel-metadata.patch View File

@@ -0,0 +1,84 @@
1
+From add8faa9d4e0b93ea2828d8932ccbc9b740518ae Mon Sep 17 00:00:00 2001
2
+From: Pravin B Shelar <pshelar@ovn.org>
3
+Date: Mon, 5 Dec 2016 18:22:11 -0800
4
+Subject: [PATCH 8/8] tunnel: set udp dst-port in tunnel metadata
5
+
6
+VxLan device expect valid tp-dst in tunnel metadata.
7
+Following patch sets consistent tp-dst with respect to
8
+the egress tunnel port.
9
+
10
+Reported-by: Gerhard Stenzel <gstenzel@linux.vnet.ibm.com>
11
+Tested-by: Gerhard Stenzel <gstenzel@linux.vnet.ibm.com>
12
+Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
13
+Acked-by: Jarno Rajahalme <jarno@ovn.org>
14
+---
15
+ ofproto/tunnel.c      | 1 +
16
+ tests/ofproto-dpif.at | 2 +-
17
+ tests/tunnel.at       | 8 ++++----
18
+ 3 files changed, 6 insertions(+), 5 deletions(-)
19
+
20
+diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
21
+index 9a69071..7277fa0 100644
22
+--- a/ofproto/tunnel.c
23
++++ b/ofproto/tunnel.c
24
+@@ -438,6 +438,7 @@ tnl_port_send(const struct ofport_dpif *ofport, struct flow *flow,
25
+     flow->pkt_mark |= tnl_port->match.pkt_mark;
26
+     wc->masks.pkt_mark |= tnl_port->match.pkt_mark;
27
+ 
28
++    flow->tunnel.tp_dst = cfg->dst_port;
29
+     if (!cfg->out_key_flow) {
30
+         flow->tunnel.tun_id = cfg->out_key;
31
+     }
32
+diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
33
+index a71282c..99db282 100644
34
+--- a/tests/ofproto-dpif.at
35
++++ b/tests/ofproto-dpif.at
36
+@@ -6340,7 +6340,7 @@ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:
37
+ dnl Make sure flow sample action in datapath is behind set tunnel
38
+ dnl action at egress point of tunnel port.
39
+ AT_CHECK([tail -1 stdout], [0], [dnl
40
+-Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=1),tunnel_out_port=1))),1,set(tunnel(tun_id=0x6,src=2.2.2.3,dst=1.1.1.2,tos=0x1,ttl=64,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=7471),tunnel_out_port=7471))),7471
41
++Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=1),tunnel_out_port=1))),1,set(tunnel(tun_id=0x6,src=2.2.2.3,dst=1.1.1.2,tos=0x1,ttl=64,tp_dst=7471,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=7471),tunnel_out_port=7471))),7471
42
+ ])
43
+ 
44
+ dnl Remove the flow which contains sample action.
45
+diff --git a/tests/tunnel.at b/tests/tunnel.at
46
+index eb429d3..03119bd 100644
47
+--- a/tests/tunnel.at
48
++++ b/tests/tunnel.at
49
+@@ -866,7 +866,7 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
50
+ dnl Option generation
51
+ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
52
+ AT_CHECK([tail -1 stdout], [0],
53
+-  [Datapath actions: set(tunnel(dst=1.1.1.1,ttl=64,geneve({class=0xffff,type=0,len=4,0xa}{class=0xffff,type=0x1,len=8,0x1234567890abcdef}),flags(df))),6081
54
++  [Datapath actions: set(tunnel(dst=1.1.1.1,ttl=64,tp_dst=6081,geneve({class=0xffff,type=0,len=4,0xa}{class=0xffff,type=0x1,len=8,0x1234567890abcdef}),flags(df))),6081
55
+ ])
56
+ 
57
+ dnl Option match
58
+@@ -955,7 +955,7 @@ Datapath actions: 2
59
+ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'recirc_id(0),tunnel(tun_id=0x0,src=1.1.1.1,dst=1.1.1.2,ttl=64,geneve({class=0xffff,type=1,len=0}),flags(df|key)),in_port(6081),skb_mark(0),eth_type(0x0800),ipv4(frag=no)'], [0], [stdout])
60
+ AT_CHECK([tail -2 stdout], [0],
61
+   [Megaflow: pkt_mark=0,recirc_id=0,ip,tun_id=0,tun_src=1.1.1.1,tun_dst=1.1.1.2,tun_tos=0,tun_flags=+df-csum+key,tun_metadata1,tun_metadata2=NP,in_port=1,nw_ecn=0,nw_frag=no
62
+-Datapath actions: set(tunnel(tun_id=0x0,dst=1.1.1.1,ttl=64,geneve({class=0xffff,type=0x1,len=0}),flags(df|key))),6081
63
++Datapath actions: set(tunnel(tun_id=0x0,dst=1.1.1.1,ttl=64,tp_dst=6081,geneve({class=0xffff,type=0x1,len=0}),flags(df|key))),6081
64
+ ])
65
+ 
66
+ OVS_VSWITCHD_STOP
67
+@@ -976,12 +976,12 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
68
+ 
69
+ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0,src=1.1.1.1,dst=1.1.1.2,ttl=64),in_port(4789)'], [0], [stdout])
70
+ AT_CHECK([tail -1 stdout], [0],
71
+-  [Datapath actions: set(tunnel(tun_id=0x0,ipv6_dst=2001:cafe::1,ttl=64,flags(df|key))),4789
72
++  [Datapath actions: set(tunnel(tun_id=0x0,ipv6_dst=2001:cafe::1,ttl=64,tp_dst=4789,flags(df|key))),4789
73
+ ])
74
+ 
75
+ AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,ipv6_src=2001:cafe::1,ipv6_dst=2001:cafe::2,ttl=64),in_port(4789)'], [0], [stdout])
76
+ AT_CHECK([tail -1 stdout], [0],
77
+-  [Datapath actions: set(tunnel(tun_id=0x0,dst=1.1.1.1,ttl=64,flags(df|key))),4789
78
++  [Datapath actions: set(tunnel(tun_id=0x0,dst=1.1.1.1,ttl=64,tp_dst=4789,flags(df|key))),4789
79
+ ])
80
+ 
81
+ 
82
+-- 
83
+2.1.0
84
+

+ 0
- 2326
ovs_build/patches/0003-Add-userspace-dataplane-nsh-support-and-remove-push_.patch
File diff suppressed because it is too large
View File


+ 0
- 73
ovs_build/patches/0005-Ethernet-header-must-be-kept-in-VxLAN-gpe-eth-NSH-fo.patch View File

@@ -1,74 +0,0 @@
1
-From 604bcfaf5211513f665ca05a370bc7f0c0dab39f Mon Sep 17 00:00:00 2001
2
-From: Yi Yang <yi.y.yang@intel.com>
3
-Date: Fri, 15 Apr 2016 14:17:54 +0800
4
-Subject: [PATCH 5/6] Ethernet header must be kept in VxLAN-gpe + eth + NSH for
5
- new ovs lwtunnel implementation
6
-
7
-Signed-off-by: Yi Yang <yi.y.yang@intel.com>
8
----
9
- datapath/linux/compat/vxlan.c | 16 ++++++++++------
10
- 1 file changed, 10 insertions(+), 6 deletions(-)
11
-
12
-diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
13
-index 888d431..3c05141 100644
14
---- a/datapath/linux/compat/vxlan.c
15
-+++ b/datapath/linux/compat/vxlan.c
16
-@@ -821,7 +821,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
17
- 	struct vxlan_dev *vxlan;
18
- 	struct pcpu_sw_netstats *stats;
19
- 	union vxlan_addr saddr;
20
--        struct eth_nsh_hdr *eth_nsh_header = NULL;
21
-+        //struct eth_nsh_hdr *eth_nsh_header = NULL;
22
- 	int err = 0;
23
- 
24
- 	/* For flow based devices, map all packets to VNI 0 */
25
-@@ -891,12 +891,13 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
26
- 	u64_stats_update_end(&stats->syncp);
27
- 
28
-         /* Add a faked encap_eth_header for NSH */
29
--        if (md && ((md->gpe & VXLAN_GPE_NP_MASK) == VXLAN_GPE_NP_NSH)) {
30
-+        /* ovs changes have ensured it is here, so needn't add it any more */
31
-+        /*if (md && ((md->gpe & VXLAN_GPE_NP_MASK) == VXLAN_GPE_NP_NSH)) {
32
-             skb_push(skb, ENCAP_ETH_LEN);
33
-             eth_nsh_header = (struct eth_nsh_hdr *)skb->data;
34
-             memmove(eth_nsh_header->encap_eth_header.encap_eth_dst, skb_mac_header(skb), ENCAP_ETH_LEN);
35
-             eth_nsh_header->encap_eth_header.encap_eth_type = htons(ETH_P_NSH);
36
--        }
37
-+        }*/
38
-  
39
- 	netdev_port_receive(skb, skb_tunnel_info(skb));
40
- 	return;
41
-@@ -985,7 +986,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
42
- 		struct vxlanhdr_gpe *gpe;
43
- 
44
- 		gpe = (struct vxlanhdr_gpe *)vxh;
45
--		md->gpe = ntohs(gpe->next_proto);
46
-+		md->gpe = gpe->next_proto;
47
- 
48
- 		buf.dst.u.tun_info.key.tun_flags |= TUNNEL_VXLAN_OPT;
49
- 
50
-@@ -1189,9 +1190,10 @@ static int vxlan_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *sk
51
- 	}
52
- 
53
-         /* Skip encap_eth_header on sending Eth+NSH to vxlan-gpe port */
54
--        if (md && ((md->gpe & VXLAN_GPE_NP_MASK) == VXLAN_GPE_NP_NSH)) {
55
-+        /* ovs needs to keep eth header here */
56
-+        /*if (md && ((md->gpe & VXLAN_GPE_NP_MASK) == VXLAN_GPE_NP_NSH)) {
57
-             skb_pull(skb, ENCAP_ETH_LEN);
58
--        }
59
-+        }*/
60
- 
61
- 	min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len
62
- 			+ VXLAN_HLEN + sizeof(struct iphdr)
63
-@@ -1236,6 +1238,8 @@ static int vxlan_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *sk
64
- 	}
65
- 	if (vxflags & VXLAN_F_GBP)
66
- 		vxlan_build_gbp_hdr(vxh, vxflags, md);
67
-+        else if (vxflags & VXLAN_F_GPE)
68
-+                vxlan_build_gpe_hdr(vxh, vxflags, md);
69
- 
70
- 	ovs_skb_set_inner_protocol(skb, htons(ETH_P_TEB));
71
- 
72
-1.9.3
73
-

+ 0
- 81
ovs_build/patches/0006-Fix-VxLAN-gpe-Eth-NSH-issues.patch View File

@@ -1,82 +0,0 @@
1
-From 16982ccaf9249550d01d1ef5d298f97ee6537eb0 Mon Sep 17 00:00:00 2001
2
-From: Yi Yang <yi.y.yang@intel.com>
3
-Date: Wed, 27 Apr 2016 14:50:29 +0800
4
-Subject: [PATCH 6/6] Fix VxLAN-gpe + Eth + NSH issues
5
-
6
- - Set encap_eth_type to 0x894F on doing push_nsh
7
-   in kernel data path
8
- - Set VxLAN-gpe next protocol present bit
9
-
10
-Signed-off-by: Yi Yang <yi.y.yang@intel.com>
11
----
12
- datapath/actions.c            | 1 +
13
- datapath/linux/compat/vxlan.c | 8 ++++----
14
- lib/flow.c                    | 2 +-
15
- lib/odp-util.c                | 2 +-
16
- 4 files changed, 7 insertions(+), 6 deletions(-)
17
-
18
-diff --git a/datapath/actions.c b/datapath/actions.c
19
-index 7072638..ffa1f04 100644
20
---- a/datapath/actions.c
21
-+++ b/datapath/actions.c
22
-@@ -275,6 +275,7 @@ static int push_nsh(struct sk_buff *skb, struct sw_flow_key *key,
23
- 		OVS_CB(skb)->encap_eth_header = (struct encap_eth_hdr *)skb->data;
24
- 		OVS_CB(skb)->nsh_header = (struct nsh_hdr *)(skb->data + ENCAP_ETH_LEN);
25
- 		memcpy(skb->data, nsh->header, ETH_NSH_TYPE1_HEADER_SIZE);
26
-+                OVS_CB(skb)->encap_eth_header->encap_eth_type = htons(ETH_P_NSH);
27
- 	}
28
- 	else
29
- 		return -EINVAL;
30
-diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
31
-index 3c05141..05fb226 100644
32
---- a/datapath/linux/compat/vxlan.c
33
-+++ b/datapath/linux/compat/vxlan.c
34
-@@ -1051,15 +1051,15 @@ static void vxlan_build_gpe_hdr(struct vxlanhdr *vxh, u32 vxflags,
35
- {
36
-        struct vxlanhdr_gpe *gpe;
37
- 
38
--       if (!md->gpe)
39
--               return;
40
--
41
-        gpe = (struct vxlanhdr_gpe*)vxh;
42
-        vxh->vx_flags |= htonl(VXLAN_HF_GPE);
43
- 
44
-        if (md->gpe & VXLAN_GPE_OAM_FLAG)
45
-                gpe->oam_flag = 1;
46
--       gpe->next_proto = md->gpe & VXLAN_GPE_NP_MASK;
47
-+       if (md->gpe == 0)
48
-+               gpe->next_proto = VXLAN_GPE_NP_NSH;
49
-+       else
50
-+               gpe->next_proto = md->gpe & VXLAN_GPE_NP_MASK;
51
- }
52
- 
53
- #if IS_ENABLED(CONFIG_IPV6)
54
-diff --git a/lib/flow.c b/lib/flow.c
55
-index 887b023..6710e20 100644
56
---- a/lib/flow.c
57
-+++ b/lib/flow.c
58
-@@ -915,7 +915,7 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata)
59
-     if (flow->tunnel.gbp_flags) {
60
-         match_set_tun_gbp_flags(flow_metadata, flow->tunnel.gbp_flags);
61
-     }
62
--    if (flow->tunnel.gpe_np != htons(0)) {
63
-+    if (flow->tunnel.gpe_np != 0) {
64
-         match_set_tun_gpe_np(flow_metadata, flow->tunnel.gpe_np);
65
-     }
66
-     if (flow->tunnel.gpe_flags) {
67
-diff --git a/lib/odp-util.c b/lib/odp-util.c
68
-index 7721cc4..51f0545 100644
69
---- a/lib/odp-util.c
70
-+++ b/lib/odp-util.c
71
-@@ -1982,7 +1982,7 @@ odp_tun_key_from_attr__(const struct nlattr *attr,
72
-             };
73
-             struct nlattr *ext[ARRAY_SIZE(vxlan_opts_policy)];
74
- 
75
--            if (!nl_parse_nested(a, vxlan_opts_policy, ext, ARRAY_SIZE(ext))) {
76
-+            if (!nl_parse_nested(a, vxlan_opts_policy, ext, ARRAY_SIZE(vxlan_opts_policy))) {
77
-                 return ODP_FIT_ERROR;
78
-             }
79
- 
80
-1.9.3
81
-

+ 0
- 1
ovs_build/patches/README View File

@@ -1 +0,0 @@
1
-The patches were copied from commit id 307b06d986a49698c01caa3d6ed62fd7dac83e87 in https://github.com/yyang13/ovs_nsh_patches

Loading…
Cancel
Save