Added SLES11 SP3 support
authorVladimir Sokolovsky <vlad@mellanox.com>
Mon, 5 Jan 2015 15:54:21 +0000 (17:54 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Mon, 5 Jan 2015 15:54:21 +0000 (17:54 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
config/build-linux.m4
config/rdma.m4
include/linux/compat-3.1.h
include/linux/compat-3.10.h
include/linux/compat-3.5.h
include/linux/compat-3.8.h

index fafe7ef..34ec244 100644 (file)
@@ -253,6 +253,10 @@ LB_CHECK_FILE([$LINUX/include/linux/kconfig.h],
               [CONFIG_INCLUDE=$LINUX/include/$AUTOCONF_HDIR/kconfig.h])
        AC_SUBST(CONFIG_INCLUDE)
 
+if test -e $CONFIG_INCLUDE; then
+       CONFIG_INCLUDE_FLAG="-include $CONFIG_INCLUDE"
+fi
+
 # ------------ rhconfig.h includes runtime-generated bits --
 # red hat kernel-source checks
 
@@ -365,7 +369,7 @@ $2
 AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
 rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
-AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile OFA_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_OFA_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi  -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
+AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile OFA_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_OFA_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi  -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 $CONFIG_INCLUDE_FLAG" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
        [$4],
        [_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$5],[$5])dnl])
index a0812f4..94a01b4 100644 (file)
@@ -669,6 +669,22 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if struct sk_buff has encapsulation])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+               struct sk_buff *skb;
+               skb->encapsulation = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
+                         [encapsulation is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
        LB_LINUX_TRY_COMPILE([
                #include <linux/etherdevice.h>
@@ -1408,6 +1424,24 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               unsigned char mac[ETH_ALEN];
+               struct ethtool_flow_ext h_ext;
+
+               memcpy(&mac, h_ext.h_dest, ETH_ALEN);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
+                         [ethtool_flow_ext has h_dest])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if netdevice.h has struct netdev_hw_addr])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -1591,6 +1625,53 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/dst.h>
+       ],[
+               struct neighbour *neigh = dst_get_neighbour(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
+                         [ is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netlink.h>
+       ],[
+               int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
+                         [ is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/dcbnl.h>
+       ],[
+               const struct dcbnl_rtnl_ops en_dcbnl_ops = {
+                       .ieee_getmaxrate = NULL,
+                       .ieee_setmaxrate = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
+                         [ieee_getmaxrate/ieee_setmaxrate is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
 ])
 #
 # COMPAT_CONFIG_HEADERS
index 0d22f7b..558f1bc 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/idr.h>
 #include <net/dst.h>
 
-#ifndef CONFIG_COMPAT_DST_NEIGHBOUR
+#ifndef HAVE_DST_GET_NEIGHBOUR
 static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
 {
        return dst->neighbour;
@@ -26,7 +26,7 @@ static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst)
 {
        return rcu_dereference_raw(dst->neighbour);
 }
-#endif /* CONFIG_COMPAT_DST_NEIGHBOUR */
+#endif /* HAVE_DST_GET_NEIGHBOUR */
 
 /* Backports 56f8a75c */
 static inline bool ip_is_fragment(const struct iphdr *iph)
@@ -47,7 +47,7 @@ static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev
        return skb;
 }
 
-#if ! defined(CONFIG_COMPAT_MIN_DUMP_ALLOC_ARG) && ! defined(CONFIG_COMPAT_NETLINK_3_7)
+#if ! defined(HAVE_NETLINK_DUMP_START_6P)
 #include <linux/netlink.h>
 /* remove last arg */
 #define netlink_dump_start(a, b, c, d, e, f) netlink_dump_start(a, b, c, d, e)
index 528a539..0460824 100644 (file)
@@ -5,6 +5,7 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
 #include <linux/random.h>
+#include <linux/netdevice.h>
 
 #ifndef NETIF_F_HW_VLAN_CTAG_RX
 #define NETIF_F_HW_VLAN_CTAG_RX NETIF_F_HW_VLAN_RX
 #define prandom_u32() random32()
 #endif
 
+#ifndef NAPI_POLL_WEIGHT
+/* Default NAPI poll() weight
+ * Device drivers are strongly advised to not use bigger value
+ */
+#define NAPI_POLL_WEIGHT 64
+#endif
+
+#define netif_is_bond_master LINUX_BACKPORT(netif_is_bond_master)
+static inline bool netif_is_bond_master(struct net_device *dev)
+{
+       return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING;
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)) */
 
 #endif /* LINUX_3_10_COMPAT_H */
index b20116f..124f685 100644 (file)
@@ -182,6 +182,19 @@ static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
        return !compare_ether_addr_64bits(addr1, addr2);
 }
 
+/**
+ * ether_addr_equal - Compare two Ethernet addresses
+ * @addr1: Pointer to a six-byte array containing the Ethernet address
+ * @addr2: Pointer other six-byte array containing the Ethernet address
+ *
+ * Compare two ethernet addresses, returns true if equal
+ */
+#define ether_addr_equal LINUX_BACKPORT(ether_addr_equal)
+static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
+{
+       return !compare_ether_addr(addr1, addr2);
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
 
 #endif /* LINUX_3_5_COMPAT_H */
index 3c01aeb..77759d4 100644 (file)
@@ -4,8 +4,18 @@
 #include <linux/version.h>
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
+#include <linux/pci_regs.h>
 
+#ifndef FLOW_MAC_EXT
 #define    FLOW_MAC_EXT    0x40000000
+#endif
+
+#ifndef PCI_EXP_LNKCAP_SLS_2_5GB
+#define  PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
+#endif
+#ifndef PCI_EXP_LNKCAP_SLS_5_0GB
+#define  PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
+#endif
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) */