Upstream commit:
udptunnels: Call handle_offloads after inserting vlan tag.
handle_offloads() calls skb_reset_inner_headers() to store
the layer pointers to the encapsulated packet. However, we
currently push the vlag tag (if there is one) onto the packet
afterwards. This changes the MAC header for the encapsulated
packet but it is not reflected in skb->inner_mac_header, which
breaks GSO and drivers which attempt to use this for encapsulation
offloads.
Fixes: b736a623 ("vxlan: Add tx-vlan offload support.")
Signed-off-by: Jesse Gross <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Upstream: 4aac884d ("udptunnels: Call handle_offloads after inserting vlan
tag.")
Signed-off-by: Jesse Gross <[email protected]>
---
datapath/linux/compat/geneve.c | 8 ++++----
datapath/linux/compat/vxlan.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
index 5fc6c67..48a306e 100644
--- a/datapath/linux/compat/geneve.c
+++ b/datapath/linux/compat/geneve.c
@@ -91,10 +91,6 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable
*rt,
int min_headroom;
int err;
- skb = udp_tunnel_handle_offloads(skb, csum, (opt_len == 0));
- if (IS_ERR(skb))
- return PTR_ERR(skb);
-
min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len
+ GENEVE_BASE_HLEN + opt_len + sizeof(struct iphdr)
+ (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
@@ -109,6 +105,10 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable
*rt,
if (unlikely(!skb))
return -ENOMEM;
+ skb = udp_tunnel_handle_offloads(skb, csum, (opt_len == 0));
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
gnvh = (struct genevehdr *)__skb_push(skb, sizeof(*gnvh) + opt_len);
geneve_build_header(gnvh, tun_flags, vni, opt_len, opt);
diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index 8af3433..51135fa 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -191,10 +191,6 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
int err;
bool udp_sum = !!(vxflags & VXLAN_F_UDP_CSUM);
- skb = udp_tunnel_handle_offloads(skb, udp_sum, true);
- if (IS_ERR(skb))
- return PTR_ERR(skb);
-
min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len
+ VXLAN_HLEN + sizeof(struct iphdr)
+ (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
@@ -210,6 +206,10 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
if (WARN_ON(!skb))
return -ENOMEM;
+ skb = udp_tunnel_handle_offloads(skb, udp_sum, true);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh));
vxh->vx_flags = htonl(VXLAN_HF_VNI);
vxh->vx_vni = md->vni;
--
1.9.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev