Whamcloud - gitweb
b=17671
[fs/lustre-release.git] / lnet / autoconf / ofed.m4
1 dnl Checks for OFED
2 AC_DEFUN([LN_CONFIG_OFED_SPEC],
3 [AC_MSG_CHECKING([check ofed specifics])
4
5         LB_LINUX_TRY_COMPILE([
6                 #include <linux/version.h>
7                 #include <linux/pci.h>
8                 #if !HAVE_GFP_T
9                 typedef int gfp_t;
10                 #endif
11                 #include <rdma/ib_verbs.h>
12         ],[
13                 ib_dma_map_single(NULL, NULL, 0, 0);
14                 return 0;
15         ],[
16                 AC_MSG_RESULT(yes)
17                 AC_DEFINE(HAVE_OFED_IB_DMA_MAP, 1,
18                           [ib_dma_map_single defined])
19         ],[
20                 AC_MSG_RESULT(no)
21         ])
22
23         LB_LINUX_TRY_COMPILE([
24                 #include <linux/version.h>
25                 #include <linux/pci.h>
26                 #if !HAVE_GFP_T
27                 typedef int gfp_t;
28                 #endif
29                 #include <rdma/ib_verbs.h>
30         ],[
31                 ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
32                 return 0;
33         ],[
34                 AC_MSG_RESULT(yes)
35                 AC_DEFINE(HAVE_OFED_IB_COMP_VECTOR, 1,
36                           [has completion vector])
37         ],[
38                 AC_MSG_RESULT(no)
39         ])
40
41         LB_LINUX_TRY_COMPILE([
42                 #include <linux/version.h>
43                 #include <linux/pci.h>
44                 #if !HAVE_GFP_T
45                 typedef int gfp_t;
46                 #endif
47                 #include <rdma/ib_verbs.h>
48         ],[
49                 return RDMA_TRANSPORT_IWARP ==
50                        rdma_node_get_transport(RDMA_NODE_RNIC);
51         ],[
52                 AC_MSG_RESULT(yes)
53                 AC_DEFINE(HAVE_OFED_TRANSPORT_IWARP, 1,
54                           [has transport iWARP])
55         ],[
56                 AC_MSG_RESULT(no)
57         ])
58
59         LB_LINUX_TRY_COMPILE([
60                 #include <linux/version.h>
61                 #include <linux/pci.h>
62                 #if !HAVE_GFP_T
63                 typedef int gfp_t;
64                 #endif
65                 #include <rdma/rdma_cm.h>
66         ],[
67                 return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
68         ],[
69                 AC_MSG_RESULT(yes)
70                 AC_DEFINE(HAVE_OFED_RDMA_CMEV_ADDRCHANGE, 1,
71                           [has completion vector])
72         ],[
73                 AC_MSG_RESULT(no)
74         ])
75
76         LB_LINUX_TRY_COMPILE([
77                 #include <linux/version.h>
78                 #include <linux/pci.h>
79                 #if !HAVE_GFP_T
80                 typedef int gfp_t;
81                 #endif
82                 #include <rdma/rdma_cm.h>
83         ],[
84                 return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
85         ],[
86                 AC_MSG_RESULT(yes)
87                 AC_DEFINE(HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT, 1,
88                           [has completion vector])
89         ],[
90                 AC_MSG_RESULT(no)
91         ])
92 ])