Whamcloud - gitweb
LU-6763 lnet: test for sk_sleep presence in compact-2.6.h 86/15386/9
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 2 Jul 2015 16:38:16 +0000 (12:38 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 10 Jul 2015 03:12:42 +0000 (03:12 +0000)
Like Lustre external infiniband stacks create a compability
layer to handle various distributions and kernel versions.
Due to this besides the linux kernel sk_sleep can also be
defined by the external infiniband stack. We need to examine
the infiniband stack's headers to see if sk_sleep is available
there as well.

Change-Id: I0317349cfe13f281c56a8aec17dc330a0e3c759d
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/15386
Tested-by: Jenkins
Reviewed-by: Chris Horn <hornc@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
12 files changed:
libcfs/autoconf/lustre-libcfs.m4
lnet/autoconf/lustre-lnet.m4
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-types.h
lnet/klnds/gnilnd/Makefile.in
lnet/klnds/gnilnd/gnilnd.h
lnet/klnds/o2iblnd/o2iblnd.h
lnet/klnds/socklnd/Makefile.in
lnet/klnds/socklnd/socklnd.h
lnet/lnet/Makefile.in
lnet/lnet/acceptor.c
lnet/lnet/lib-socket.c

index da7f06b..5c76eda 100644 (file)
@@ -121,23 +121,6 @@ ctl_table_ctl_name, [
 ]) # LIBCFS_SYSCTL_CTLNAME
 
 #
 ]) # LIBCFS_SYSCTL_CTLNAME
 
 #
-# LC_SK_SLEEP
-#
-# 2.6.35 kernel has sk_sleep function
-#
-AC_DEFUN([LC_SK_SLEEP], [
-LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
-sk_sleep, [
-       #include <net/sock.h>
-],[
-       sk_sleep(NULL);
-],[
-       AC_DEFINE(HAVE_SK_SLEEP, 1,
-               [kernel has sk_sleep])
-])
-]) # LC_SK_SLEEP
-
-#
 # LIBCFS_KSTRTOUL
 #
 # 2.6.38 kstrtoul is added
 # LIBCFS_KSTRTOUL
 #
 # 2.6.38 kstrtoul is added
@@ -331,8 +314,6 @@ LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
 LC_SHRINKER_WANT_SHRINK_PTR
 # 2.6.33
 LIBCFS_SYSCTL_CTLNAME
 LC_SHRINKER_WANT_SHRINK_PTR
 # 2.6.33
 LIBCFS_SYSCTL_CTLNAME
-# 2.6.35
-LC_SK_SLEEP
 # 2.6.38
 LIBCFS_KSTRTOUL
 # 2.6.39
 # 2.6.38
 LIBCFS_KSTRTOUL
 # 2.6.39
index 861331d..84d8b26 100644 (file)
@@ -406,6 +406,26 @@ AC_SUBST(GNILND)
 ]) # LN_CONFIG_GNILND
 
 #
 ]) # LN_CONFIG_GNILND
 
 #
+# LN_CONFIG_SK_SLEEP
+#
+# 2.6.35 kernel has sk_sleep function
+#
+AC_DEFUN([LN_CONFIG_SK_SLEEP], [
+LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
+sk_sleep, [
+       #ifdef HAVE_COMPAT_RDMA
+       #include <linux/compat-2.6.h>
+       #endif
+       #include <net/sock.h>
+],[
+       sk_sleep(NULL);
+],[
+       AC_DEFINE(HAVE_SK_SLEEP, 1,
+                 [kernel has sk_sleep])
+])
+]) # LN_CONFIG_SK_SLEEP
+
+#
 # LN_CONFIG_TCP_SENDPAGE
 #
 # 2.6.36 tcp_sendpage() first parameter is 'struct sock' instead of 'struct socket'.
 # LN_CONFIG_TCP_SENDPAGE
 #
 # 2.6.36 tcp_sendpage() first parameter is 'struct sock' instead of 'struct socket'.
