Explicitly check the availability of several kernel API functions
instead of relying on the kernel version to account for Red Hat
Enterprise Linux backports.
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
(cherry picked from commit
42d5dd9595cce35a8825a20be7d71a3a8f6f5640)
Conflicts:
datapath/linux/compat/include/asm/percpu.h
datapath/linux/compat/include/linux/netdevice.h
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
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], [can_checksum_protocol])
OVS_GREP_IFELSE([$KSRC/include/linux/rcupdate.h], [rcu_read_lock_held], [],
[OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h],
OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [NLA_NUL_STRING])
OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_get_be16])
+ OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be16])
+ OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be32])
+ OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be64])
OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested])
OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD],
}
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+#ifndef HAVE_NLA_PUT_BE16
static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
{
return nla_put(skb, attrtype, sizeof(__be16), &value);
}
+#endif
+
+#ifndef HAVE_NLA_PUT_BE32
static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
{
return nla_put(skb, attrtype, sizeof(__be32), &value);
}
+#endif
+
+#ifndef HAVE_NLA_PUT_BE64
static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
{
return nla_put(skb, attrtype, sizeof(__be64), &value);
#include <linux/if_vlan.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#ifndef HAVE_CAN_CHECKSUM_PROTOCOL
static bool can_checksum_protocol(unsigned long features, __be16 protocol)
{
return ((features & NETIF_F_GEN_CSUM) ||
((features & NETIF_F_FCOE_CRC) &&
protocol == htons(ETH_P_FCOE)));
}
+#endif
static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
{