gre: Restructure tunneling.
[sliver-openvswitch.git] / datapath / linux / compat / skbuff-openvswitch.c
1 #include <linux/module.h>
2 #include <linux/netdevice.h>
3 #include <linux/skbuff.h>
4
5 #if !defined(HAVE_SKB_WARN_LRO) && defined(NETIF_F_LRO)
6
7 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
8
9 void __skb_warn_lro_forwarding(const struct sk_buff *skb)
10 {
11         if (net_ratelimit())
12                 pr_warn("%s: received packets cannot be forwarded while LRO is enabled\n",
13                         skb->dev->name);
14 }
15
16 #endif
17
18 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
19 int skb_checksum_help(struct sk_buff *skb, int inward)
20 #else
21 int skb_checksum_help(struct sk_buff *skb)
22 #endif
23 {
24         if (unlikely(skb_is_nonlinear(skb))) {
25                 int err;
26
27                 err = __skb_linearize(skb);
28                 if (unlikely(err))
29                         return err;
30         }
31
32 #undef skb_checksum_help
33 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
34         return skb_checksum_help(skb, 0);
35 #else
36         return skb_checksum_help(skb);
37 #endif
38 }