-EXTRA_DIST := lustre-lnet.m4
+EXTRA_DIST := ofed.m4 lustre-lnet.m4
fi
fi
- LB_LINUX_TRY_COMPILE([
- #include <linux/version.h>
- #include <linux/pci.h>
- #if !HAVE_GFP_T
- typedef int gfp_t;
- #endif
- #include <rdma/ib_verbs.h>
- ],[
- ib_dma_map_single(NULL, NULL, 0, 0);
- return 0;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_OFED_IB_DMA_MAP, 1,
- [ib_dma_map_single defined])
- ],[
- AC_MSG_RESULT(no)
- ])
-
- LB_LINUX_TRY_COMPILE([
- #include <linux/version.h>
- #include <linux/pci.h>
- #if !HAVE_GFP_T
- typedef int gfp_t;
- #endif
- #include <rdma/ib_verbs.h>
- ],[
- ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
- return 0;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_OFED_IB_COMP_VECTOR, 1,
- [has completion vector])
- ],[
- AC_MSG_RESULT(no)
- ])
-
- LB_LINUX_TRY_COMPILE([
- #include <linux/version.h>
- #include <linux/pci.h>
- #if !HAVE_GFP_T
- typedef int gfp_t;
- #endif
- #include <rdma/ib_verbs.h>
- ],[
- return RDMA_TRANSPORT_IWARP ==
- rdma_node_get_transport(RDMA_NODE_RNIC);
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_OFED_TRANSPORT_IWARP, 1,
- [has transport iWARP])
- ],[
- AC_MSG_RESULT(no)
- ])
-
+ LN_CONFIG_OFED_SPEC
EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
fi
fi
--- /dev/null
+dnl Checks for OFED
+AC_DEFUN([LN_CONFIG_OFED_SPEC],
+[AC_MSG_CHECKING([check ofed specifics])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ ib_dma_map_single(NULL, NULL, 0, 0);
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_IB_DMA_MAP, 1,
+ [ib_dma_map_single defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_IB_COMP_VECTOR, 1,
+ [has completion vector])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ return RDMA_TRANSPORT_IWARP ==
+ rdma_node_get_transport(RDMA_NODE_RNIC);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_TRANSPORT_IWARP, 1,
+ [has transport iWARP])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/rdma_cm.h>
+ ],[
+ return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_RDMA_CMEV_ADDRCHANGE, 1,
+ [has completion vector])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/rdma_cm.h>
+ ],[
+ return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT, 1,
+ [has completion vector])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
switch (event->event) {
default:
+ CERROR("Unexpected event: %d, status: %d\n",
+ event->event, event->status);
LBUG();
case RDMA_CM_EVENT_CONNECT_REQUEST:
/* net keeps its ref on conn! */
return 0;
+#ifdef HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT
+ case RDMA_CM_EVENT_TIMEWAIT_EXIT:
+ CDEBUG(D_NET, "Ignore TIMEWAIT_EXIT event\n");
+ return 0;
+#endif
case RDMA_CM_EVENT_DISCONNECTED:
conn = (kib_conn_t *)cmid->context;
if (conn->ibc_state < IBLND_CONN_ESTABLISHED) {
kiblnd_close_conn(conn, 0);
}
kiblnd_conn_decref(conn);
+ cmid->context = NULL;
return 0;
case RDMA_CM_EVENT_DEVICE_REMOVAL:
/* Can't remove network from underneath LNET for now, so I have
* to ignore this */
return 0;
+
+#ifdef HAVE_OFED_RDMA_CMEV_ADDRCHANGE
+ case RDMA_CM_EVENT_ADDR_CHANGE:
+ LCONSOLE_INFO("Physical link changed (eg hca/port)\n");
+ return 0;
+#endif
}
}