From 752378e1cd1f133a8366fbacec3b281a45ff8268 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 9 Jul 2013 18:00:26 +0200 Subject: [PATCH] datapath: rhel: Account for RHEL specific backports The following symbols have been backported to RHEL and the kernel version is no longer an accurate indicator for their presence: - skb_gso_segment - netif_skb_features - netif_needs_gso Signed-off-by: Thomas Graf Signed-off-by: Jesse Gross --- acinclude.m4 | 3 +++ datapath/linux/compat/include/linux/netdevice.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 717c68166..d9fddf87e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -225,7 +225,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_by_index_rcu]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [__skb_gso_segment]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [skb_gso_segment]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [can_checksum_protocol]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netif_skb_features]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netif_needs_gso]) OVS_GREP_IFELSE([$KSRC/include/linux/rcupdate.h], [rcu_read_lock_held], [], [OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index f2ced69f3..b051baf53 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -142,13 +142,17 @@ static inline struct net_device *dev_get_by_index_rcu(struct net *net, int ifind #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +#ifndef HAVE_SKB_GSO_SEGMENT #define skb_gso_segment rpl_skb_gso_segment struct sk_buff *rpl_skb_gso_segment(struct sk_buff *skb, u32 features); +#endif +#ifndef HAVE_NETIF_SKB_FEATURES #define netif_skb_features rpl_netif_skb_features u32 rpl_netif_skb_features(struct sk_buff *skb); +#endif +#ifndef HAVE_NETIF_NEEDS_GSO #define netif_needs_gso rpl_netif_needs_gso static inline int rpl_netif_needs_gso(struct sk_buff *skb, int features) { -- 2.43.0