Whamcloud - gitweb
LU-1546 mdd: return nlink as zero for dead objects
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index 6ed99bf..bb30405 100644 (file)
@@ -117,11 +117,12 @@ PTLLNDCPPFLAGS=""
 if test $ENABLEPORTALS -eq 0; then
        AC_MSG_RESULT([no])
 elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
-        AC_MSG_RESULT([no])
+       AC_MSG_RESULT([no])
        AC_MSG_ERROR([bad --with-portals path])
 else
-        AC_MSG_RESULT([$PORTALS])
-        PTLLNDCPPFLAGS="-I${PORTALS}/include"
+       PORTALS=$(readlink --canonicalize $PORTALS)
+       AC_MSG_RESULT([$PORTALS])
+       PTLLNDCPPFLAGS="-I${PORTALS}/include"
 fi
 AC_SUBST(PTLLNDCPPFLAGS)
 ])
@@ -247,6 +248,7 @@ if test -d $QSNET/drivers/net/qsnet ; then
        QSWLND="qswlnd"
        AC_MSG_CHECKING([for multirail EKC])
        if test -f $QSNET/include/elan/epcomms.h; then
+               QSNET=$(readlink --canonicalize $QSNET)
                AC_MSG_RESULT([supported])
                QSWCPPFLAGS="-I$QSNET/include -DMULTIRAIL_EKC=1"
        else
@@ -309,6 +311,7 @@ elif test ! \( -f ${MXPATH}/include/myriexpress.h -a \
        *) AC_MSG_ERROR([internal error]);;
        esac
 else
+       MXPATH=$(readlink --canonicalize $MXPATH)
        MXCPPFLAGS="-I$MXPATH/include"
        EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
        EXTRA_KCFLAGS="$EXTRA_KCFLAGS $MXCPPFLAGS"
@@ -357,19 +360,6 @@ AC_SUBST(MXLND)
 #
 AC_DEFUN([LN_CONFIG_O2IB],[
 
-# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
-AC_MSG_CHECKING([if rdma_create_id wants four args])
-LB_LINUX_TRY_COMPILE([
-       #include <rdma/rdma_cm.h>
-],[
-       rdma_create_id(NULL, NULL, 0, 0);
-],[
-       AC_MSG_RESULT([yes])
-       AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1, [rdma_create_id wants 4 args])
-],[
-       AC_MSG_RESULT([no])
-])
-
 AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
 # set default
 AC_ARG_WITH([o2ib],
@@ -417,6 +407,7 @@ else
                        *) AC_MSG_ERROR([internal error]);;
                esac
        else
+               O2IBPATH=$(readlink --canonicalize $O2IBPATH)
                O2IBCPPFLAGS="-I$O2IBPATH/include"
                EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
                EXTRA_KCFLAGS="$EXTRA_KCFLAGS $O2IBCPPFLAGS"
@@ -425,27 +416,20 @@ else
                LB_LINUX_TRY_COMPILE([
                        #include <linux/version.h>
                        #include <linux/pci.h>
-                       #if !HAVE_GFP_T
-                       typedef int gfp_t;
-                       #endif
+                       #include <linux/gfp.h>
                        #include <rdma/rdma_cm.h>
                        #include <rdma/ib_cm.h>
                        #include <rdma/ib_verbs.h>
                        #include <rdma/ib_fmr_pool.h>
                ],[
-                       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;
-
-                       #ifdef HAVE_RDMA_CREATE_ID_4ARG
-                       cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, 0);
-                       #else
-                       cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
-                       #endif
-                       return PTR_ERR(cm_id);
+                       struct rdma_cm_id      *cm_idi __attribute__ ((unused));
+                       struct rdma_conn_param  conn_param __attribute__ ((unused));
+                       struct ib_device_attr   device_attr __attribute__ ((unused));
+                       struct ib_qp_attr       qp_attr __attribute__ ((unused));
+                       struct ib_pool_fmr      pool_fmr __attribute__ ((unused));
+                       enum   ib_cm_rej_reason rej_reason __attribute__ ((unused));
+
+                       rdma_destroy_id(NULL);
                ],[
                        AC_MSG_RESULT([yes])
                        O2IBLND="o2iblnd"
@@ -493,6 +477,22 @@ fi
 AC_SUBST(EXTRA_LNET_INCLUDE)
 AC_SUBST(O2IBCPPFLAGS)
 AC_SUBST(O2IBLND)
+
+# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
+if test $ENABLEO2IB -ne 0; then
+       AC_MSG_CHECKING([if rdma_create_id wants four args])
+       LB_LINUX_TRY_COMPILE([
+               #include <rdma/rdma_cm.h>
+       ],[
+               rdma_create_id(NULL, NULL, 0, 0);
+       ],[
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
+                       [rdma_create_id wants 4 args])
+       ],[
+               AC_MSG_RESULT([no])
+       ])
+fi
 ])
 
 #
@@ -530,13 +530,88 @@ AC_SUBST(RACPPFLAGS)
 AC_SUBST(RALND)
 ])
 
