From: Vladimir Sokolovsky Date: Mon, 5 Jan 2015 15:54:21 +0000 (+0200) Subject: Added SLES11 SP3 support X-Git-Tag: vofed-3.18~41 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a2980eb183e4a0c5109ab3b1c09fa548f4238bbd;p=~emulex%2Ffor-vlad%2Fcompat.git Added SLES11 SP3 support Signed-off-by: Vladimir Sokolovsky --- diff --git a/config/build-linux.m4 b/config/build-linux.m4 index fafe7ef..34ec244 100644 --- a/config/build-linux.m4 +++ b/config/build-linux.m4 @@ -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]) diff --git a/config/rdma.m4 b/config/rdma.m4 index a0812f4..94a01b4 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -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 + ],[ + 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 @@ -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 + ],[ + 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 @@ -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 + ],[ + 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 + ],[ + 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 + ],[ + 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 diff --git a/include/linux/compat-3.1.h b/include/linux/compat-3.1.h index 0d22f7b..558f1bc 100644 --- a/include/linux/compat-3.1.h +++ b/include/linux/compat-3.1.h @@ -11,7 +11,7 @@ #include #include -#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 /* remove last arg */ #define netlink_dump_start(a, b, c, d, e, f) netlink_dump_start(a, b, c, d, e) diff --git a/include/linux/compat-3.10.h b/include/linux/compat-3.10.h index 528a539..0460824 100644 --- a/include/linux/compat-3.10.h +++ b/include/linux/compat-3.10.h @@ -5,6 +5,7 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)) #include +#include #ifndef NETIF_F_HW_VLAN_CTAG_RX #define NETIF_F_HW_VLAN_CTAG_RX NETIF_F_HW_VLAN_RX @@ -22,6 +23,19 @@ #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 */ diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h index b20116f..124f685 100644 --- a/include/linux/compat-3.5.h +++ b/include/linux/compat-3.5.h @@ -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 */ diff --git a/include/linux/compat-3.8.h b/include/linux/compat-3.8.h index 3c01aeb..77759d4 100644 --- a/include/linux/compat-3.8.h +++ b/include/linux/compat-3.8.h @@ -4,8 +4,18 @@ #include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) +#include +#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)) */