@@ -429,7 +449,7 @@ EXTRA_KCFLAGS="$tmp_flags"
 #
 # LN_CONFIG_SK_DATA_READY
 #
 #
 # LN_CONFIG_SK_DATA_READY
 #
-# 2.6.36 tcp_sendpage() first parameter is 'struct sock' instead of 'struct socket'.
+# 3.15 for struct sock the *sk_data_ready() field only takes one argument now
 #
 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
 tmp_flags="$EXTRA_KCFLAGS"
 #
 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
 tmp_flags="$EXTRA_KCFLAGS"
@@ -461,6 +481,8 @@ LN_CONFIG_AFFINITY
 LN_CONFIG_BACKOFF
 LN_CONFIG_O2IB
 LN_CONFIG_GNILND
 LN_CONFIG_BACKOFF
 LN_CONFIG_O2IB
 LN_CONFIG_GNILND
+# 2.6.35
+LN_CONFIG_SK_SLEEP
 # 2.6.36
 LN_CONFIG_TCP_SENDPAGE
 # 3.15
 # 2.6.36
 LN_CONFIG_TCP_SENDPAGE
 # 3.15
index 94aed03..6dbcd35 100644 (file)
@@ -723,13 +723,6 @@ int lnet_acceptor_port(void);
 int lnet_acceptor_start(void);
 void lnet_acceptor_stop(void);
 
 int lnet_acceptor_start(void);
 void lnet_acceptor_stop(void);
 
-#ifndef HAVE_SK_SLEEP
-static inline wait_queue_head_t *sk_sleep(struct sock *sk)
-{
-       return sk->sk_sleep;
-}
-#endif
-
 int lnet_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
 int lnet_ipif_enumerate(char ***names);
 void lnet_ipif_free_enumeration(char **names, int n);
 int lnet_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
 int lnet_ipif_enumerate(char ***names);
 void lnet_ipif_free_enumeration(char **names, int n);
index 5e5f346..4701b38 100644 (file)
@@ -49,7 +49,6 @@
 #include <linux/kthread.h>
 #include <linux/uio.h>
 #include <linux/types.h>
 #include <linux/kthread.h>
 #include <linux/uio.h>
 #include <linux/types.h>
-#include <net/sock.h>
 
 #include <lnet/lnetctl.h>
 
 
 #include <lnet/lnetctl.h>
 
index 14e8c30..d957195 100644 (file)
@@ -2,6 +2,10 @@ MODULES := kgnilnd
 kgnilnd-objs := gnilnd.o gnilnd_cb.o gnilnd_modparams.o gnilnd_debug.o gnilnd_proc.o \
                gnilnd_sysctl.o gnilnd_stack.o gnilnd_conn.o
 
 kgnilnd-objs := gnilnd.o gnilnd_cb.o gnilnd_modparams.o gnilnd_debug.o gnilnd_proc.o \
                gnilnd_sysctl.o gnilnd_stack.o gnilnd_conn.o
 
+# Need to make sure that an external OFED source pool overrides
+# any in-kernel OFED sources
+NOSTDINC_FLAGS += @EXTRA_OFED_INCLUDE@
+
 EXTRA_POST_CFLAGS := -D"SVN_CODE_REV=KBUILD_STR(${SVN_CODE_REV})" @GNICPPFLAGS@
 
 EXTRA_DIST = $(kgnilnd-objs:%.o=%.c) gnilnd.h gnilnd_api_wrap.h
 EXTRA_POST_CFLAGS := -D"SVN_CODE_REV=KBUILD_STR(${SVN_CODE_REV})" @GNICPPFLAGS@
 
 EXTRA_DIST = $(kgnilnd-objs:%.o=%.c) gnilnd.h gnilnd_api_wrap.h
index e8a5575..79df3c3 100644 (file)
@@ -28,6 +28,9 @@
 #ifndef _GNILND_GNILND_H_
 #define _GNILND_GNILND_H_
 
 #ifndef _GNILND_GNILND_H_
 #define _GNILND_GNILND_H_
 
