From 9a8b5fc0ff23eb1e5876f44a142446d9c933c551 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 21 Aug 2008 21:27:00 +0000 Subject: [PATCH] b=16364 Back this out until I can give more though to the differences that patchless builds pose. (It shouldn;t have been landed on b1_x anyway, from what I can gather -- there is actually a b1_x_lnet_gate now.). --- lnet/autoconf/lustre-lnet.m4 | 166 +++++++++++++++++-------------------------- 1 file changed, 67 insertions(+), 99 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index d66745e..6d0e18c 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -530,7 +530,7 @@ else -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then o2ib_found=true break - fi + fi done if ! $o2ib_found; then AC_MSG_RESULT([no]) @@ -541,115 +541,83 @@ else *) AC_MSG_ERROR([internal error]);; esac else - # figure out whether the kernel has an infiniband stack - # configured - LB_LINUX_CONFIG_IM([INFINIBAND],[ - CONFIG_INFINIBAND_MODULE_defined=true + 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); ],[ - CONFIG_INFINIBAND_MODULE_defined=false + 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="" ]) - # at this point we know that the user either explicitly - # requested o2ib support or didn't explicitly disable it so - # make sure the kernel's CONFIG_INFINIBAND variable is set - # appropriately. - # - # possible error conditions are: - # 1) --with-o2ib[=yes] (implies in kernel since no path was - # given) and kernel not configured for IB - # 2) --with-o2ib=/path and kernel is configured for IB - # - if test "$O2IBPATH" = "$LINUX" -o "$O2IBPATH" = "$LINUX/drivers/infiniband"; then - # infiniband stack is in the kernel - if test $ENABLEO2IB -eq 1 -o $ENABLEO2IB -eq 2 && ! $CONFIG_INFINIBAND_MODULE_defined; then - # case #1 - AC_MSG_ERROR([Kernel supplied OFED drivers are being requested however the kernel is NOT configured to build OFED modules. Please specify --with-o2ib= or rebuild the kernel with Infiniband enabled.]) - fi - else - # had to be a specified path with --with-o2ib=/path - if $CONFIG_INFINIBAND_MODULE_defined; then - # case #2 - AC_MSG_ERROR([External OFED source has been specified but the kernel is configured to build OFED modules as well. Remove --with-o2ib from the configuration or rebuild the kernel without Infiniband.]) - fi - fi - if $o2ib_found; then - 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 - O2IB_SYMVER="" - if test $ENABLEO2IB -eq 3 ; then - # OFED default rpm not handle sles10 Modules.symvers name - for name in Module.symvers Modules.symvers; do - if test -f $O2IBPATH/$name; then - O2IB_SYMVER=$name; - break; - fi - done - if test -n $O2IB_SYMVER ; then - AC_MSG_NOTICE([adding $O2IBPATH/Module.symvers to $PWD/$SYMVERFILE]) - # strip out the existing symbols versions first - egrep -v $(echo $(awk '{ print $2 }' $O2IBPATH/$O2IB_SYMVER) | tr ' ' '|') $PWD/$SYMVERFILE > $PWD/$SYMVERFILE.old - cat $PWD/$SYMVERFILE.old $O2IBPATH/$O2IB_SYMVER > $PWD/$SYMVERFILE - else - AC_MSG_ERROR([an external source tree was specified for o2iblnd however I could not find a $O2IBPATH/Module.symvers there]) + # we know at this point that the found OFED source is good + O2IB_SYMVER="" + if test $ENABLEO2IB -eq 3 ; then + # OFED default rpm not handle sles10 Modules.symvers name + for name in Module.symvers Modules.symvers; do + if test -f $O2IBPATH/$name; then + O2IB_SYMVER=$name; + break; fi + done + if test -n $O2IB_SYMVER ; then + AC_MSG_NOTICE([adding $O2IBPATH/Module.symvers to $PWD/$SYMVERFILE]) + # strip out the existing symbols versions first + egrep -v $(echo $(awk '{ print $2 }' $O2IBPATH/$O2IB_SYMVER) | tr ' ' '|') $PWD/$SYMVERFILE > $PWD/$SYMVERFILE.old + cat $PWD/$SYMVERFILE.old $O2IBPATH/$O2IB_SYMVER > $PWD/$SYMVERFILE + 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 + # 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 \ + 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 - if grep -q comp_vector \ - ${O2IBPATH}/include/rdma/ib_verbs.h; then - IBLND_OFED_VERSION="1025" - else - IBLND_OFED_VERSION="1020" - fi + IBLND_OFED_VERSION="1025" else - IBLND_OFED_VERSION="1010" + IBLND_OFED_VERSION="1020" fi + else + IBLND_OFED_VERSION="1010" + fi - AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION, - [OFED version]) + AC_DEFINE_UNQUOTED(IBLND_OFED_VERSION, $IBLND_OFED_VERSION, + [OFED version]) - EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" - fi + EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" fi fi -- 1.8.3.1