Add AC rules and macros for Chelsio backports
authorSteve Wise <swise@opengridcomputing.com>
Thu, 8 Jan 2015 20:52:33 +0000 (14:52 -0600)
committerSteve Wise <swise@opengridcomputing.com>
Thu, 8 Jan 2015 20:52:33 +0000 (14:52 -0600)
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
config/rdma.m4
include/linux/compat-3.10.h
include/linux/compat-3.2.h
include/linux/compat-3.6.h

index c4b17b7..6aae3dc 100644 (file)
@@ -1754,6 +1754,86 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        ],[
                AC_MSG_RESULT(no)
        ])
+
+       AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
+       LB_LINUX_TRY_COMPILE([
+               #include "../drivers/net/bonding/bonding.h"
+       ],[
+               struct bonding *bond = NULL;
+               struct slave *slave = NULL;
+               int iter;
+
+               bond_for_each_slave(bond, slave, iter) ;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
+                         [bond_for_each_slave has int for 3rd parameter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               netdev_master_upper_dev_get_rcu(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
+                         [netdevice.h has netdev_master_upper_dev_get_rcu])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_vlan.h>
+       ],[
+               __vlan_find_dev_deep(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
+                         [__vlan_find_dev_deep has 3 paramters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+               __skb_alloc_page(0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
+                         [sk_buff has __skb_alloc_page])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_vlan.h>
+       ],[
+               __vlan_hwaccel_put_tag(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
+                         [__vlan_hwaccel_put_tag has 3 paramters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
 ])
 #
 # COMPAT_CONFIG_HEADERS
index 0460824..f4a91f6 100644 (file)
@@ -36,6 +36,10 @@ static inline bool netif_is_bond_master(struct net_device *dev)
        return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING;
 }
 
+#ifndef div64_ul
+#define div64_ul(x, y)   div64_u64((x), (y))
+#endif
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)) */
 
 #endif /* LINUX_3_10_COMPAT_H */
index 3f04cb4..b915ffc 100644 (file)
@@ -164,6 +164,9 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
 #define __netdev_printk LINUX_BACKPORT(__netdev_printk)
 extern int __netdev_printk(const char *level, const struct net_device *dev,
                           struct va_format *vaf);
+#ifndef IFF_UNICAST_FLT
+#define IFF_UNICAST_FLT 0x20000         /* Supports unicast filtering   */
+#endif
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
 
index 1afd0de..537eb01 100644 (file)
@@ -103,6 +103,13 @@ extern int netif_get_num_default_rss_queues(void);
 #define DEFAULT_MAX_NUM_RSS_QUEUES      (8)
 #endif
 
+#ifndef SUPPORTED_40000baseSR4_Full
+#define SUPPORTED_40000baseSR4_Full     (1 << 25)
+#endif
+#ifndef ADVERTISED_40000baseSR4_Full
+#define ADVERTISED_40000baseSR4_Full    (1 << 25)
+#endif
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) */
 
 #endif /* LINUX_3_6_COMPAT_H */