+#ifdef HAVE_COMPAT_RDMA
+#include <linux/compat-2.6.h>
+#endif
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index 36c1de9..2fe40c9 100644 (file)
  * Author: Eric Barton <eric@bartonsoftware.com>
  */
 
  * Author: Eric Barton <eric@bartonsoftware.com>
  */
 
+#ifdef HAVE_COMPAT_RDMA
+#include <linux/compat-2.6.h>
+#endif
+
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci-dma.h>
 #endif
 
 #include <linux/pci-dma.h>
 #endif
 
-#ifdef HAVE_COMPAT_RDMA
-#include <linux/compat-2.6.h>
-#endif
-
 #include <net/sock.h>
 #include <linux/in.h>
 
 #include <net/sock.h>
 #include <linux/in.h>
 
index b29f617..469ba0f 100644 (file)
@@ -1,5 +1,9 @@
 MODULES := ksocklnd
 
 MODULES := ksocklnd
 
+# Need to make sure that an external OFED source pool overrides
+# # any in-kernel OFED sources
+NOSTDINC_FLAGS += @EXTRA_OFED_INCLUDE@
+
 ksocklnd-objs := \
        socklnd.o \
        socklnd_cb.o \
 ksocklnd-objs := \
        socklnd.o \
        socklnd_cb.o \
index 3d76507..b0e9c93 100644 (file)
@@ -31,6 +31,9 @@
 #define DEBUG_PORTAL_ALLOC
 #define DEBUG_SUBSYSTEM S_LND
 
 #define DEBUG_PORTAL_ALLOC
 #define DEBUG_SUBSYSTEM S_LND
 
+#ifdef HAVE_COMPAT_RDMA
+#include <linux/compat-2.6.h>
+#endif
 #include <linux/crc32.h>
 #include <linux/errno.h>
 #include <linux/if.h>
 #include <linux/crc32.h>
 #include <linux/errno.h>
 #include <linux/if.h>
index ee119ad..f04d8a1 100644 (file)
@@ -7,4 +7,8 @@ lnet-objs += router.o router_proc.o acceptor.o peer.o net_fault.o
 
 default: all
 
 
 default: all
 
+# Need to make sure that an external OFED source pool overrides
+# # any in-kernel OFED sources
+NOSTDINC_FLAGS += @EXTRA_OFED_INCLUDE@
+
 @INCLUDE_RULES@
 @INCLUDE_RULES@
index 3585d20..f8f2699 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
+
+#ifdef HAVE_COMPAT_RDMA
+#include <linux/compat-2.6.h>
+#endif
 #include <linux/completion.h>
 #include <linux/completion.h>
+#include <net/sock.h>
 #include <lnet/lib-lnet.h>
 
 static int   accept_port    = 988;
 #include <lnet/lib-lnet.h>
 
 static int   accept_port    = 988;
index 70b9ee2..5348ac0 100644 (file)
@@ -35,6 +35,9 @@
  */
 #define DEBUG_SUBSYSTEM S_LNET
 
  */
 #define DEBUG_SUBSYSTEM S_LNET
 
+#ifdef HAVE_COMPAT_RDMA
+#include <linux/compat-2.6.h>
+#endif
 #include <linux/if.h>
 #include <linux/in.h>
 #include <linux/net.h>
 #include <linux/if.h>
 #include <linux/in.h>
 #include <linux/net.h>
@@ -554,6 +557,13 @@ lnet_sock_listen(struct socket **sockp,
        return rc;
 }
 
        return rc;
 }
 
+#ifndef HAVE_SK_SLEEP
+static inline wait_queue_head_t *sk_sleep(struct sock *sk)
+{
+       return sk->sk_sleep;
+}
+#endif
+
 int
 lnet_sock_accept(struct socket **newsockp, struct socket *sock)
 {
 int
 lnet_sock_accept(struct socket **newsockp, struct socket *sock)
 {