]> git.proxmox.com Git - ovs.git/commitdiff
datapath: Consistently set skb->inner_protocol for tunnels.
authorJesse Gross <jesse@nicira.com>
Wed, 18 Feb 2015 00:27:04 +0000 (16:27 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 20 Feb 2015 23:34:25 +0000 (15:34 -0800)
skb->inner_protocol is used by GSO and TSO for tunnels on new
kernels. Since we are setting up packets to be handled by the
kernel's GSO and not just our own, we need to initialize this
field properly.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/linux/compat/gre.c
datapath/linux/compat/ip_tunnels_core.c
datapath/linux/compat/vxlan.c
datapath/vport-lisp.c

index 7b77d23ed1b61e711ba03e899e574303ae8254bb..22bbf2fb4cf0241c93aea292f5d9b86e52d1acfb 100644 (file)
@@ -331,6 +331,8 @@ void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
                                                skb->len, 0));
                }
        }
+
+       ovs_skb_set_inner_protocol(skb, tpi->proto);
 }
 
 #endif /* CONFIG_NET_IPGRE_DEMUX */
index 70dd7ec58433faf6590b14aca15e0a57b096c4d5..5e38603b9228c7b987f056e461cd3fd4ccf5f58a 100644 (file)
@@ -174,6 +174,5 @@ bool skb_is_encapsulated(struct sk_buff *skb)
        /* checking for inner protocol should be sufficient on newer kernel, but
         * old kernel just set encapsulation bit.
         */
-       /* XXX: set inner protocol for all tunnel in OVS. */
        return ovs_skb_get_inner_protocol(skb) || skb_encapsulation(skb);
 }
index 7b25aaa02b94b537c6ca28113567e0afc373fb26..92b0c513446e381553c07f01e14c4022973f544d 100644 (file)
@@ -266,6 +266,8 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
        if (IS_ERR(skb))
                return PTR_ERR(skb);
 
+       ovs_skb_set_inner_protocol(skb, htons(ETH_P_TEB));
+
        return iptunnel_xmit(vs->sock->sk, rt, skb, src, dst, IPPROTO_UDP,
                             tos, ttl, df, xnet);
 }
index c7f8a9a340d633566ae69016429997c4280f85ae..10369dca66c295e7c21b8e9c9235b20ac60f5a41 100644 (file)
@@ -499,6 +499,8 @@ static int lisp_send(struct vport *vport, struct sk_buff *skb)
 
        skb->ignore_df = 1;
 
+       ovs_skb_set_inner_protocol(skb, skb->protocol);
+
        df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
        sent_len = iptunnel_xmit(skb->sk, rt, skb,
                             saddr, tun_key->ipv4_dst,