Whamcloud - gitweb
LU-3166 build: Fix failed OFED event checking on OFED-3.5
[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 has RDMA_CM_EVENT_ADDR_CHANGE])
39         LB_LINUX_TRY_COMPILE([
40                 #include <linux/version.h>
41                 #include <linux/pci.h>
42                 #include <linux/gfp.h>
43                 #ifdef HAVE_COMPAT_RDMA
44                 #include <linux/compat-2.6.h>
45                 #endif
46                 #include <rdma/rdma_cm.h>
47         ],[
48                 return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
49         ],[
50                 AC_MSG_RESULT(yes)
51                 AC_DEFINE(HAVE_OFED_RDMA_CMEV_ADDRCHANGE, 1,
52                           [has completion vector])
53         ],[
54                 AC_MSG_RESULT(no)
55         ])
56
57         AC_MSG_CHECKING([if OFED has RDMA_CM_EVENT_TIMEWAIT_EXIT])
58         LB_LINUX_TRY_COMPILE([
59                 #include <linux/version.h>
60                 #include <linux/pci.h>
61                 #include <linux/gfp.h>
62                 #ifdef HAVE_COMPAT_RDMA
63                 #include <linux/compat-2.6.h>
64                 #endif
65                 #include <rdma/rdma_cm.h>
66         ],[
67                 return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
68         ],[
69                 AC_MSG_RESULT(yes)
70                 AC_DEFINE(HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT, 1,
71                           [has completion vector])
72         ],[
73                 AC_MSG_RESULT(no)
74         ])
75
76         AC_MSG_CHECKING([if OFED has rdma_set_reuseaddr])
77         LB_LINUX_TRY_COMPILE([
78                 #include <linux/version.h>
79                 #include <linux/pci.h>
80                 #include <linux/gfp.h>
81                 #ifdef HAVE_COMPAT_RDMA
82                 #include <linux/compat-2.6.h>
83                 #endif
84                 #include <rdma/rdma_cm.h>
85         ],[
86                 rdma_set_reuseaddr(NULL, 1);
87                 return 0;
88         ],[
89                 AC_MSG_RESULT(yes)
90                 AC_DEFINE(HAVE_OFED_RDMA_SET_REUSEADDR, 1,
91                           [rdma_set_reuse defined])
92         ],[
93                 AC_MSG_RESULT(no)
94         ])
95 ])