datapath: Add support for lwtunnel
[cascardo/ovs.git] / datapath / linux / compat / include / linux / netdev_features.h
1 #ifndef __LINUX_NETDEV_FEATURES_WRAPPER_H
2 #define __LINUX_NETDEV_FEATURES_WRAPPER_H
3
4 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
5 #include_next <linux/netdev_features.h>
6 #endif
7
8 #if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
9 /* On RHEL 6, netdev features are defined in netdevice.h header. */
10 #include <linux/netdevice.h>
11 #endif
12
13 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
14 #define NETIF_F_HW_VLAN_CTAG_TX NETIF_F_HW_VLAN_TX
15 #endif
16
17 #ifndef NETIF_F_GSO_GRE
18 #define NETIF_F_GSO_GRE 0
19 #endif
20
21 #ifndef NETIF_F_GSO_GRE_CSUM
22 #define NETIF_F_GSO_GRE_CSUM 0
23 #else
24 #define HAVE_NETIF_F_GSO_GRE_CSUM
25 #endif
26
27 #ifndef NETIF_F_GSO_IPIP
28 #define NETIF_F_GSO_IPIP 0
29 #endif
30
31 #ifndef NETIF_F_GSO_SIT
32 #define NETIF_F_GSO_SIT 0
33 #endif
34
35 #ifndef NETIF_F_GSO_UDP_TUNNEL
36 #define NETIF_F_GSO_UDP_TUNNEL 0
37 #else
38 #define HAVE_NETIF_F_GSO_UDP_TUNNEL 0
39 #endif
40
41 #ifndef NETIF_F_GSO_UDP_TUNNEL_CSUM
42 #define NETIF_F_GSO_UDP_TUNNEL_CSUM 0
43 #define SKB_GSO_UDP_TUNNEL_CSUM 0
44 #endif
45
46 #ifndef NETIF_F_GSO_MPLS
47 #define NETIF_F_GSO_MPLS 0
48 #endif
49
50 #ifndef NETIF_F_HW_VLAN_STAG_TX
51 #define NETIF_F_HW_VLAN_STAG_TX 0
52 #endif
53
54 #ifndef NETIF_F_GSO_TUNNEL_REMCSUM
55 #define NETIF_F_GSO_TUNNEL_REMCSUM 0
56 #define SKB_GSO_TUNNEL_REMCSUM 0
57 #else
58 /* support for REM_CSUM is added in 3.19 but API are not defined
59  * till 4.0, so turn on REMSUM support on kernel 4.0 onwards.
60  */
61 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
62 #define HAVE_NETIF_F_GSO_TUNNEL_REMCSUM
63 #endif
64 #endif
65
66 #ifndef NETIF_F_RXCSUM
67 #define NETIF_F_RXCSUM  0
68 #endif
69
70 #ifndef NETIF_F_GSO_ENCAP_ALL
71 #define NETIF_F_GSO_ENCAP_ALL   (NETIF_F_GSO_GRE |                      \
72                                  NETIF_F_GSO_GRE_CSUM |                 \
73                                  NETIF_F_GSO_IPIP |                     \
74                                  NETIF_F_GSO_SIT |                      \
75                                  NETIF_F_GSO_UDP_TUNNEL |               \
76                                  NETIF_F_GSO_UDP_TUNNEL_CSUM |          \
77                                  NETIF_F_GSO_MPLS)
78 #endif
79
80 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
81 #define SKB_GSO_GRE 0
82 #endif
83
84 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
85 #define SKB_GSO_UDP_TUNNEL 0
86 #endif
87
88 #ifndef HAVE_NETIF_F_GSO_GRE_CSUM
89 #define SKB_GSO_GRE_CSUM 0
90 #endif
91
92 #endif