X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fautoconf%2Flustre-lnet.m4;h=7558caa4d19aa5a338f5aa49c91e32cfdfcb8df4;hp=479a1f5266fbc7ef8d13f3eeb3f5cb19d5720891;hb=b4e009fdece5000f3414ce442c782bd50d558089;hpb=ed88907a96ba81d3558e71ade9def98bdc785169 diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 479a1f5..7558caa 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]) @@ -42,53 +42,6 @@ fi ]) # -# LN_CONFIG_ZEROCOPY -# -# check if zerocopy is available/wanted -# -AC_DEFUN([LN_CONFIG_ZEROCOPY], -[AC_ARG_ENABLE([zerocopy], - AC_HELP_STRING([--disable-zerocopy], - [disable socklnd zerocopy]), - [],[enable_zerocopy='yes']) -AC_MSG_CHECKING([for zero-copy TCP support]) -if test x$enable_zerocopy = xno ; then - AC_MSG_RESULT([no (by request)]) -else - ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`" - if test "$ZCCD" = 0 ; then - AC_MSG_RESULT([no (no kernel support)]) - else - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([for up-to-date tcp zero-copy patch]) - LB_LINUX_TRY_COMPILE([ - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - ],[ - struct zccd zc = {0}; - - return atomic_read(&zc.zccd_refcount); - ],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(SOCKNAL_ZC, 1, [enable zero-copy support]) - ],[ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([old TCP zero-copy in kernel (bug 10889) - use --disable-zerocopy to continue ]) - ]) - fi -fi -]) - -# # LN_CONFIG_AFFINITY # # check if cpu affinity is available/wanted @@ -111,7 +64,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]) @@ -130,7 +83,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 @@ -140,7 +93,6 @@ AC_ARG_WITH([portals], ENABLEPORTALS=1 ;; esac - ], [ ENABLEPORTALS=0 ]) @@ -181,24 +133,6 @@ else fi ]) -# -# LN_CONFIG_PANIC_DUMPLOG -# -# check if tunable panic_dumplog is wanted -# -AC_DEFUN([LN_CONFIG_PANIC_DUMPLOG], -[AC_MSG_CHECKING([for tunable panic_dumplog support]) -AC_ARG_ENABLE([panic_dumplog], - AC_HELP_STRING([--enable-panic_dumplog], - [enable panic_dumplog]), - [],[enable_panic_dumplog='no']) -if test x$enable_panic_dumplog = xyes ; then - AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic]) - AC_MSG_RESULT([yes (by request)]) -else - AC_MSG_RESULT([no]) -fi -]) # # LN_CONFIG_PTLLND @@ -504,75 +438,118 @@ 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" - 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="" - ]) - EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" + 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 + #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="" + ]) + + # we know at this point that the found OFED source is good + if test \( $ENABLEO2IB = 3 \); then + if test \( -f $O2IBPATH/Module.symvers \); then + AC_MSG_NOTICE([adding $O2IBPATH/Module.symvers to $PWD/Module.symvers]) + cat $O2IBPATH/Module.symvers >> $PWD/Module.symvers + else + AC_MSG_ERROR([an external source tree was specified for o2iblnd however I could not find a $O2IBPATH/Module.symvers there]) + fi + fi + + # version checking is a hack and isn't reliable, + # we need verify it with each new ofed release + + 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) AC_SUBST(O2IBCPPFLAGS) AC_SUBST(O2IBLND) ]) @@ -604,7 +581,7 @@ AC_ARG_WITH([openib], if test $ENABLEOPENIB -eq 0; then AC_MSG_RESULT([disabled]) elif test ! \( -f ${OPENIBPATH}/include/ts_ib_core.h -a \ - -f ${OPENIBPATH}/include/ts_ib_cm.h -a\ + -f ${OPENIBPATH}/include/ts_ib_cm.h -a \ -f ${OPENIBPATH}/include/ts_ib_sa_client.h \); then AC_MSG_RESULT([no]) case $ENABLEOPENIB in @@ -614,7 +591,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]) @@ -628,7 +605,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; @@ -691,7 +668,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; @@ -816,7 +793,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 @@ -826,7 +803,7 @@ else # define CPU_BE 0 # define CPU_LE 1 #endif - #include + #include #include #include ],[ @@ -855,7 +832,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 @@ -865,7 +842,7 @@ if test -n "$VIBLND"; then # define CPU_BE 0 # define CPU_LE 1 #endif - #include + #include #include #include ],[ @@ -919,176 +896,7 @@ AC_SUBST(RACPPFLAGS) AC_SUBST(RALND) ]) -# -# LN_STRUCT_PAGE_LIST -# -# 2.6.4 no longer has page->list -# -AC_DEFUN([LN_STRUCT_PAGE_LIST], -[AC_MSG_CHECKING([if struct page has a list field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct page page; - &page.list; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LN_STRUCT_SIGHAND -# -# red hat 2.4 adds sighand to struct task_struct -# -AC_DEFUN([LN_STRUCT_SIGHAND], -[AC_MSG_CHECKING([if task_struct has a sighand field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct task_struct p; - p.sighand = NULL; -],[ - AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LN_FUNC_CPU_ONLINE -# -# cpu_online is different in rh 2.4, vanilla 2.4, and 2.6 -# -AC_DEFUN([LN_FUNC_CPU_ONLINE], -[AC_MSG_CHECKING([if kernel defines cpu_online()]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - cpu_online(0); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LN_TYPE_GFP_T -# -# check if gfp_t is typedef-ed -# -AC_DEFUN([LN_TYPE_GFP_T], -[AC_MSG_CHECKING([if kernel defines gfp_t]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - return sizeof(gfp_t); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found]) -],[ - AC_MSG_RESULT([no]) -]) -]) -# -# LN_TYPE_CPUMASK_T -# -# same goes for cpumask_t -# -AC_DEFUN([LN_TYPE_CPUMASK_T], -[AC_MSG_CHECKING([if kernel defines cpumask_t]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - return sizeof (cpumask_t); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LN_FUNC_SHOW_TASK -# -# 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 -]) - -# 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 -]) - -# 2.6.19 API changes -# 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]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - int i = kmem_cache_destroy(NULL); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1, - [kmem_cache_destroy(cachep) return int]) -],[ - AC_MSG_RESULT(NO) -]) -]) - -#2.6.19 API change -#panic_notifier_list use atomic_notifier operations -# -AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER], -[AC_MSG_CHECKING([panic_notifier_list is atomic]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct atomic_notifier_head panic_notifier_list; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1, - [panic_notifier_list is atomic_notifier_head]) -],[ - AC_MSG_RESULT(NO) -]) -]) # # LN_PROG_LINUX @@ -1096,13 +904,9 @@ LB_LINUX_TRY_COMPILE([ # LNet linux kernel checks # AC_DEFUN([LN_PROG_LINUX], -[LN_CONFIG_ZEROCOPY -LN_FUNC_CPU_ONLINE -LN_TYPE_GFP_T -LN_TYPE_CPUMASK_T +[ LN_CONFIG_AFFINITY LN_CONFIG_BACKOFF -LN_CONFIG_PANIC_DUMPLOG LN_CONFIG_QUADRICS LN_CONFIG_GM LN_CONFIG_OPENIB @@ -1113,15 +917,6 @@ LN_CONFIG_O2IB LN_CONFIG_RALND LN_CONFIG_PTLLND LN_CONFIG_MX - -LN_STRUCT_PAGE_LIST -LN_STRUCT_SIGHAND -LN_FUNC_SHOW_TASK -# 2.6.18 -LN_TASKLIST_LOCK -# 2.6.19 -LN_KMEM_CACHE_DESTROY_INT -LN_ATOMIC_PANIC_NOTIFIER ]) # @@ -1193,20 +988,6 @@ else fi AC_SUBST(LIBREADLINE) -AC_MSG_CHECKING([if efence debugging support is requested]) -AC_ARG_ENABLE(efence, - AC_HELP_STRING([--enable-efence], - [use efence library]), - [],[enable_efence='no']) -AC_MSG_RESULT([$enable_efence]) -if test "$enable_efence" = "yes" ; then - LIBEFENCE="-lefence" - AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested]) -else - LIBEFENCE="" -fi -AC_SUBST(LIBEFENCE) - # -------- enable acceptor libwrap (TCP wrappers) support? ------- AC_MSG_CHECKING([if libwrap support is requested]) AC_ARG_ENABLE([libwrap], @@ -1225,31 +1006,6 @@ else fi AC_SUBST(LIBWRAP) -# -------- check for -lpthread support ---- -AC_MSG_CHECKING([whether to use libpthread for lnet library]) -AC_ARG_ENABLE([libpthread], - AC_HELP_STRING([--disable-libpthread], - [disable libpthread]), - [],[enable_libpthread=yes]) -if test "$enable_libpthread" = "yes" ; then - AC_CHECK_LIB([pthread], [pthread_create], - [ENABLE_LIBPTHREAD="yes"], - [ENABLE_LIBPTHREAD="no"]) - if test "$ENABLE_LIBPTHREAD" = "yes" ; then - AC_MSG_RESULT([$ENABLE_LIBPTHREAD]) - PTHREAD_LIBS="-lpthread" - AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread]) - else - PTHREAD_LIBS="" - AC_MSG_RESULT([no libpthread is found]) - fi - AC_SUBST(PTHREAD_LIBS) -else - AC_MSG_RESULT([no (disabled explicitly)]) - ENABLE_LIBPTHREAD="no" -fi -AC_SUBST(ENABLE_LIBPTHREAD) - # ---------------------------------------- # some tests for catamount-like systems # ---------------------------------------- @@ -1325,8 +1081,6 @@ lnet/autoMakefile lnet/autoconf/Makefile lnet/doc/Makefile lnet/include/Makefile -lnet/include/libcfs/Makefile -lnet/include/libcfs/linux/Makefile lnet/include/lnet/Makefile lnet/include/lnet/linux/Makefile lnet/klnds/Makefile @@ -1353,13 +1107,10 @@ lnet/klnds/socklnd/Makefile lnet/klnds/socklnd/autoMakefile lnet/klnds/ptllnd/Makefile lnet/klnds/ptllnd/autoMakefile -lnet/libcfs/Makefile -lnet/libcfs/autoMakefile -lnet/libcfs/linux/Makefile lnet/lnet/Makefile lnet/lnet/autoMakefile -lnet/tests/Makefile -lnet/tests/autoMakefile +lnet/selftest/Makefile +lnet/selftest/autoMakefile lnet/ulnds/Makefile lnet/ulnds/autoMakefile lnet/ulnds/socklnd/Makefile @@ -1369,9 +1120,7 @@ lnet/utils/Makefile case $lb_target_os in darwin) AC_CONFIG_FILES([ -lnet/include/libcfs/darwin/Makefile lnet/include/lnet/darwin/Makefile -lnet/libcfs/darwin/Makefile ]) ;; esac