From: James Simmons Date: Thu, 2 Jul 2015 16:38:16 +0000 (-0400) Subject: LU-6763 lnet: test for sk_sleep presence in compact-2.6.h X-Git-Tag: 2.7.57~50 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=87fe2c045ff07cadb3c2034618254a6acfe53180 LU-6763 lnet: test for sk_sleep presence in compact-2.6.h 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 Reviewed-on: http://review.whamcloud.com/15386 Tested-by: Jenkins Reviewed-by: Chris Horn Tested-by: Maloo Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index da7f06b..5c76eda 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -121,23 +121,6 @@ ctl_table_ctl_name, [ ]) # 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 -],[ - sk_sleep(NULL); -],[ - AC_DEFINE(HAVE_SK_SLEEP, 1, - [kernel has sk_sleep]) -]) -]) # LC_SK_SLEEP - -# # 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 -# 2.6.35 -LC_SK_SLEEP # 2.6.38 LIBCFS_KSTRTOUL # 2.6.39 diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 861331d..84d8b26 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -406,6 +406,26 @@ AC_SUBST(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 + #endif + #include +],[ + 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'. @@ -429,7 +449,7 @@ EXTRA_KCFLAGS="$tmp_flags" # # 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" @@ -461,6 +481,8 @@ LN_CONFIG_AFFINITY 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 diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 94aed03..6dbcd35 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -723,13 +723,6 @@ int lnet_acceptor_port(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); diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 5e5f346..4701b38 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -49,7 +49,6 @@ #include #include #include -#include #include diff --git a/lnet/klnds/gnilnd/Makefile.in b/lnet/klnds/gnilnd/Makefile.in index 14e8c30..d957195 100644 --- a/lnet/klnds/gnilnd/Makefile.in +++ b/lnet/klnds/gnilnd/Makefile.in @@ -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 +# 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 diff --git a/lnet/klnds/gnilnd/gnilnd.h b/lnet/klnds/gnilnd/gnilnd.h index e8a5575..79df3c3 100644 --- a/lnet/klnds/gnilnd/gnilnd.h +++ b/lnet/klnds/gnilnd/gnilnd.h @@ -28,6 +28,9 @@ #ifndef _GNILND_GNILND_H_ #define _GNILND_GNILND_H_ +#ifdef HAVE_COMPAT_RDMA +#include +#endif #include #include #include diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index 36c1de9..2fe40c9 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -38,6 +38,10 @@ * Author: Eric Barton */ +#ifdef HAVE_COMPAT_RDMA +#include +#endif + #include #include #include @@ -64,10 +68,6 @@ #include #endif -#ifdef HAVE_COMPAT_RDMA -#include -#endif - #include #include diff --git a/lnet/klnds/socklnd/Makefile.in b/lnet/klnds/socklnd/Makefile.in index b29f617..469ba0f 100644 --- a/lnet/klnds/socklnd/Makefile.in +++ b/lnet/klnds/socklnd/Makefile.in @@ -1,5 +1,9 @@ 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 \ diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h index 3d76507..b0e9c93 100644 --- a/lnet/klnds/socklnd/socklnd.h +++ b/lnet/klnds/socklnd/socklnd.h @@ -31,6 +31,9 @@ #define DEBUG_PORTAL_ALLOC #define DEBUG_SUBSYSTEM S_LND +#ifdef HAVE_COMPAT_RDMA +#include +#endif #include #include #include diff --git a/lnet/lnet/Makefile.in b/lnet/lnet/Makefile.in index ee119ad..f04d8a1 100644 --- a/lnet/lnet/Makefile.in +++ b/lnet/lnet/Makefile.in @@ -7,4 +7,8 @@ lnet-objs += router.o router_proc.o acceptor.o peer.o net_fault.o 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@ diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c index 3585d20..f8f2699 100644 --- a/lnet/lnet/acceptor.c +++ b/lnet/lnet/acceptor.c @@ -35,7 +35,12 @@ */ #define DEBUG_SUBSYSTEM S_LNET + +#ifdef HAVE_COMPAT_RDMA +#include +#endif #include +#include #include static int accept_port = 988; diff --git a/lnet/lnet/lib-socket.c b/lnet/lnet/lib-socket.c index 70b9ee23..5348ac0 100644 --- a/lnet/lnet/lib-socket.c +++ b/lnet/lnet/lib-socket.c @@ -35,6 +35,9 @@ */ #define DEBUG_SUBSYSTEM S_LNET +#ifdef HAVE_COMPAT_RDMA +#include +#endif #include #include #include @@ -554,6 +557,13 @@ lnet_sock_listen(struct socket **sockp, 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) {