Whamcloud - gitweb
* fixed openib comment typo
authoreeb <eeb>
Fri, 7 Jan 2005 16:41:51 +0000 (16:41 +0000)
committereeb <eeb>
Fri, 7 Jan 2005 16:41:51 +0000 (16:41 +0000)
*   better checking/error messages on OpenIB automagic

lnet/autoconf/lustre-lnet.m4
lnet/klnds/openiblnd/openiblnd.c

index c840f4a..2c20b92 100644 (file)
@@ -131,34 +131,49 @@ AC_SUBST(GMNAL)
 AC_DEFUN([LP_CONFIG_OPENIB],[
 AC_MSG_CHECKING([whether to enable OpenIB support])
 # set default
 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
 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
                        ;;
                        ;;
                no)     ENABLEOPENIB=0
                        ;;
-               *)      OPENIBCPPFLAGS="-I$with_openib/include"
+               *)      OPENIBPATH="$with_openib"
                        ENABLEOPENIB=3
                        ;;
                esac
        ],[
                        ENABLEOPENIB=3
                        ;;
                esac
        ],[
-                OPENIBCPPFLAGS="$DFLTOPENIBCPPFLAGS"
                ENABLEOPENIB=1
        ])
 if test $ENABLEOPENIB -eq 0; then
        AC_MSG_RESULT([disabled])
                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
 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 <ts_ib_core.h>
        EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="$EXTRA_KCFLAGS $OPENIBCPPFLAGS"
        LB_LINUX_TRY_COMPILE([
                #include <ts_ib_core.h>
+               #include <ts_ib_sa_client.h>
        ],[
                        struct ib_device_properties props;
        ],[
                        struct ib_device_properties props;
+               struct ib_common_attrib_services svc;
                return 0;
        ],[
                AC_MSG_RESULT([yes])
                return 0;
        ],[
                AC_MSG_RESULT([yes])
@@ -167,8 +182,8 @@ else
                AC_MSG_RESULT([no])
                case $ENABLEOPENIB in
                1) ;;
                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=""
                *) AC_MSG_ERROR([internal error]);;
                esac
                OPENIBNAL=""
index 604dee0..9bf9985 100644 (file)
@@ -1115,7 +1115,7 @@ kibnal_api_shutdown (nal_t *nal)
                 libcfs_nal_cmd_unregister(OPENIBNAL);
                 /* No new peers */
 
                 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);
 
                  * listener and nukes all current peers */
                 kibnal_set_mynid (PTL_NID_ANY);