3 # check if tunable tcp backoff is available/wanted
5 AC_DEFUN([LN_CONFIG_BACKOFF], [
6 AC_MSG_CHECKING([whether to enable tunable backoff TCP support])
7 AC_ARG_ENABLE([backoff],
8 AS_HELP_STRING([--disable-backoff],
9 [disable socknal tunable backoff]),
10 [], [enable_backoff="yes"])
11 AC_MSG_RESULT([$enable_backoff])
12 AS_IF([test "x$enable_backoff" = xyes], [
13 AC_MSG_CHECKING([if Linux kernel has tunable backoff TCP support])
14 AS_IF([grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h >/dev/null], [
16 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
17 AS_IF([grep rto_max $LINUX/include/linux/tcp.h | grep -q __u16 >/dev/null],
18 [AC_DEFINE(SOCKNAL_BACKOFF_MS, 1,
19 [tunable backoff TCP in ms])])
24 ]) # LN_CONFIG_BACKOFF
31 # fail to build if libyaml is not installed
33 AC_DEFUN([LN_CONFIG_DLC], [
34 AS_IF([test "x$enable_dist" = xno], [
35 AC_CHECK_LIB([yaml], [yaml_parser_initialize],
37 [AC_MSG_ERROR([YAML development libraries not not installed])],
45 # If current OFED installed (assume with "ofed_info") and devel
46 # headers are not found, error because we assume OFED infiniband
47 # driver needs to be used and we must configure/build with it.
48 # Current OFED headers detection mechanism allow for non-standard
49 # prefix but relies on "ofed_info" command and on "%prefix/openib"
50 # link (both are ok for 1.5.x and 3.x versions), and should work
51 # for both source and DKMS builds.
53 AC_DEFUN([LN_CONFIG_O2IB], [
54 AC_MSG_CHECKING([whether to use Compat RDMA])
56 AS_HELP_STRING([--with-o2ib=[yes|no|<path>]],
57 [build o2iblnd against path]),
58 [], [with_o2ib="yes"])
61 yes) AS_IF([which ofed_info 2>/dev/null], [
62 AS_IF([test x$uses_dpkg = xyes], [
63 LIST_ALL_PKG="dpkg -l | awk '{print \[$]2}'"
64 LSPKG="dpkg --listfiles"
66 LIST_ALL_PKG="rpm -qa"
70 O2IBPKG="mlnx-ofed-kernel-dkms"
71 O2IBPKG+="|mlnx-ofed-kernel-modules"
72 O2IBPKG+="|mlnx-ofa_kernel-devel"
73 O2IBPKG+="|compat-rdma-devel"
74 O2IBPKG+="|kernel-ib-devel"
75 O2IBPKG+="|ofa_kernel-devel"
78 O2IBDIR+="|/ofa_kernel/default"
81 O2IBDIR_PATH=$(eval $LIST_ALL_PKG |
82 egrep -w "$O2IBPKG" | xargs $LSPKG |
83 egrep "${O2IBDIR}$" | head -n1)
85 if test -n "$O2IBDIR_PATH"; then
86 O2IBPATHS=$(find $O2IBDIR_PATH -name rdma_cm.h |
87 egrep "`uname -r`|default" |
88 sed -e 's/\/include\/rdma\/rdma_cm.h//')
91 AS_IF([test -z "$O2IBPATHS"], [
93 You seem to have an OFED installed but have not installed it's devel package.
94 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
95 Instead, if you want to build Lustre for your kernel's built-in I/B stack rather than your installed OFED stack, either remove the OFED package(s) or use --with-o2ib=no.
98 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
100 It appears that you have multiple OFED versions installed.
101 If you still want to build Lustre for your OFED I/B stack, you need to install a single version with its devel headers RPM.
102 Instead, if you want to build Lustre for your in-kernel I/B stack rather than your installed external OFED stack, either remove the OFED package(s) or use --with-o2ib=no.
105 if test -e $O2IBPATHS/${LINUXRELEASE}; then
106 O2IBPATHS=$O2IBPATHS/${LINUXRELEASE}
107 elif test -e $O2IBPATHS/default; then
108 O2IBPATHS=$O2IBPATHS/default
112 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
118 *) O2IBPATHS=$with_o2ib
119 ENABLEO2IB="withpath"
124 AS_IF([test $ENABLEO2IB = "no"], [
126 AC_DEFUN([LN_CONFIG_O2IB_SRC], [])
127 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [])
130 for O2IBPATH in $O2IBPATHS; do
131 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
132 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
133 -f ${O2IBPATH}/include/rdma/ib_verbs.h \)], [
138 if ! $o2ib_found; then
141 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
142 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
143 *) AC_MSG_ERROR([internal error]) ;;
147 compatrdma_found=false
148 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
150 compatrdma_found=true
151 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
152 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
153 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
154 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
159 if ! $compatrdma_found; then
160 if test -f "$O2IBPATH/config.mk"; then
161 . "$O2IBPATH/config.mk"
162 elif test -f "$O2IBPATH/ofed_patch.mk"; then
163 . "$O2IBPATH/ofed_patch.mk"
165 elif test -z "$COMPAT_AUTOCONF"; then
167 if test "x$RHEL_KERNEL" = xyes; then
168 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
169 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
170 while test "$I" -ge 0; do
171 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
174 elif test "x$SUSE_KERNEL" = xyes; then
175 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
176 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
180 AC_MSG_CHECKING([whether to use any OFED backport headers])
181 if test -n "$BACKPORT_INCLUDES"; then
183 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
184 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
190 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
191 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include -I$O2IBPATH/include/uapi"
192 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
193 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
194 openib_gen2_support, [
195 #ifdef HAVE_COMPAT_RDMA
197 #undef PACKAGE_TARNAME
198 #undef PACKAGE_VERSION
199 #undef PACKAGE_STRING
200 #undef PACKAGE_BUGREPORT
202 #include <linux/compat-2.6.h>
204 #include <linux/version.h>
205 #include <linux/pci.h>
206 #include <linux/gfp.h>
207 #include <rdma/rdma_cm.h>
208 #include <rdma/ib_cm.h>
209 #include <rdma/ib_verbs.h>
211 struct rdma_cm_id *cm_idi __attribute__ ((unused));
212 struct rdma_conn_param conn_param __attribute__ ((unused));
213 struct ib_device_attr device_attr __attribute__ ((unused));
214 struct ib_qp_attr qp_attr __attribute__ ((unused));
215 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
216 rdma_destroy_id(NULL);
221 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
222 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
223 *) AC_MSG_ERROR([internal error]) ;;
226 # we know at this point that the found OFED source is good
228 if test -f $O2IBPATH/Module.symvers; then
229 O2IB_SYMVER=$O2IBPATH/Module.symvers
230 elif test "x$SUSE_KERNEL" = "xyes"; then
231 O2IB_SYMVER=$(find ${O2IBPATH}* -name Module.symvers)
232 # Select only the current 'flavor' if there is more than 1
233 NUM_AVAIL=$(find ${O2IBPATH}* -name Module.symvers | wc -l)
234 if test ${NUM_AVAIL} -gt 1; then
235 PREFER=$(basename ${LINUX_OBJ})
236 for F in $(find ${O2IBPATH}-obj -name Module.symvers)
238 maybe=$(echo $F | grep "/${PREFER}")
239 if test "x$maybe" != "x"; then
244 elif test -f $LINUX_OBJ/Module.symvers; then
245 # Debian symvers is in the arch tree
246 O2IB_SYMVER=$LINUX_OBJ/Module.symvers
248 if test -n "$O2IB_SYMVER"; then
249 if test !"$O2IB_SYMVER" -ef "$LINUX_OBJ/Module.symvers"; then
250 AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path O2IB])
251 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
252 AC_SUBST(EXTRA_SYMBOLS)
255 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
258 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
259 linux_kthread_worker, [
260 #ifdef HAVE_COMPAT_RDMA
262 #undef PACKAGE_TARNAME
263 #undef PACKAGE_VERSION
264 #undef PACKAGE_STRING
265 #undef PACKAGE_BUGREPORT
267 #include <linux/compat-2.6.h>
269 #include <linux/kthread.h>
271 struct kthread_work *kth_wrk = NULL;
272 flush_kthread_work(kth_wrk);
274 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
275 if test -z "$COMPAT_AUTOCONF"; then
276 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
279 EXTRA_CHECK_INCLUDE=""
282 AC_SUBST(EXTRA_OFED_CONFIG)
283 AC_SUBST(EXTRA_OFED_INCLUDE)
288 AS_IF([test $ENABLEO2IB != "no"], [
289 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
290 if test ! $O2IBPATH -ef $LINUX_OBJ; then
291 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $O2IBPATH/Module.symvers"
294 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
295 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_4A], [
296 LB2_LINUX_TEST_SRC([rdma_create_id_4args], [
297 #ifdef HAVE_COMPAT_RDMA
299 #undef PACKAGE_TARNAME
300 #undef PACKAGE_VERSION
301 #undef PACKAGE_STRING
302 #undef PACKAGE_BUGREPORT
304 #include <linux/compat-2.6.h>
306 #include <rdma/rdma_cm.h>
308 rdma_create_id(NULL, NULL, 0, 0);
309 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
311 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_4A], [
312 AC_MSG_CHECKING([if 'rdma_create_id' wants four args])
313 LB2_LINUX_TEST_RESULT([rdma_create_id_4args], [
314 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
315 [rdma_create_id wants 4 args])
319 # 4.4 added network namespace parameter for rdma_create_id()
320 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_5A], [
321 LB2_LINUX_TEST_SRC([rdma_create_id_5args], [
322 #ifdef HAVE_COMPAT_RDMA
324 #undef PACKAGE_TARNAME
325 #undef PACKAGE_VERSION
326 #undef PACKAGE_STRING
327 #undef PACKAGE_BUGREPORT
329 #include <linux/compat-2.6.h>
331 #include <rdma/rdma_cm.h>
333 rdma_create_id(NULL, NULL, NULL, 0, 0);
334 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
336 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_5A], [
337 AC_MSG_CHECKING([if 'rdma_create_id' wants five args])
338 LB2_LINUX_TEST_RESULT([rdma_create_id_5args], [
339 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
340 [rdma_create_id wants 5 args])
344 # 4.2 introduced struct ib_cq_init_attr which is used
345 # by ib_create_cq(). Note some OFED stacks only keep
346 # their headers in sync with latest kernels but not
347 # the functionality which means for infiniband testing
348 # we need to always test functionality testings.
349 AC_DEFUN([LN_SRC_O2IB_IB_CQ_INIT_ATTR], [
350 LB2_LINUX_TEST_SRC([ib_cq_init_attr], [
351 #ifdef HAVE_COMPAT_RDMA
353 #undef PACKAGE_TARNAME
354 #undef PACKAGE_VERSION
355 #undef PACKAGE_STRING
356 #undef PACKAGE_BUGREPORT
358 #include <linux/compat-2.6.h>
360 #include <rdma/ib_verbs.h>
362 struct ib_cq_init_attr cq_attr;
364 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
365 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
367 AC_DEFUN([LN_O2IB_IB_CQ_INIT_ATTR], [
368 AC_MSG_CHECKING([if 'struct ib_cq_init_attr' is used])
369 LB2_LINUX_TEST_RESULT([ib_cq_init_attr], [
370 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
371 [struct ib_cq_init_attr is used by ib_create_cq])
375 # 4.3 removed ib_alloc_fast_reg_mr()
376 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR], [
377 LB2_LINUX_TEST_SRC([ib_alloc_fast_reg_mr], [
378 #ifdef HAVE_COMPAT_RDMA
380 #undef PACKAGE_TARNAME
381 #undef PACKAGE_VERSION
382 #undef PACKAGE_STRING
383 #undef PACKAGE_BUGREPORT
385 #include <linux/compat-2.6.h>
387 #include <rdma/ib_verbs.h>
389 ib_alloc_fast_reg_mr(NULL, 0);
390 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
392 AC_DEFUN([LN_O2IB_IB_ALLOC_FAST_REG_MR], [
393 AC_MSG_CHECKING([if 'ib_alloc_fast_reg_mr' exists])
394 LB2_LINUX_TEST_RESULT([ib_alloc_fast_reg_mr], [
395 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
396 [ib_alloc_fast_reg_mr is defined])
400 # 4.9 must stop using ib_get_dma_mr and the global MR
401 # We then have to use FMR/Fastreg for all RDMA.
402 AC_DEFUN([LN_SRC_O2IB_IB_GET_DMA_MR], [
403 LB2_LINUX_TEST_SRC([ib_get_dma_mr], [
404 #ifdef HAVE_COMPAT_RDMA
406 #undef PACKAGE_TARNAME
407 #undef PACKAGE_VERSION
408 #undef PACKAGE_STRING
409 #undef PACKAGE_BUGREPORT
411 #include <linux/compat-2.6.h>
413 #include <rdma/ib_verbs.h>
415 ib_get_dma_mr(NULL, 0);
416 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
418 AC_DEFUN([LN_O2IB_IB_GET_DMA_MR], [
419 AC_MSG_CHECKING([if 'ib_get_dma_mr' exists])
420 LB2_LINUX_TEST_RESULT([ib_get_dma_mr], [
421 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
422 [ib_get_dma_mr is defined])
426 # In v4.4 Linux kernel,
427 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
428 # split up struct ib_send_wr so that all non-trivial verbs
429 # use their own structure which embedds struct ib_send_wr.
430 AC_DEFUN([LN_SRC_O2IB_IB_RDMA_WR], [
431 LB2_LINUX_TEST_SRC([ib_rdma_wr], [
432 #ifdef HAVE_COMPAT_RDMA
434 #undef PACKAGE_TARNAME
435 #undef PACKAGE_VERSION
436 #undef PACKAGE_STRING
437 #undef PACKAGE_BUGREPORT
439 #include <linux/compat-2.6.h>
441 #include <rdma/ib_verbs.h>
443 const struct ib_rdma_wr *wr __attribute__ ((unused));
446 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
448 AC_DEFUN([LN_O2IB_IB_RDMA_WR], [
449 AC_MSG_CHECKING([if 'struct ib_rdma_wr' is defined])
450 LB2_LINUX_TEST_RESULT([ib_rdma_wr], [
451 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
452 [struct ib_rdma_wr is defined])
456 # new fast registration API introduced in 4.4
457 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_4A], [
458 LB2_LINUX_TEST_SRC([ib_map_mr_sg_4args], [
459 #ifdef HAVE_COMPAT_RDMA
461 #undef PACKAGE_TARNAME
462 #undef PACKAGE_VERSION
463 #undef PACKAGE_STRING
464 #undef PACKAGE_BUGREPORT
466 #include <linux/compat-2.6.h>
468 #include <rdma/ib_verbs.h>
470 ib_map_mr_sg(NULL, NULL, 0, 0);
471 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
473 # new fast registration API introduced in 4.4
474 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_4A], [
475 AC_MSG_CHECKING([if 4arg 'ib_map_mr_sg' exists])
476 LB2_LINUX_TEST_RESULT([ib_map_mr_sg_4args], [
477 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
478 [ib_map_mr_sg exists])
482 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
483 # in kernel 4.7 (and RHEL 7.3)
484 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_5A], [
485 LB2_LINUX_TEST_SRC([ib_map_mr_sg_5args], [
486 #ifdef HAVE_COMPAT_RDMA
488 #undef PACKAGE_TARNAME
489 #undef PACKAGE_VERSION
490 #undef PACKAGE_STRING
491 #undef PACKAGE_BUGREPORT
493 #include <linux/compat-2.6.h>
495 #include <rdma/ib_verbs.h>
497 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
498 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
500 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_5A], [
501 AC_MSG_CHECKING([if 5arg 'ib_map_mr_sg' exists])
502 LB2_LINUX_TEST_RESULT([ib_map_mr_sg_5args], [
503 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
504 [ib_map_mr_sg exists])
505 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
506 [ib_map_mr_sg has 5 arguments])
510 # ib_query_device() removed in 4.5
511 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_ATTRS], [
512 LB2_LINUX_TEST_SRC([ib_device_attrs], [
513 #ifdef HAVE_COMPAT_RDMA
515 #undef PACKAGE_TARNAME
516 #undef PACKAGE_VERSION
517 #undef PACKAGE_STRING
518 #undef PACKAGE_BUGREPORT
520 #include <linux/compat-2.6.h>
522 #include <rdma/ib_verbs.h>
524 struct ib_device dev;
525 struct ib_device_attr dev_attr = {};
526 dev.attrs = dev_attr;
527 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
529 AC_DEFUN([LN_O2IB_IB_DEVICE_ATTRS], [
530 AC_MSG_CHECKING([if 'struct ib_device' has member 'attrs'])
531 LB2_LINUX_TEST_RESULT([ib_device_attrs], [
532 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
533 [struct ib_device.attrs is defined])
537 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
538 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
539 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_PD], [
540 LB2_LINUX_TEST_SRC([ib_alloc_pd], [
541 #ifdef HAVE_COMPAT_RDMA
543 #undef PACKAGE_TARNAME
544 #undef PACKAGE_VERSION
545 #undef PACKAGE_STRING
546 #undef PACKAGE_BUGREPORT
548 #include <linux/compat-2.6.h>
550 #include <rdma/ib_verbs.h>
552 ib_alloc_pd(NULL, 0);
553 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
555 AC_DEFUN([LN_O2IB_IB_ALLOC_PD], [
556 AC_MSG_CHECKING([if 2arg 'ib_alloc_pd' exists])
557 LB2_LINUX_TEST_RESULT([ib_alloc_pd], [
558 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
559 [ib_alloc_pd has 2 arguments])
563 AC_DEFUN([LN_SRC_O2IB_IB_INC_RKEY], [
564 LB2_LINUX_TEST_SRC([ib_inc_rkey], [
565 #ifdef HAVE_COMPAT_RDMA
567 #undef PACKAGE_TARNAME
568 #undef PACKAGE_VERSION
569 #undef PACKAGE_STRING
570 #undef PACKAGE_BUGREPORT
572 #include <linux/compat-2.6.h>
574 #include <rdma/ib_verbs.h>
576 (void)ib_inc_rkey(0);
577 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
579 AC_DEFUN([LN_O2IB_IB_INC_RKEY], [
580 AC_MSG_CHECKING([if function 'ib_inc_rkey' is defined])
581 LB2_LINUX_TEST_RESULT([ib_inc_rkey], [
582 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
583 [function ib_inc_rkey exist])
587 # In MOFED 4.6, the second and third parameters for
588 # ib_post_send() and ib_post_recv() are declared with
590 AC_DEFUN([LN_SRC_O2IB_IB_POST_SEND_CONST], [
591 LB2_LINUX_TEST_SRC([ib_post_send_recv_const], [
592 #ifdef HAVE_COMPAT_RDMA
594 #undef PACKAGE_TARNAME
595 #undef PACKAGE_VERSION
596 #undef PACKAGE_STRING
597 #undef PACKAGE_BUGREPORT
599 #include <linux/compat-2.6.h>
601 #include <rdma/ib_verbs.h>
603 ib_post_send(NULL, (const struct ib_send_wr *)NULL,
604 (const struct ib_send_wr **)NULL);
605 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
607 AC_DEFUN([LN_O2IB_IB_POST_SEND_CONST], [
608 AC_MSG_CHECKING([if 'ib_post_send() and ib_post_recv()' have const parameters])
609 LB2_LINUX_TEST_RESULT([ib_post_send_recv_const], [
610 AC_DEFINE(HAVE_IB_POST_SEND_RECV_CONST, 1,
611 [ib_post_send and ib_post_recv have const parameters])
616 # LN_IB_DEVICE_OPS_EXISTS
618 # kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
619 # RDMA/core: Introduce ib_device_ops
620 # ... introduces the ib_device_ops structure that defines all the
621 # InfiniBand device operations in one place ...
623 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS], [
624 LB2_LINUX_TEST_SRC([ib_device_ops_test], [
625 #include <rdma/ib_verbs.h>
627 int x = offsetof(struct ib_device_ops, unmap_fmr);
630 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
632 AC_DEFUN([LN_O2IB_IB_DEVICE_OPS_EXISTS], [
633 AC_MSG_CHECKING([if struct ib_device_ops is defined])
634 LB2_LINUX_TEST_RESULT([ib_device_ops_test], [
635 AC_DEFINE(HAVE_IB_DEVICE_OPS, 1,
636 [if struct ib_device_ops is defined])
638 ]) # LN_IB_DEVICE_OPS_EXISTS
641 # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
643 # kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
644 # IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
645 # ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
647 AC_DEFUN([LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
648 LB2_LINUX_TEST_SRC([ib_sg_dma_address_test], [
649 #include <rdma/ib_verbs.h>
651 u64 x = ib_sg_dma_address(NULL, NULL);
654 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
656 AC_DEFUN([LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
657 AC_MSG_CHECKING([if ib_sg_dma_address wrapper exists])
658 LB2_LINUX_TEST_RESULT([ib_sg_dma_address_test], [
659 AC_DEFINE(HAVE_IB_SG_DMA_ADDRESS, 1,
660 [if ib_sg_dma_address wrapper exists])
662 ]) # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
665 # LN_O2IB_RDMA_REJECT
667 # A reason argument was added to rdma_reject() in Linux 5.8,
668 # commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a
669 AC_DEFUN([LN_SRC_O2IB_RDMA_REJECT], [
670 LB2_LINUX_TEST_SRC([rdma_reject], [
671 #ifdef HAVE_COMPAT_RDMA
673 #undef PACKAGE_TARNAME
674 #undef PACKAGE_VERSION
675 #undef PACKAGE_STRING
676 #undef PACKAGE_BUGREPORT
678 #include <linux/compat-2.6.h>
680 #include <rdma/ib_verbs.h>
681 #include <rdma/ib_cm.h>
682 #include <rdma/rdma_cm.h>
684 rdma_reject(NULL, NULL, 0, 0);
685 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
687 AC_DEFUN([LN_O2IB_RDMA_REJECT], [
688 AC_MSG_CHECKING([if 4arg 'rdma_reject' exists])
689 LB2_LINUX_TEST_RESULT([rdma_reject], [
690 AC_DEFINE(HAVE_RDMA_REJECT_4ARGS, 1,
691 [rdma_reject has 4 arguments])
693 ]) # LN_O2IB_RDMA_REJECT
698 # The FMR pool API was removed in Linux 5.8,
699 # commit 4e373d5417ecbb4f438a8500f0379a2fc29c2643
700 AC_DEFUN([LN_SRC_O2IB_IB_FMR], [
701 LB2_LINUX_TEST_SRC([ib_fmr], [
702 #include <rdma/ib_verbs.h>
704 struct ib_fmr fmr = {};
705 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
707 AC_DEFUN([LN_O2IB_IB_FMR], [
708 AC_MSG_CHECKING([if FMR pools API available])
709 LB2_LINUX_TEST_RESULT([ib_fmr], [
710 AC_DEFINE(HAVE_FMR_POOL_API, 1,
711 [FMR pool API is available])
716 # LN_O2IB_RDMA_CONNECT_LOCKED
718 # rdma_connect_locked() was added in Linux 5.10,
719 # commit 071ba4cc559de47160761b9500b72e8fa09d923d
720 # and in MOFED-5.2-2. rdma_connect_locked() must
721 # be called instead of rdma_connect() in
722 # RDMA_CM_EVENT_ROUTE_RESOLVED handler.
723 AC_DEFUN([LN_SRC_O2IB_RDMA_CONNECT_LOCKED], [
724 LB2_LINUX_TEST_SRC([rdma_connect_locked], [
725 #include <rdma/rdma_cm.h>
727 rdma_connect_locked(NULL, NULL);
728 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
730 AC_DEFUN([LN_O2IB_RDMA_CONNECT_LOCKED], [
731 AC_MSG_CHECKING([if 'rdma_connect_locked' exists])
732 LB2_LINUX_TEST_RESULT([rdma_connect_locked], [
733 AC_DEFINE(HAVE_RDMA_CONNECT_LOCKED, 1,
734 [rdma_connect_locked is defined])
736 ]) # LN_O2IB_RDMA_CONNECT_LOCKED
739 # LN_O2IB_ETHTOOL_LINK_SETTINGS
741 # ethtool_link_settings was added in Linux 4.6
743 AC_DEFUN([LN_SRC_O2IB_ETHTOOL_LINK_SETTINGS], [
744 LB2_LINUX_TEST_SRC([ethtool_link_settings], [
745 #include <linux/ethtool.h>
747 struct ethtool_link_ksettings cmd;
748 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
750 AC_DEFUN([LN_O2IB_ETHTOOL_LINK_SETTINGS], [
751 AC_MSG_CHECKING([if 'ethtool_link_settings' exists])
752 LB2_LINUX_TEST_RESULT([ethtool_link_settings], [
753 AC_DEFINE(HAVE_ETHTOOL_LINK_SETTINGS, 1,
754 [ethtool_link_settings is defined])
756 ]) # LN_O2IB_ETHTOOL_LINK_SETTINGS
758 EXTRA_CHECK_INCLUDE=""
760 AC_DEFUN([LN_CONFIG_O2IB_SRC], [
761 LN_SRC_O2IB_RDMA_CREATE_ID_4A
762 LN_SRC_O2IB_RDMA_CREATE_ID_5A
763 LN_SRC_O2IB_IB_CQ_INIT_ATTR
764 LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR
765 LN_SRC_O2IB_IB_GET_DMA_MR
766 LN_SRC_O2IB_IB_RDMA_WR
767 LN_SRC_O2IB_IB_MAP_MR_SG_4A
768 LN_SRC_O2IB_IB_MAP_MR_SG_5A
769 LN_SRC_O2IB_IB_DEVICE_ATTRS
770 LN_SRC_O2IB_IB_ALLOC_PD
771 LN_SRC_O2IB_IB_INC_RKEY
772 LN_SRC_O2IB_IB_POST_SEND_CONST
773 LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS
774 LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS
775 LN_SRC_O2IB_RDMA_REJECT
777 LN_SRC_O2IB_RDMA_CONNECT_LOCKED
778 LN_SRC_O2IB_ETHTOOL_LINK_SETTINGS
780 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [
781 LN_O2IB_RDMA_CREATE_ID_4A
782 LN_O2IB_RDMA_CREATE_ID_5A
783 LN_O2IB_IB_CQ_INIT_ATTR
784 LN_O2IB_IB_ALLOC_FAST_REG_MR
785 LN_O2IB_IB_GET_DMA_MR
787 LN_O2IB_IB_MAP_MR_SG_4A
788 LN_O2IB_IB_MAP_MR_SG_5A
789 LN_O2IB_IB_DEVICE_ATTRS
792 LN_O2IB_IB_POST_SEND_CONST
793 LN_O2IB_IB_DEVICE_OPS_EXISTS
794 LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
797 LN_O2IB_RDMA_CONNECT_LOCKED
798 LN_O2IB_ETHTOOL_LINK_SETTINGS
800 ]) # ENABLEO2IB != "no"
806 # check whether to use the Gemini Network Interface lnd
808 AC_DEFUN([LN_CONFIG_GNILND], [
809 AC_MSG_CHECKING([whether to enable GNI lnd])
811 AS_HELP_STRING([--enable-gni],
813 [], [enable_gni="no"])
814 AC_MSG_RESULT([$enable_gni])
816 AS_IF([test "x$enable_gni" = xyes], [
817 # GNICPPFLAGS was set in spec file
818 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
819 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
820 LB_CHECK_COMPILE([if GNI kernel headers are present],
822 #include <linux/types.h>
825 gni_cdm_handle_t kgni_domain;
828 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
829 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
834 AC_MSG_ERROR([cannot compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
836 # at this point, we have gnilnd basic support,
837 # now check for extra features
838 LB_CHECK_COMPILE([to use RCA in gnilnd],
840 #include <linux/types.h>
842 #include <krca_lib.h>
844 gni_cdm_handle_t kgni_domain;
846 krca_ticket_t ticket = KRCA_NULL_TICKET;
848 __u32 nid = 0, nic_addr;
849 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
850 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
851 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
852 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
855 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
857 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
859 AC_SUBST(GNICPPFLAGS)
861 ]) # LN_CONFIG_GNILND
866 # check whether to use the kfabric Network Interface lnd
868 AC_DEFUN([LN_CONFIG_KFILND], [
870 AS_HELP_STRING([--with-kfi=<path>], [Kfabric build path for kfilnd]),
872 AC_CHECK_FILE([$with_kfi/Module.symvers],
874 # KFICPPFLAGS was set in spec file
875 KFICPPFLAGS="-I$with_kfi/include"
876 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
877 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $KFICPPFLAGS"
878 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $with_kfi/Module.symvers"
879 LB_CHECK_COMPILE([if kfabric headers are present], KFI_header,
881 #include <kfi_endpoint.h>
883 struct kfi_info *hints;
884 hints = kfi_allocinfo();
887 AC_MSG_NOTICE([adding $with_kfi/Module.symvers to Symbol Path])
888 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $with_kfi/Module.symvers"
890 AC_MSG_ERROR([can't compile kfilnd with given KFICPPFLAGS: $KFICPPFLAGS])
893 AC_MSG_ERROR(["$with_kfi/Module.symvers does not exist"])
896 AC_DEFINE(HAVE_KFILND, 1, [support kfabric LND])
897 AC_SUBST(KFICPPFLAGS)
899 AC_SUBST(EXTRA_SYMBOLS)
900 ]) # LN_CONFIG_KFILND
903 # LN_CONFIG_SOCK_CREATE_KERN
905 # 4.x sock_create_kern() added a first parameter as 'struct net *'
908 AC_DEFUN([LN_SRC_CONFIG_SOCK_CREATE_KERN], [
909 LB2_LINUX_TEST_SRC([sock_create_kern_net], [
910 #include <linux/net.h>
911 #include <net/net_namespace.h>
913 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
916 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
917 AC_MSG_CHECKING([if 'sock_create_kern' first parameter is net])
918 LB2_LINUX_TEST_RESULT([sock_create_kern_net], [
919 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
920 [sock_create_kern use net as first parameter])
922 ]) # LN_CONFIG_SOCK_CREATE_KERN
925 # LN_CONFIG_SK_DATA_READY
927 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
929 AC_DEFUN([LN_SRC_CONFIG_SK_DATA_READY], [
930 LB2_LINUX_TEST_SRC([sk_data_ready], [
931 #include <linux/net.h>
932 #include <net/sock.h>
934 ((struct sock *)0)->sk_data_ready(NULL);
937 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
938 AC_MSG_CHECKING([if 'sk_data_ready' takes only one argument])
939 LB2_LINUX_TEST_RESULT([sk_data_ready], [
940 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
941 [sk_data_ready uses only one argument])
943 ]) # LN_CONFIG_SK_DATA_READY
946 # LN_EXPORT_KMAP_TO_PAGE
948 # 3.10 Export kmap_to_page
950 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
951 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
952 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
953 [kmap_to_page is exported by the kernel])])
954 ]) # LN_EXPORT_KMAP_TO_PAGE
957 # LN_HAVE_HYPERVISOR_IS_TYPE
959 # 4.14 commit 79cc74155218316b9a5d28577c7077b2adba8e58
960 # x86/paravirt: Provide a way to check for hypervisors
962 AC_DEFUN([LN_SRC_HAVE_HYPERVISOR_IS_TYPE], [
963 LB2_LINUX_TEST_SRC([hypervisor_is_type_exists], [
964 #include <asm/hypervisor.h>
966 (void)hypervisor_is_type(X86_HYPER_NATIVE);
969 AC_DEFUN([LN_HAVE_HYPERVISOR_IS_TYPE], [
970 AC_MSG_CHECKING([if hypervisor_is_type function is available])
971 LB2_LINUX_TEST_RESULT([hypervisor_is_type_exists], [
972 AC_DEFINE(HAVE_HYPERVISOR_IS_TYPE, 1,
973 [hypervisor_is_type function exists])
975 ]) # LN_HAVE_HYPERVISOR_IS_TYPE
978 # LN_HAVE_ORACLE_OFED_EXTENSIONS
982 AC_DEFUN([LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS], [
983 LB2_LINUX_TEST_SRC([oracle_ofed_ext], [
984 #include <rdma/ib_fmr_pool.h>
986 struct ib_fmr_pool_param param = {
991 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
992 [if Oracle OFED Extensions are enabled])
995 AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [
996 AC_MSG_CHECKING([if Oracle OFED Extensions are enabled])
997 LB2_LINUX_TEST_RESULT([oracle_ofed_ext], [
998 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
999 [if Oracle OFED Extensions are enabled])
1001 ]) # LN_HAVE_ORACLE_OFED_EXTENSIONS
1004 # LN_CONFIG_SOCK_GETNAME
1006 # 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
1007 # does not take the length *int argument and returns the length
1009 AC_DEFUN([LN_SRC_CONFIG_SOCK_GETNAME], [
1010 LB2_LINUX_TEST_SRC([kern_sock_getname_2args], [
1011 #include <linux/net.h>
1013 kernel_getsockname(NULL, NULL);
1016 AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
1017 AC_MSG_CHECKING([if 'getname' has two args])
1018 LB2_LINUX_TEST_RESULT([kern_sock_getname_2args], [
1019 AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
1020 ['getname' has two args])
1022 ]) # LN_CONFIG_SOCK_GETNAME
1025 # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1027 # kernel 5.3 commit ef11db3310e272d3d8dbe8739e0770820dd20e52
1028 # and kernel 4.18.0-193.el8:
1029 # added in_dev_for_each_ifa_rtnl and in_dev_for_each_ifa_rcu
1030 # and removed for_ifa and endfor_ifa.
1031 # Use the _rntl variant as the current locking is rtnl.
1033 AC_DEFUN([LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1034 LB2_LINUX_TEST_SRC([in_dev_for_each_ifa_rtnl_test], [
1035 #include <linux/inetdevice.h>
1037 const struct in_ifaddr *ifa = NULL;
1038 struct in_device *in_dev = NULL;
1040 in_dev_for_each_ifa_rtnl(ifa, in_dev) {}
1043 AC_DEFUN([LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1044 AC_MSG_CHECKING([if 'in_dev_for_each_ifa_rtnl' is defined])
1045 LB2_LINUX_TEST_RESULT([in_dev_for_each_ifa_rtnl_test], [
1046 AC_DEFINE(HAVE_IN_DEV_FOR_EACH_IFA_RTNL, 1,
1047 ['in_dev_for_each_ifa_rtnl' is defined])
1049 ]) # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1055 AC_DEFUN([LN_USR_RDMA], [
1056 AC_MSG_CHECKING([if RDMA_PS_TCP exists])
1057 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1058 #include <rdma/rdma_user_cm.h>
1061 int x = (int)RDMA_PS_TCP;
1065 AC_DEFINE(HAVE_USRSPC_RDMA_PS_TCP, 1,
1066 [RDMA_PS_TCP exists])
1071 AC_DEFUN([LN_PROG_LINUX_SRC], [
1073 LN_SRC_CONFIG_STRSCPY_EXISTS
1075 LN_SRC_CONFIG_SK_DATA_READY
1077 LN_SRC_CONFIG_SOCK_CREATE_KERN
1079 LN_SRC_HAVE_HYPERVISOR_IS_TYPE
1080 LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS
1082 LN_SRC_CONFIG_SOCK_GETNAME
1083 # 5.3 and 4.18.0-193.el8
1084 LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1087 AC_DEFUN([LN_PROG_LINUX_RESULTS], [
1088 LN_CONFIG_O2IB_RESULTS
1089 LN_CONFIG_STRSCPY_EXISTS
1091 LN_CONFIG_SK_DATA_READY
1093 LN_CONFIG_SOCK_CREATE_KERN
1095 LN_HAVE_HYPERVISOR_IS_TYPE
1096 LN_HAVE_ORACLE_OFED_EXTENSIONS
1098 LN_CONFIG_SOCK_GETNAME
1099 # 5.3 and 4.18.0-193.el8
1100 LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1106 # LNet linux kernel checks
1108 AC_DEFUN([LN_PROG_LINUX], [
1109 AC_MSG_NOTICE([LNet kernel checks
1110 ==============================================================================])
1116 # 3.10 - Check export
1117 LN_EXPORT_KMAP_TO_PAGE
1123 # default paths for installed files
1125 AC_DEFUN([LN_PATH_DEFAULTS], [
1126 ]) # LN_PATH_DEFAULTS
1131 # other configure checks
1133 AC_DEFUN([LN_CONFIGURE], [
1134 AC_MSG_NOTICE([LNet core checks
1135 ==============================================================================])
1138 AS_HELP_STRING([--with-cuda=path],
1139 [Use a CUDA sources.]),
1140 [LB_ARG_CANON_PATH([cuda], [CUDA_PATH])],
1141 [CUDA_PATH=`ls -d1 /usr/src/nvidia-*/nvidia/ | tail -1`]
1145 AS_HELP_STRING([--with-gds=path],
1146 [Use a gds sources.]),
1147 [LB_ARG_CANON_PATH([gds], [GDS_PATH])],
1148 [GDS_PATH=`ls -d1 /usr/src/nvidia-fs* | tail -1`]
1151 AS_IF([test -n "${CUDA_PATH}" && test -n "${GDS_PATH}"],[
1152 LB_CHECK_FILE([$CUDA_PATH/nv-p2p.h],
1154 AC_MSG_RESULT([CUDA path is $CUDA_PATH])
1157 [AC_MSG_ERROR([CUDA sources don't found. nv-p2p.h don't exit])]
1160 LB_CHECK_FILE([$GDS_PATH/nvfs-dma.h],
1162 LB_CHECK_FILE([$GDS_PATH/config-host.h], [
1163 AC_MSG_RESULT([GDS path is $GDS_PATH])
1165 AC_DEFINE(WITH_GDS, 1, "GDS build enabled")
1170 AC_MSG_WARN([CUDA or GDS sources not found. GDS support disabled])
1174 # lnet/utils/lnetconfig/liblnetconfig_netlink.c
1175 AS_IF([test "x$enable_dist" = xno], [
1176 PKG_CHECK_MODULES(LIBNL3, [libnl-genl-3.0 >= 3.1])
1179 AC_CHECK_LIB([nl-3], [nla_get_s32], [
1180 AC_DEFINE(HAVE_NLA_GET_S32, 1,
1181 [libnl3 supports nla_get_s32])
1185 AC_CHECK_LIB([nl-3], [nla_get_s64], [
1186 AC_DEFINE(HAVE_NLA_GET_S64, 1,
1187 [libnl3 supports nla_get_s64])
1194 AC_DEFUN([LN_USR_NLMSGERR], [
1195 AC_MSG_CHECKING([if 'enum nlmsgerr_attrs' exists])
1196 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1197 #include <linux/netlink.h>
1200 int x = (int)NLMSGERR_ATTR_MAX;
1204 AC_DEFINE(HAVE_USRSPC_NLMSGERR, 1,
1205 ['enum nlmsgerr_attrs' exists])
1207 ]) # LN_USR_NLMGSERR
1209 # lnet/utils/portals.c
1210 AC_CHECK_HEADERS([netdb.h])
1211 AC_CHECK_FUNCS([gethostbyname])
1213 # lnet/utils/wirecheck.c
1214 AC_CHECK_FUNCS([strnlen])
1216 # -------- Check for required packages --------------
1218 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
1219 AC_ARG_ENABLE(efence,
1220 AS_HELP_STRING([--enable-efence],
1221 [use efence library]),
1222 [], [enable_efence="no"])
1223 AC_MSG_RESULT([$enable_efence])
1226 AS_IF([test "$enable_efence" = yes], [
1227 LIBEFENCE="-lefence"
1228 AC_DEFINE(HAVE_LIBEFENCE, 1,
1229 [libefence support is requested])
1241 # AM_CONDITIONAL defines for lnet
1243 AC_DEFUN([LN_CONDITIONALS], [
1244 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1245 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
1246 AM_CONDITIONAL(BUILD_KFILND, test x$KFILND = "xkfilnd")
1247 ]) # LN_CONDITIONALS
1252 # files that should be generated with AC_OUTPUT
1254 AC_DEFUN([LN_CONFIG_FILES], [
1258 lnet/autoconf/Makefile
1260 lnet/include/Makefile
1261 lnet/include/lnet/Makefile
1262 lnet/include/uapi/linux/lnet/Makefile
1264 lnet/klnds/autoMakefile
1265 lnet/klnds/o2iblnd/Makefile
1266 lnet/klnds/o2iblnd/autoMakefile
1267 lnet/klnds/gnilnd/Makefile
1268 lnet/klnds/gnilnd/autoMakefile
1269 lnet/klnds/socklnd/Makefile
1270 lnet/klnds/socklnd/autoMakefile
1271 lnet/klnds/kfilnd/Makefile
1272 lnet/klnds/kfilnd/autoMakefile
1274 lnet/lnet/autoMakefile
1275 lnet/selftest/Makefile
1276 lnet/selftest/autoMakefile
1278 lnet/utils/lnetconfig/Makefile
1280 ]) # LN_CONFIG_FILES