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