summaryrefslogtreecommitdiff
path: root/ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch')
-rw-r--r--ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch127
1 files changed, 127 insertions, 0 deletions
diff --git a/ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch b/ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch
new file mode 100644
index 0000000..3b89a42
--- /dev/null
+++ b/ovs_build/ovs_nsh_patches/v2.6.1/0004-Fix-vxlangpe-issues-on-DPDK-netdev.patch
@@ -0,0 +1,127 @@
1From 861f91c172c97b3ea787a1ad30617f31d77f1379 Mon Sep 17 00:00:00 2001
2From: Yi Yang <yi.y.yang@intel.com>
3Date: Wed, 30 Nov 2016 10:22:57 +0800
4Subject: [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
12Signed-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
21diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
22index 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
38diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
39index 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
72diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
73index 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 {
93diff --git a/lib/netdev-vport.h b/lib/netdev-vport.h
94index 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 };
113diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
114index 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--
1262.1.0
127