+#
+# LN_CONFIG_GNILND
+#
+# check whether to use the Gemini Network Interface lnd
+#
+AC_DEFUN([LN_CONFIG_GNILND],
+[#### Gemini Network Interface
+AC_MSG_CHECKING([whether to enable GNI lnd])
+AC_ARG_ENABLE([gni],
+       AC_HELP_STRING([--enable-gni],
+                       [enable GNI lnd]),
+       [],[enable_gni='no'])
+AC_MSG_RESULT([$enable_gni])
+
+if test x$enable_gni = xyes ; then
+       AC_MSG_CHECKING([if GNI kernel headers are present])
+       # placeholder
+       # GNICPPFLAGS was set in spec file
+       EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/types.h>
+               #include <gni_pub.h>
+       ],[
+               gni_cdm_handle_t        kgni_domain;
+               gni_return_t            rc;
+               int                     rrc;
+
+               rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
+
+               rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
+
+               return rrc;
+       ],[
+               AC_MSG_RESULT([yes])
+               GNILND="gnilnd"
+       ],[
+               AC_MSG_RESULT([no])
+               AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
+       ])
+       # at this point, we have gnilnd basic support, now check for extra features
+       AC_MSG_CHECKING([to use RCA in gnilnd])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/types.h>
+               #include <gni_pub.h>
+               #include <krca_lib.h>
+       ],[
+               gni_cdm_handle_t        kgni_domain;
+               gni_return_t            rc;
+               krca_ticket_t           ticket = KRCA_NULL_TICKET;
+               int                     rrc;
+               __u32                   nid = 0, nic_addr;
+
+               rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
+
+               rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
+
+               rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
+
+               rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
+
+               return rrc;
+       ],[
+               AC_MSG_RESULT([yes])
+               GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
+               GNILNDRCA="gnilndrca"
+       ],[
+               AC_MSG_RESULT([no])
+       ])
+       EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
+fi
+AC_SUBST(GNICPPFLAGS)
+AC_SUBST(GNILNDRCA)
+AC_SUBST(GNILND)
+])
 
 
 #
 #
 # LN_CONFIG_USERSPACE
 #
-# This is defined but empty because it is called from 
+# This is defined but empty because it is called from
 # build/autconf/lustre-build.m4 which is shared by all branches.
 #
 AC_DEFUN([LN_CONFIG_USERSPACE],
@@ -555,7 +630,7 @@ LB_LINUX_TRY_COMPILE([
         size_t *lenp = NULL;
         loff_t *ppos = NULL;
 
-        proc_handler *proc_handler;
+        proc_handler *proc_handler = NULL;
         proc_handler(table, write, buffer, lenp, ppos);
 
 ],[
@@ -602,6 +677,7 @@ LN_CONFIG_BACKOFF
 LN_CONFIG_QUADRICS
 LN_CONFIG_O2IB
 LN_CONFIG_RALND
+LN_CONFIG_GNILND
 LN_CONFIG_PTLLND
 LN_CONFIG_MX
 # 2.6.32
@@ -641,11 +717,6 @@ AC_CHECK_FUNCS([gethostbyname socket connect])
 # lnet/utils/debug.c
 AC_CHECK_HEADERS([linux/version.h])
 
-AC_CHECK_TYPE([spinlock_t],
-       [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
-       [],
-       [#include <linux/spinlock.h>])
-
 # lnet/utils/wirecheck.c
 AC_CHECK_FUNCS([strnlen])
 
@@ -749,8 +820,9 @@ AC_DEFUN([LN_CONDITIONALS],
 AM_CONDITIONAL(BUILD_MXLND, test x$MXLND = "xmxlnd")
 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
 AM_CONDITIONAL(BUILD_RALND, test x$RALND = "xralnd")
+AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
+AM_CONDITIONAL(BUILD_GNILND_RCA, test x$GNILNDRCA = "xgnilndrca")
 AM_CONDITIONAL(BUILD_PTLLND, test x$PTLLND = "xptllnd")
-AM_CONDITIONAL(BUILD_UPTLLND, test x$UPTLLND = "xptllnd")
 AM_CONDITIONAL(BUILD_USOCKLND, test x$USOCKLND = "xusocklnd")
 ])
 
@@ -779,6 +851,8 @@ lnet/klnds/qswlnd/Makefile
 lnet/klnds/qswlnd/autoMakefile
 lnet/klnds/ralnd/Makefile
 lnet/klnds/ralnd/autoMakefile
+lnet/klnds/gnilnd/Makefile
+lnet/klnds/gnilnd/autoMakefile
 lnet/klnds/socklnd/Makefile
 lnet/klnds/socklnd/autoMakefile
 lnet/klnds/ptllnd/Makefile
@@ -790,7 +864,6 @@ lnet/selftest/autoMakefile
 lnet/ulnds/Makefile
 lnet/ulnds/autoMakefile
 lnet/ulnds/socklnd/Makefile
-lnet/ulnds/ptllnd/Makefile
 lnet/utils/Makefile
 lnet/include/lnet/darwin/Makefile
 ])