X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Flinux%2Fcompat%2Finclude%2Flinux%2Fnetdevice.h;h=f8240df5a13a797b3db91635cef0f4814a2cd369;hb=42d5dd9595cce35a8825a20be7d71a3a8f6f5640;hp=04ebd89a77e33b45c6e32382bc0ef020f57a45cb;hpb=22bcc0e70becd88bf895c44885d63704affe4284;p=sliver-openvswitch.git diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index 04ebd89a7..f8240df5a 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -60,11 +60,11 @@ typedef int netdev_tx_t; #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) /* Linux 2.6.24 added a network namespace pointer to the macro. */ #undef for_each_netdev -#define for_each_netdev(net,d) list_for_each_entry(d, &dev_base_head, dev_list) +#define for_each_netdev(net, d) list_for_each_entry(d, &dev_base_head, dev_list) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) -#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) +#define net_xmit_eval(e) ((e) == NET_XMIT_CN ? 0 : (e)) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) @@ -77,19 +77,6 @@ extern void unregister_netdevice_many(struct list_head *head); extern void dev_disable_lro(struct net_device *dev); #endif -/* Linux 2.6.28 introduced dev_get_stats(): - * const struct net_device_stats *dev_get_stats(struct net_device *dev); - * - * Linux 2.6.36 changed dev_get_stats() to: - * struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, - * struct rtnl_link_stats64 *storage); - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) -#define dev_get_stats(dev, storage) rpl_dev_get_stats(dev, storage) -struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, - struct rtnl_link_stats64 *storage); -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) #define skb_checksum_help(skb) skb_checksum_help((skb), 0) #endif @@ -113,7 +100,7 @@ static inline void netdev_rx_handler_unregister(struct net_device *dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) #undef SET_ETHTOOL_OPS #define SET_ETHTOOL_OPS(netdev, ops) \ - ( (netdev)->ethtool_ops = (struct ethtool_ops *)(ops) ) + ((netdev)->ethtool_ops = (struct ethtool_ops *)(ops)) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) @@ -141,4 +128,43 @@ static inline struct net_device *dev_get_by_index_rcu(struct net *net, int ifind #define NETIF_F_FSO 0 #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) +#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) +#define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */ + +#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM) +#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +#define skb_gso_segment rpl_skb_gso_segment +struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, u32 features); + +#define netif_skb_features rpl_netif_skb_features +u32 rpl_netif_skb_features(struct sk_buff *skb); + +#define netif_needs_gso rpl_netif_needs_gso +static inline int rpl_netif_needs_gso(struct sk_buff *skb, int features) +{ + return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || + unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +typedef u32 netdev_features_t; +#endif + +#ifndef HAVE___SKB_GSO_SEGMENT +static inline struct sk_buff *__skb_gso_segment(struct sk_buff *skb, + netdev_features_t features, + bool tx_path) +{ + return skb_gso_segment(skb, features); +} +#endif + #endif