From c3882b62becfc510e73cd9ee70454c54027a3738 Mon Sep 17 00:00:00 2001 From: eeb Date: Fri, 7 Jan 2005 16:41:51 +0000 Subject: [PATCH] * fixed openib comment typo * better checking/error messages on OpenIB automagic --- lnet/autoconf/lustre-lnet.m4 | 29 ++++++++++++++++++++++------- lnet/klnds/openiblnd/openiblnd.c | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index c840f4a..2c20b92 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -131,34 +131,49 @@ AC_SUBST(GMNAL) AC_DEFUN([LP_CONFIG_OPENIB],[ AC_MSG_CHECKING([whether to enable OpenIB support]) # set default -DFLTOPENIBCPPFLAGS="-I$LINUX/drivers/infiniband/include -DIN_TREE_BUILD" +OPENIBPATH="$LINUX/drivers/infiniband" AC_ARG_WITH([openib], AC_HELP_STRING([--with-openib=path], [build openibnal against path]), [ case $with_openib in - yes) OPENIBCPPFLAGS="$DFLTOPENIBCPPFLAGS" - ENABLEOPENIB=2 + yes) ENABLEOPENIB=2 ;; no) ENABLEOPENIB=0 ;; - *) OPENIBCPPFLAGS="-I$with_openib/include" + *) OPENIBPATH="$with_openib" ENABLEOPENIB=3 ;; esac ],[ - OPENIBCPPFLAGS="$DFLTOPENIBCPPFLAGS" ENABLEOPENIB=1 ]) 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_sa_client.h \); then + AC_MSG_RESULT([no]) + case $ENABLEOPENIB in + 1) ;; + 2) AC_MSG_ERROR([kernel OpenIB headers not present]);; + 3) AC_MSG_ERROR([bad --with-openib path]);; + *) AC_MSG_ERROR([internal error]);; + esac else + case $ENABLEOPENIB in + 1|2) OPENIBCPPFLAGS="-I$OPENIBPATH/include -DIN_TREE_BUILD";; + 3) OPENIBCPPFLAGS="-I$OPENIBPATH/include";; + *) AC_MSG_RESULT([no]) + AC_MSG_ERROR([internal error]);; + esac EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS" EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS" LB_LINUX_TRY_COMPILE([ #include + #include ],[ struct ib_device_properties props; + struct ib_common_attrib_services svc; return 0; ],[ AC_MSG_RESULT([yes]) @@ -167,8 +182,8 @@ else AC_MSG_RESULT([no]) case $ENABLEOPENIB in 1) ;; - 2) AC_MSG_ERROR([default openib headers not present]);; - 3) AC_MSG_ERROR([bad --with-openib path]);; + 2) AC_MSG_ERROR([can't compile with kernel OpenIB headers]);; + 3) AC_MSG_ERROR([can't compile with OpenIB headers under $OPENIBPATH]);; *) AC_MSG_ERROR([internal error]);; esac OPENIBNAL="" diff --git a/lnet/klnds/openiblnd/openiblnd.c b/lnet/klnds/openiblnd/openiblnd.c index 604dee0..9bf9985 100644 --- a/lnet/klnds/openiblnd/openiblnd.c +++ b/lnet/klnds/openiblnd/openiblnd.c @@ -1115,7 +1115,7 @@ kibnal_api_shutdown (nal_t *nal) libcfs_nal_cmd_unregister(OPENIBNAL); /* No new peers */ - /* resetting my NID to unadvertises me, removes my + /* resetting my NID unadvertises me, removes my * listener and nukes all current peers */ kibnal_set_mynid (PTL_NID_ANY); -- 1.8.3.1