X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fautoconf%2Flustre-lnet.m4;h=2456e320a19276a00a8b795644772e93844e7ebd;hp=3ed69b48f3ad5215486eb1a824a9416ece40fa0d;hb=b6649fe7ea7d15bb00f9e30751868b12332b0401;hpb=3301b4b58d992a30581d2e95815913d8290f440e diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 3ed69b4..2456e32 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -6,7 +6,7 @@ AC_DEFUN([LN_CONFIG_MAX_PAYLOAD], [AC_MSG_CHECKING([for non-default maximum LNET payload]) AC_ARG_WITH([max-payload-mb], - AC_HELP_STRING([--with-max-payload-mb=MBytes], + AC_HELP_STRING([--with-max-payload-mb=MBytes], [set maximum lnet payload in MBytes]), [ AC_MSG_RESULT([$with_max_payload_mb]) @@ -82,7 +82,7 @@ if test x$enable_libcfs_assert = xyes; then AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF]) fi ]) - + # # LN_CONFIG_AFFINITY # @@ -106,7 +106,7 @@ else cpumask_t m; #else unsigned long m; - #endif + #endif set_cpus_allowed(&t, m); ],[ AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support]) @@ -125,7 +125,7 @@ fi AC_DEFUN([LN_CONFIG_PORTALS], [AC_MSG_CHECKING([for portals]) AC_ARG_WITH([portals], - AC_HELP_STRING([--with-portals=path], + AC_HELP_STRING([--with-portals=path], [set path to portals]), [ case $with_portals in @@ -135,7 +135,6 @@ AC_ARG_WITH([portals], ENABLEPORTALS=1 ;; esac - ], [ ENABLEPORTALS=0 ]) @@ -499,86 +498,105 @@ AC_SUBST(MXLND) AC_DEFUN([LN_CONFIG_O2IB],[ AC_MSG_CHECKING([whether to enable OpenIB gen2 support]) # set default -O2IBPATH="$LINUX/drivers/infiniband" AC_ARG_WITH([o2ib], AC_HELP_STRING([--with-o2ib=path], [build o2iblnd against path]), [ case $with_o2ib in - yes) ENABLEO2IB=2 + yes) O2IBPATHS="$LINUX $LINUX/drivers/infiniband" + ENABLEO2IB=2 ;; no) ENABLEO2IB=0 ;; - *) O2IBPATH=$with_o2ib + *) O2IBPATHS=$with_o2ib ENABLEO2IB=3 ;; esac ],[ + O2IBPATHS="$LINUX $LINUX/drivers/infiniband" ENABLEO2IB=1 ]) if test $ENABLEO2IB -eq 0; then AC_MSG_RESULT([disabled]) -elif test ! \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \ - -f ${O2IBPATH}/include/rdma/ib_cm.h -a\ - -f ${O2IBPATH}/include/rdma/ib_verbs.h -a\ - -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then - AC_MSG_RESULT([no]) - case $ENABLEO2IB in - 1) ;; - 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);; - 3) AC_MSG_ERROR([bad --with-o2ib path]);; - *) AC_MSG_ERROR([internal error]);; - esac else - O2IBCPPFLAGS="-I$O2IBPATH/include" - EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" - EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS" - EXTRA_LNET_INCLUDE="$O2IBCPPFLAGS $EXTRA_LNET_INCLUDE" - LB_LINUX_TRY_COMPILE([ - #include - #if !HAVE_GFP_T - typedef int gfp_t; - #endif - #include - #include - #include - #include - ],[ - struct rdma_cm_id *cm_id; - struct rdma_conn_param conn_param; - struct ib_device_attr device_attr; - struct ib_qp_attr qp_attr; - struct ib_pool_fmr pool_fmr; - enum ib_cm_rej_reason rej_reason; - - cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); - return PTR_ERR(cm_id); - ],[ - AC_MSG_RESULT([yes]) - O2IBLND="o2iblnd" - ],[ + o2ib_found=false + for O2IBPATH in $O2IBPATHS; do + if test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \ + -f ${O2IBPATH}/include/rdma/ib_cm.h -a \ + -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \ + -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then + o2ib_found=true + break + fi + done + if ! $o2ib_found; then AC_MSG_RESULT([no]) case $ENABLEO2IB in - 1) ;; - 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);; - 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);; - *) AC_MSG_ERROR([internal error]);; + 1) ;; + 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);; + 3) AC_MSG_ERROR([bad --with-o2ib path]);; + *) AC_MSG_ERROR([internal error]);; esac - O2IBLND="" - O2IBCPPFLAGS="" - ]) - - IB_DMA_MAP="`grep -c ib_dma_map_single ${O2IBPATH}/include/rdma/ib_verbs.h`" - if test "$IB_DMA_MAP" != 0 ; then - IBLND_OFED_VERSION="102" else - IBLND_OFED_VERSION="101" - fi + O2IBCPPFLAGS="-I$O2IBPATH/include" + EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS" + EXTRA_LNET_INCLUDE="$O2IBCPPFLAGS $EXTRA_LNET_INCLUDE" + LB_LINUX_TRY_COMPILE([ + #include + #include + #if !HAVE_GFP_T + typedef int gfp_t; + #endif + #include + #include + #include + #include + ],[ + struct rdma_cm_id *cm_id; + struct rdma_conn_param conn_param; + struct ib_device_attr device_attr; + struct ib_qp_attr qp_attr; + struct ib_pool_fmr pool_fmr; + enum ib_cm_rej_reason rej_reason; + + cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); + return PTR_ERR(cm_id); + ],[ + AC_MSG_RESULT([yes]) + O2IBLND="o2iblnd" + ],[ + AC_MSG_RESULT([no]) + case $ENABLEO2IB in + 1) ;; + 2) AC_MSG_ERROR([can't compile with kernel OpenIB gen2 headers]);; + 3) AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]);; + *) AC_MSG_ERROR([internal error]);; + esac + O2IBLND="" + O2IBCPPFLAGS="" + ]) - AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION, - [OFED version]) + # version checking is a hack and isn't reliable, + # we need verify it with each new ofed release - EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" + if grep -q ib_dma_map_single \ + ${O2IBPATH}/include/rdma/ib_verbs.h; then + if grep -q comp_vector \ + ${O2IBPATH}/include/rdma/ib_verbs.h; then + IBLND_OFED_VERSION="1025" + else + IBLND_OFED_VERSION="1020" + fi + else + IBLND_OFED_VERSION="1010" + fi + + AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION, + [OFED version]) + + EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" + fi fi AC_SUBST(EXTRA_LNET_INCLUDE) @@ -623,7 +641,7 @@ elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \ *) AC_MSG_ERROR([internal error]);; esac else - case $ENABLEOPENIB in + case $ENABLEOPENIB in 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";; 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";; *) AC_MSG_RESULT([no]) @@ -637,7 +655,7 @@ else #include #include ],[ - struct ib_device_properties dev_props; + struct ib_device_properties dev_props; struct ib_cm_active_param cm_active_params; tTS_IB_CLIENT_QUERY_TID tid; int enum1 = IB_QP_ATTRIBUTE_STATE; @@ -700,7 +718,7 @@ if test -n "$CIBPATH"; then #include #include ],[ - struct ib_device_properties dev_props; + struct ib_device_properties dev_props; struct ib_cm_active_param cm_active_params; tTS_IB_CLIENT_QUERY_TID tid; int enum1 = TS_IB_QP_ATTRIBUTE_STATE; @@ -825,7 +843,7 @@ else EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS" LB_LINUX_TRY_COMPILE([ - #include + #include #include #ifdef __BIG_ENDIAN # define CPU_BE 1 @@ -835,7 +853,7 @@ else # define CPU_BE 0 # define CPU_LE 1 #endif - #include + #include #include #include ],[ @@ -864,7 +882,7 @@ if test -n "$VIBLND"; then EXTRA_KCFLAGS="$EXTRA_KCFLAGS $VIBCPPFLAGS" AC_MSG_CHECKING([if Voltaire still uses void * sg addresses]) LB_LINUX_TRY_COMPILE([ - #include + #include #include #ifdef __BIG_ENDIAN # define CPU_BE 1 @@ -874,7 +892,7 @@ if test -n "$VIBLND"; then # define CPU_BE 0 # define CPU_LE 1 #endif - #include + #include #include #include ],[ @@ -1031,39 +1049,26 @@ LB_LINUX_TRY_COMPILE([ # we export show_task(), but not all kernels have it (yet) # AC_DEFUN([LN_FUNC_SHOW_TASK], -[AC_MSG_CHECKING([if kernel exports show_task]) -have_show_task=0 -for file in ksyms sched ; do - if grep -q "EXPORT_SYMBOL(show_task)" \ - "$LINUX/kernel/$file.c" 2>/dev/null ; then - have_show_task=1 - break - fi -done -if test x$have_show_task = x1 ; then - AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi +[LB_CHECK_SYMBOL_EXPORT([show_task], +[kernel/ksyms.c kernel/sched.c],[ +AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported]) +],[ +]) ]) # LN_TASKLIST_LOCK # 2.6.18 remove tasklist_lock export AC_DEFUN([LN_TASKLIST_LOCK], -[AC_MSG_CHECKING([kernel export tasklist_lock]) - if grep -q "EXPORT_SYMBOL(tasklist_lock)" \ - "$LINUX/kernel/fork.c" 2>/dev/null ; then - AC_DEFINE(HAVE_TASKLIST_LOCK, 1, - [tasklist_lock exported]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi +[LB_CHECK_SYMBOL_EXPORT([tasklist_lock], +[kernel/fork.c],[ +AC_DEFINE(HAVE_TASKLIST_LOCK, 1, + [tasklist_lock exported]) +],[ +]) ]) # 2.6.19 API changes -# kmem_cache_destroy(cachep) return void instead of +# kmem_cache_destroy(cachep) return void instead of # int AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT], [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int]) @@ -1087,7 +1092,7 @@ AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER], [AC_MSG_CHECKING([panic_notifier_list is atomic]) LB_LINUX_TRY_COMPILE([ #include - #include + #include ],[ struct atomic_notifier_head panic_notifier_list; ],[ @@ -1099,7 +1104,7 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.20 API change INIT_WORK use 2 args and not +# 2.6.20 API change INIT_WORK use 2 args and not # store data inside AC_DEFUN([LN_3ARGS_INIT_WORK], [AC_MSG_CHECKING([check INIT_WORK want 3 args]) @@ -1135,28 +1140,55 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.21 uses struct kmem_cache instead of kmem_cache_s for -# kmem_cache_t -AC_DEFUN([LN_KMEM_CACHE_S], -[AC_MSG_CHECKING([check kernel has struct kmem_cache_s]) +# 2.6.21 marks kmem_cache_t deprecated and uses struct kmem_cache +# instead +AC_DEFUN([LN_KMEM_CACHE], +[AC_MSG_CHECKING([check kernel has struct kmem_cache]) tmp_flags="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="-Werror" LB_LINUX_TRY_COMPILE([ #include + typedef struct kmem_cache cache_t; ],[ - struct kmem_cache_s *cachep = NULL; - - kmem_cache_free(cachep, NULL); + cache_t *cachep = NULL; + kmem_cache_alloc(cachep, 0); ],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KMEM_CACHE_n, 1, - [kernel has struct kmem_cache_s]) + AC_DEFINE(HAVE_KMEM_CACHE, 1, + [kernel has struct kmem_cache]) ],[ AC_MSG_RESULT(NO) ]) EXTRA_KCFLAGS="$tmp_flags" ]) +# 2.6.23 lost dtor argument +AC_DEFUN([LN_KMEM_CACHE_CREATE_DTOR], +[AC_MSG_CHECKING([check kmem_cache_create has dtor argument]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + kmem_cache_create(NULL, 0, 0, 0, NULL, NULL); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1, + [kmem_cache_create has dtor argument]) +],[ + AC_MSG_RESULT(NO) +]) +]) + +# asm/segment.h does not exist on all architectures. +# e.g. the file is empty for ia64 and does not exist for PPC. +AC_DEFUN([LC_SEGMENT_H], + [LB_CHECK_FILE([$LINUX/include/asm/segment.h], + [AC_MSG_CHECKING([if asm/segment.h is present]) + LB_LINUX_TRY_COMPILE([#include ], [], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SEGMENT_H, 1, + [asm/segment.h exists])], + [AC_MSG_RESULT([no])])]) +]) # LC_SEGMENT_H # # LN_PROG_LINUX @@ -1194,7 +1226,11 @@ LN_ATOMIC_PANIC_NOTIFIER LN_3ARGS_INIT_WORK # 2.6.21 LN_2ARGS_REGISTER_SYSCTL -LN_KMEM_CACHE_S +LN_KMEM_CACHE +# 2.6.23 +LN_KMEM_CACHE_CREATE_DTOR +# PPC/PPC64 support +LC_SEGMENT_H ]) # @@ -1431,6 +1467,8 @@ lnet/libcfs/autoMakefile lnet/libcfs/linux/Makefile lnet/lnet/Makefile lnet/lnet/autoMakefile +lnet/selftest/Makefile +lnet/selftest/autoMakefile lnet/ulnds/Makefile lnet/ulnds/autoMakefile lnet/ulnds/socklnd/Makefile