Skip to content

Commit

Permalink
datapath: Consistently set skb->inner_protocol for tunnels.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Thomas Graf <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
  • Loading branch information
jessegross committed Feb 20, 2015
1 parent a42ec67 commit e4bafe5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions datapath/linux/compat/gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion datapath/linux/compat/ip_tunnels_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions datapath/linux/compat/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions datapath/vport-lisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e4bafe5

Please sign in to comment.