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 AC_SUBST(ENABLE_BACKOFF, yes)
26 AC_SUBST(ENABLE_BACKOFF, no)
29 ]) # LN_CONFIG_BACKOFF
36 # fail to build if libyaml is not installed
38 AC_DEFUN([LN_CONFIG_DLC], [
39 AS_IF([test "x$enable_dist" = xno], [
40 AC_CHECK_LIB([yaml], [yaml_parser_initialize],
42 [AC_MSG_ERROR([YAML development libraries not not installed])],
50 # If current OFED installed (assume with "ofed_info") and devel
51 # headers are not found, error because we assume OFED infiniband
52 # driver needs to be used and we must configure/build with it.
53 # Current OFED headers detection mechanism allow for non-standard
54 # prefix but relies on "ofed_info" command and on "%prefix/openib"
55 # link (both are ok for 1.5.x and 3.x versions), and should work
56 # for both source and DKMS builds.
58 AC_DEFUN([LN_CONFIG_O2IB], [
59 AC_MSG_CHECKING([whether to use Compat RDMA])
61 AS_HELP_STRING([--with-o2ib=[yes|no|<path>]],
62 [build o2iblnd against path]),
63 [], [with_o2ib="yes"])
66 yes) AS_IF([which ofed_info 2>/dev/null], [
67 AS_IF([test x$uses_dpkg = xyes], [
68 LIST_ALL_PKG="dpkg -l | awk '{print \[$]2}'"
69 LSPKG="dpkg --listfiles"
71 LIST_ALL_PKG="rpm -qa"
75 O2IBPKG="mlnx-ofed-kernel-dkms"
76 O2IBPKG+="|mlnx-ofed-kernel-modules"
77 O2IBPKG+="|mlnx-ofa_kernel-devel"
78 O2IBPKG+="|compat-rdma-devel"
79 O2IBPKG+="|kernel-ib-devel"
80 O2IBPKG+="|ofa_kernel-devel"
83 O2IBDIR+="|/ofa_kernel/default"
86 O2IBDIR_PATH=$(eval $LIST_ALL_PKG |
87 egrep -w "$O2IBPKG" | xargs $LSPKG |
88 egrep "${O2IBDIR}$" | head -n1)
90 if test -n "$O2IBDIR_PATH"; then
91 O2IBPATHS=$(find $O2IBDIR_PATH -name rdma_cm.h |
92 egrep "`uname -r`|default" |
93 sed -e 's/\/include\/rdma\/rdma_cm.h//')
96 AS_IF([test -z "$O2IBPATHS"], [
98 You seem to have an OFED installed but have not installed it's devel package.
99 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
100 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.
103 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
105 It appears that you have multiple OFED versions installed.
106 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.
107 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.
110 if test -e $O2IBPATHS/${LINUXRELEASE}; then
111 O2IBPATHS=$O2IBPATHS/${LINUXRELEASE}
112 elif test -e $O2IBPATHS/default; then
113 O2IBPATHS=$O2IBPATHS/default
117 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
123 *) O2IBPATHS=$with_o2ib
124 ENABLEO2IB="withpath"
129 AS_IF([test $ENABLEO2IB = "no"], [
131 AC_DEFUN([LN_CONFIG_O2IB_SRC], [])
132 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [])
135 for O2IBPATH in $O2IBPATHS; do
136 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
137 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
138 -f ${O2IBPATH}/include/rdma/ib_verbs.h \)], [
143 if ! $o2ib_found; then
146 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
147 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
148 *) AC_MSG_ERROR([internal error]) ;;
152 compatrdma_found=false
153 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
155 compatrdma_found=true
156 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
157 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
158 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
159 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
164 if ! $compatrdma_found; then
165 if test -f "$O2IBPATH/config.mk"; then
166 . "$O2IBPATH/config.mk"
167 elif test -f "$O2IBPATH/ofed_patch.mk"; then
168 . "$O2IBPATH/ofed_patch.mk"
170 elif test -z "$COMPAT_AUTOCONF"; then
172 if test "x$RHEL_KERNEL" = xyes; then
173 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
174 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
175 while test "$I" -ge 0; do
176 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
179 elif test "x$SUSE_KERNEL" = xyes; then
180 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
181 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
185 AC_MSG_CHECKING([whether to use any OFED backport headers])
186 if test -n "$BACKPORT_INCLUDES"; then
188 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
189 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
195 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
196 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include -I$O2IBPATH/include/uapi"
197 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
198 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
199 openib_gen2_support, [
200 #ifdef HAVE_COMPAT_RDMA
202 #undef PACKAGE_TARNAME
203 #undef PACKAGE_VERSION
204 #undef PACKAGE_STRING
205 #undef PACKAGE_BUGREPORT
207 #include <linux/compat-2.6.h>
209 #include <linux/version.h>
210 #include <linux/pci.h>
211 #include <linux/gfp.h>
212 #include <rdma/rdma_cm.h>
213 #include <rdma/ib_cm.h>
214 #include <rdma/ib_verbs.h>
216 struct rdma_cm_id *cm_idi __attribute__ ((unused));
217 struct rdma_conn_param conn_param __attribute__ ((unused));
218 struct ib_device_attr device_attr __attribute__ ((unused));
219 struct ib_qp_attr qp_attr __attribute__ ((unused));
220 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
221 rdma_destroy_id(NULL);
226 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
227 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
228 *) AC_MSG_ERROR([internal error]) ;;
231 # we know at this point that the found OFED source is good
233 if test -f $O2IBPATH/Module.symvers; then
234 O2IB_SYMVER=$O2IBPATH/Module.symvers
235 elif test "x$SUSE_KERNEL" = "xyes"; then
236 O2IB_SYMVER=$(find ${O2IBPATH}* -name Module.symvers)
237 # Select only the current 'flavor' if there is more than 1
238 NUM_AVAIL=$(find ${O2IBPATH}* -name Module.symvers | wc -l)
239 if test ${NUM_AVAIL} -gt 1; then
240 PREFER=$(basename ${LINUX_OBJ})
241 for F in $(find ${O2IBPATH}-obj -name Module.symvers)
243 maybe=$(echo $F | grep "/${PREFER}")
244 if test "x$maybe" != "x"; then
249 elif test -f $LINUX_OBJ/Module.symvers; then
250 # Debian symvers is in the arch tree
251 O2IB_SYMVER=$LINUX_OBJ/Module.symvers
253 if test -n "$O2IB_SYMVER"; then
254 if test ! "$O2IB_SYMVER" -ef "$LINUX_OBJ/Module.symvers"; then
255 AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path O2IB])
256 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
257 AC_SUBST(EXTRA_SYMBOLS)
260 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
263 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
264 linux_kthread_worker, [
265 #ifdef HAVE_COMPAT_RDMA
267 #undef PACKAGE_TARNAME
268 #undef PACKAGE_VERSION
269 #undef PACKAGE_STRING
270 #undef PACKAGE_BUGREPORT
272 #include <linux/compat-2.6.h>
274 #include <linux/kthread.h>
276 struct kthread_work *kth_wrk = NULL;
277 flush_kthread_work(kth_wrk);
279 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
280 if test -z "$COMPAT_AUTOCONF"; then
281 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
284 EXTRA_CHECK_INCLUDE=""
287 AC_SUBST(EXTRA_OFED_CONFIG)
288 AC_SUBST(EXTRA_OFED_INCLUDE)
293 AS_IF([test $ENABLEO2IB != "no"], [
294 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
295 if test ! $O2IBPATH -ef $LINUX_OBJ; then
296 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $O2IBPATH/Module.symvers"
299 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
300 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_4A], [
301 LB2_LINUX_TEST_SRC([rdma_create_id_4args], [
302 #ifdef HAVE_COMPAT_RDMA
304 #undef PACKAGE_TARNAME
305 #undef PACKAGE_VERSION
306 #undef PACKAGE_STRING
307 #undef PACKAGE_BUGREPORT
309 #include <linux/compat-2.6.h>
311 #include <rdma/rdma_cm.h>
313 rdma_create_id(NULL, NULL, 0, 0);
314 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
316 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_4A], [
317 AC_MSG_CHECKING([if 'rdma_create_id' wants four args])
318 LB2_LINUX_TEST_RESULT([rdma_create_id_4args], [
319 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
320 [rdma_create_id wants 4 args])
324 # 4.4 added network namespace parameter for rdma_create_id()
325 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_5A], [
326 LB2_LINUX_TEST_SRC([rdma_create_id_5args], [
327 #ifdef HAVE_COMPAT_RDMA
329 #undef PACKAGE_TARNAME
330 #undef PACKAGE_VERSION
331 #undef PACKAGE_STRING
332 #undef PACKAGE_BUGREPORT
334 #include <linux/compat-2.6.h>
336 #include <rdma/rdma_cm.h>
338 rdma_create_id(NULL, NULL, NULL, 0, 0);
339 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
341 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_5A], [
342 AC_MSG_CHECKING([if 'rdma_create_id' wants five args])
343 LB2_LINUX_TEST_RESULT([rdma_create_id_5args], [
344 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
345 [rdma_create_id wants 5 args])
349 # 4.2 introduced struct ib_cq_init_attr which is used
350 # by ib_create_cq(). Note some OFED stacks only keep
351 # their headers in sync with latest kernels but not
352 # the functionality which means for infiniband testing
353 # we need to always test functionality testings.
354 AC_DEFUN([LN_SRC_O2IB_IB_CQ_INIT_ATTR], [
355 LB2_LINUX_TEST_SRC([ib_cq_init_attr], [
356 #ifdef HAVE_COMPAT_RDMA
358 #undef PACKAGE_TARNAME
359 #undef PACKAGE_VERSION
360 #undef PACKAGE_STRING
361 #undef PACKAGE_BUGREPORT
363 #include <linux/compat-2.6.h>
365 #include <rdma/ib_verbs.h>
367 struct ib_cq_init_attr cq_attr;
369 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
370 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
372 AC_DEFUN([LN_O2IB_IB_CQ_INIT_ATTR], [
373 AC_MSG_CHECKING([if 'struct ib_cq_init_attr' is used])
374 LB2_LINUX_TEST_RESULT([ib_cq_init_attr], [
375 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
376 [struct ib_cq_init_attr is used by ib_create_cq])
380 # 4.3 removed ib_alloc_fast_reg_mr()
381 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR], [
382 LB2_LINUX_TEST_SRC([ib_alloc_fast_reg_mr], [
383 #ifdef HAVE_COMPAT_RDMA
385 #undef PACKAGE_TARNAME
386 #undef PACKAGE_VERSION
387 #undef PACKAGE_STRING
388 #undef PACKAGE_BUGREPORT
390 #include <linux/compat-2.6.h>
392 #include <rdma/ib_verbs.h>
394 ib_alloc_fast_reg_mr(NULL, 0);
395 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
397 AC_DEFUN([LN_O2IB_IB_ALLOC_FAST_REG_MR], [
398 AC_MSG_CHECKING([if 'ib_alloc_fast_reg_mr' exists])
399 LB2_LINUX_TEST_RESULT([ib_alloc_fast_reg_mr], [
400 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
401 [ib_alloc_fast_reg_mr is defined])
405 # 4.9 must stop using ib_get_dma_mr and the global MR
406 # We then have to use FMR/Fastreg for all RDMA.
407 AC_DEFUN([LN_SRC_O2IB_IB_GET_DMA_MR], [
408 LB2_LINUX_TEST_SRC([ib_get_dma_mr], [
409 #ifdef HAVE_COMPAT_RDMA
411 #undef PACKAGE_TARNAME
412 #undef PACKAGE_VERSION
413 #undef PACKAGE_STRING
414 #undef PACKAGE_BUGREPORT
416 #include <linux/compat-2.6.h>
418 #include <rdma/ib_verbs.h>
420 ib_get_dma_mr(NULL, 0);
421 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
423 AC_DEFUN([LN_O2IB_IB_GET_DMA_MR], [
424 AC_MSG_CHECKING([if 'ib_get_dma_mr' exists])
425 LB2_LINUX_TEST_RESULT([ib_get_dma_mr], [
426 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
427 [ib_get_dma_mr is defined])
431 # In v4.4 Linux kernel,
432 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
433 # split up struct ib_send_wr so that all non-trivial verbs
434 # use their own structure which embedds struct ib_send_wr.
435 AC_DEFUN([LN_SRC_O2IB_IB_RDMA_WR], [
436 LB2_LINUX_TEST_SRC([ib_rdma_wr], [
437 #ifdef HAVE_COMPAT_RDMA
439 #undef PACKAGE_TARNAME
440 #undef PACKAGE_VERSION
441 #undef PACKAGE_STRING
442 #undef PACKAGE_BUGREPORT
444 #include <linux/compat-2.6.h>
446 #include <rdma/ib_verbs.h>
448 const struct ib_rdma_wr *wr __attribute__ ((unused));
451 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
453 AC_DEFUN([LN_O2IB_IB_RDMA_WR], [
454 AC_MSG_CHECKING([if 'struct ib_rdma_wr' is defined])
455 LB2_LINUX_TEST_RESULT([ib_rdma_wr], [
456 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
457 [struct ib_rdma_wr is defined])
461 # new fast registration API introduced in 4.4
462 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_4A], [
463 LB2_LINUX_TEST_SRC([ib_map_mr_sg_4args], [
464 #ifdef HAVE_COMPAT_RDMA
466 #undef PACKAGE_TARNAME
467 #undef PACKAGE_VERSION
468 #undef PACKAGE_STRING
469 #undef PACKAGE_BUGREPORT
471 #include <linux/compat-2.6.h>
473 #include <rdma/ib_verbs.h>
475 ib_map_mr_sg(NULL, NULL, 0, 0);
476 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
478 # new fast registration API introduced in 4.4
479 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_4A], [
480 AC_MSG_CHECKING([if 4arg 'ib_map_mr_sg' exists])
481 LB2_LINUX_TEST_RESULT([ib_map_mr_sg_4args], [
482 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
483 [ib_map_mr_sg exists])
487 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
488 # in kernel 4.7 (and RHEL 7.3)
489 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_5A], [
490 LB2_LINUX_TEST_SRC([ib_map_mr_sg_5args], [
491 #ifdef HAVE_COMPAT_RDMA
493 #undef PACKAGE_TARNAME
494 #undef PACKAGE_VERSION
495 #undef PACKAGE_STRING
496 #undef PACKAGE_BUGREPORT
498 #include <linux/compat-2.6.h>
500 #include <rdma/ib_verbs.h>
502 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
503 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
505 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_5A], [
506 AC_MSG_CHECKING([if 5arg 'ib_map_mr_sg' exists])
507 LB2_LINUX_TEST_RESULT([ib_map_mr_sg_5args], [
508 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
509 [ib_map_mr_sg exists])
510 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
511 [ib_map_mr_sg has 5 arguments])
515 # ib_query_device() removed in 4.5
516 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_ATTRS], [
517 LB2_LINUX_TEST_SRC([ib_device_attrs], [
518 #ifdef HAVE_COMPAT_RDMA
520 #undef PACKAGE_TARNAME
521 #undef PACKAGE_VERSION
522 #undef PACKAGE_STRING
523 #undef PACKAGE_BUGREPORT
525 #include <linux/compat-2.6.h>
527 #include <rdma/ib_verbs.h>
529 struct ib_device dev;
530 struct ib_device_attr dev_attr = {};
531 dev.attrs = dev_attr;
532 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
534 AC_DEFUN([LN_O2IB_IB_DEVICE_ATTRS], [
535 AC_MSG_CHECKING([if 'struct ib_device' has member 'attrs'])
536 LB2_LINUX_TEST_RESULT([ib_device_attrs], [
537 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
538 [struct ib_device.attrs is defined])
542 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
543 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
544 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_PD], [
545 LB2_LINUX_TEST_SRC([ib_alloc_pd], [
546 #ifdef HAVE_COMPAT_RDMA
548 #undef PACKAGE_TARNAME
549 #undef PACKAGE_VERSION
550 #undef PACKAGE_STRING
551 #undef PACKAGE_BUGREPORT
553 #include <linux/compat-2.6.h>
555 #include <rdma/ib_verbs.h>
557 ib_alloc_pd(NULL, 0);
558 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
560 AC_DEFUN([LN_O2IB_IB_ALLOC_PD], [
561 AC_MSG_CHECKING([if 2arg 'ib_alloc_pd' exists])
562 LB2_LINUX_TEST_RESULT([ib_alloc_pd], [
563 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
564 [ib_alloc_pd has 2 arguments])
568 AC_DEFUN([LN_SRC_O2IB_IB_INC_RKEY], [
569 LB2_LINUX_TEST_SRC([ib_inc_rkey], [
570 #ifdef HAVE_COMPAT_RDMA
572 #undef PACKAGE_TARNAME
573 #undef PACKAGE_VERSION
574 #undef PACKAGE_STRING
575 #undef PACKAGE_BUGREPORT
577 #include <linux/compat-2.6.h>
579 #include <rdma/ib_verbs.h>
581 (void)ib_inc_rkey(0);
582 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
584 AC_DEFUN([LN_O2IB_IB_INC_RKEY], [
585 AC_MSG_CHECKING([if function 'ib_inc_rkey' is defined])
586 LB2_LINUX_TEST_RESULT([ib_inc_rkey], [
587 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
588 [function ib_inc_rkey exist])
592 # In MOFED 4.6, the second and third parameters for
593 # ib_post_send() and ib_post_recv() are declared with
595 AC_DEFUN([LN_SRC_O2IB_IB_POST_SEND_CONST], [
596 LB2_LINUX_TEST_SRC([ib_post_send_recv_const], [
597 #ifdef HAVE_COMPAT_RDMA
599 #undef PACKAGE_TARNAME
600 #undef PACKAGE_VERSION
601 #undef PACKAGE_STRING
602 #undef PACKAGE_BUGREPORT
604 #include <linux/compat-2.6.h>
606 #include <rdma/ib_verbs.h>
608 ib_post_send(NULL, (const struct ib_send_wr *)NULL,
609 (const struct ib_send_wr **)NULL);
610 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
612 AC_DEFUN([LN_O2IB_IB_POST_SEND_CONST], [
613 AC_MSG_CHECKING([if 'ib_post_send() and ib_post_recv()' have const parameters])
614 LB2_LINUX_TEST_RESULT([ib_post_send_recv_const], [
615 AC_DEFINE(HAVE_IB_POST_SEND_RECV_CONST, 1,
616 [ib_post_send and ib_post_recv have const parameters])
620 # MOFED 5.5 fails with:
621 # ERROR: "ib_dma_virt_map_sg" [.../ko2iblnd.ko] undefined!
622 # See if we have a broken ib_dma_map_sg()
623 AC_DEFUN([LN_SRC_SANE_IB_DMA_MAP_SG], [
624 LB2_LINUX_TEST_SRC([sane_ib_dma_map_sg], [
625 #ifdef HAVE_COMPAT_RDMA
627 #undef PACKAGE_TARNAME
628 #undef PACKAGE_VERSION
629 #undef PACKAGE_STRING
630 #undef PACKAGE_BUGREPORT
632 #include <linux/compat-2.6.h>
634 #include <rdma/ib_verbs.h>
636 ib_dma_map_sg((struct ib_device *)NULL,
637 (struct scatterlist *)NULL, 1, 0);
638 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
640 AC_DEFUN([LN_SANE_IB_DMA_MAP_SG], [
641 AC_MSG_CHECKING([if ib_dma_map_sg() is sane])
642 LB2_LINUX_TEST_RESULT([sane_ib_dma_map_sg], [
643 AC_DEFINE(HAVE_SANE_IB_DMA_MAP_SG, 1,
644 [ib_dma_map_sg is sane])
649 # LN_IB_DEVICE_OPS_EXISTS
651 # kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
652 # RDMA/core: Introduce ib_device_ops
653 # ... introduces the ib_device_ops structure that defines all the
654 # InfiniBand device operations in one place ...
656 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS], [
657 LB2_LINUX_TEST_SRC([ib_device_ops_test], [
658 #include <rdma/ib_verbs.h>
660 int x = offsetof(struct ib_device_ops, unmap_fmr);
663 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
665 AC_DEFUN([LN_O2IB_IB_DEVICE_OPS_EXISTS], [
666 AC_MSG_CHECKING([if struct ib_device_ops is defined])
667 LB2_LINUX_TEST_RESULT([ib_device_ops_test], [
668 AC_DEFINE(HAVE_IB_DEVICE_OPS, 1,
669 [if struct ib_device_ops is defined])
671 ]) # LN_IB_DEVICE_OPS_EXISTS
674 # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
676 # kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
677 # IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
678 # ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
680 AC_DEFUN([LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
681 LB2_LINUX_TEST_SRC([ib_sg_dma_address_test], [
682 #include <rdma/ib_verbs.h>
684 u64 x = ib_sg_dma_address(NULL, NULL);
687 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
689 AC_DEFUN([LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
690 AC_MSG_CHECKING([if ib_sg_dma_address wrapper exists])
691 LB2_LINUX_TEST_RESULT([ib_sg_dma_address_test], [
692 AC_DEFINE(HAVE_IB_SG_DMA_ADDRESS, 1,
693 [if ib_sg_dma_address wrapper exists])
695 ]) # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
698 # LN_O2IB_RDMA_REJECT
700 # A reason argument was added to rdma_reject() in Linux 5.8,
701 # commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a
702 AC_DEFUN([LN_SRC_O2IB_RDMA_REJECT], [
703 LB2_LINUX_TEST_SRC([rdma_reject], [
704 #ifdef HAVE_COMPAT_RDMA
706 #undef PACKAGE_TARNAME
707 #undef PACKAGE_VERSION
708 #undef PACKAGE_STRING
709 #undef PACKAGE_BUGREPORT
711 #include <linux/compat-2.6.h>
713 #include <rdma/ib_verbs.h>
714 #include <rdma/ib_cm.h>
715 #include <rdma/rdma_cm.h>
717 rdma_reject(NULL, NULL, 0, 0);
718 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
720 AC_DEFUN([LN_O2IB_RDMA_REJECT], [
721 AC_MSG_CHECKING([if 4arg 'rdma_reject' exists])
722 LB2_LINUX_TEST_RESULT([rdma_reject], [
723 AC_DEFINE(HAVE_RDMA_REJECT_4ARGS, 1,
724 [rdma_reject has 4 arguments])
726 ]) # LN_O2IB_RDMA_REJECT
731 # The FMR pool API was removed in Linux 5.8,
732 # commit 4e373d5417ecbb4f438a8500f0379a2fc29c2643
733 AC_DEFUN([LN_SRC_O2IB_IB_FMR], [
734 LB2_LINUX_TEST_SRC([ib_fmr], [
735 #include <rdma/ib_verbs.h>
737 struct ib_fmr fmr = {};
738 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
740 AC_DEFUN([LN_O2IB_IB_FMR], [
741 AC_MSG_CHECKING([if FMR pools API available])
742 LB2_LINUX_TEST_RESULT([ib_fmr], [
743 AC_DEFINE(HAVE_FMR_POOL_API, 1,
744 [FMR pool API is available])
749 # LN_O2IB_RDMA_CONNECT_LOCKED
751 # rdma_connect_locked() was added in Linux 5.10,
752 # commit 071ba4cc559de47160761b9500b72e8fa09d923d
753 # and in MOFED-5.2-2. rdma_connect_locked() must
754 # be called instead of rdma_connect() in
755 # RDMA_CM_EVENT_ROUTE_RESOLVED handler.
756 AC_DEFUN([LN_SRC_O2IB_RDMA_CONNECT_LOCKED], [
757 LB2_LINUX_TEST_SRC([rdma_connect_locked], [
758 #include <rdma/rdma_cm.h>
760 rdma_connect_locked(NULL, NULL);
761 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
763 AC_DEFUN([LN_O2IB_RDMA_CONNECT_LOCKED], [
764 AC_MSG_CHECKING([if 'rdma_connect_locked' exists])
765 LB2_LINUX_TEST_RESULT([rdma_connect_locked], [
766 AC_DEFINE(HAVE_RDMA_CONNECT_LOCKED, 1,
767 [rdma_connect_locked is defined])
769 ]) # LN_O2IB_RDMA_CONNECT_LOCKED
772 # LN_O2IB_ETHTOOL_LINK_SETTINGS
774 # ethtool_link_settings was added in Linux 4.6
776 AC_DEFUN([LN_SRC_O2IB_ETHTOOL_LINK_SETTINGS], [
777 LB2_LINUX_TEST_SRC([ethtool_link_settings], [
778 #include <linux/ethtool.h>
780 struct ethtool_link_ksettings cmd;
781 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
783 AC_DEFUN([LN_O2IB_ETHTOOL_LINK_SETTINGS], [
784 AC_MSG_CHECKING([if 'ethtool_link_settings' exists])
785 LB2_LINUX_TEST_RESULT([ethtool_link_settings], [
786 AC_DEFINE(HAVE_ETHTOOL_LINK_SETTINGS, 1,
787 [ethtool_link_settings is defined])
789 ]) # LN_O2IB_ETHTOOL_LINK_SETTINGS
791 EXTRA_CHECK_INCLUDE=""
793 AC_DEFUN([LN_CONFIG_O2IB_SRC], [
794 LN_SRC_O2IB_RDMA_CREATE_ID_4A
795 LN_SRC_O2IB_RDMA_CREATE_ID_5A
796 LN_SRC_O2IB_IB_CQ_INIT_ATTR
797 LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR
798 LN_SRC_O2IB_IB_GET_DMA_MR
799 LN_SRC_O2IB_IB_RDMA_WR
800 LN_SRC_O2IB_IB_MAP_MR_SG_4A
801 LN_SRC_O2IB_IB_MAP_MR_SG_5A
802 LN_SRC_O2IB_IB_DEVICE_ATTRS
803 LN_SRC_O2IB_IB_ALLOC_PD
804 LN_SRC_O2IB_IB_INC_RKEY
805 LN_SRC_O2IB_IB_POST_SEND_CONST
806 LN_SRC_SANE_IB_DMA_MAP_SG
807 LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS
808 LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS
809 LN_SRC_O2IB_RDMA_REJECT
811 LN_SRC_O2IB_RDMA_CONNECT_LOCKED
812 LN_SRC_O2IB_ETHTOOL_LINK_SETTINGS
814 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [
815 LN_O2IB_RDMA_CREATE_ID_4A
816 LN_O2IB_RDMA_CREATE_ID_5A
817 LN_O2IB_IB_CQ_INIT_ATTR
818 LN_O2IB_IB_ALLOC_FAST_REG_MR
819 LN_O2IB_IB_GET_DMA_MR
821 LN_O2IB_IB_MAP_MR_SG_4A
822 LN_O2IB_IB_MAP_MR_SG_5A
823 LN_O2IB_IB_DEVICE_ATTRS
826 LN_O2IB_IB_POST_SEND_CONST
827 LN_SANE_IB_DMA_MAP_SG
828 LN_O2IB_IB_DEVICE_OPS_EXISTS
829 LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
832 LN_O2IB_RDMA_CONNECT_LOCKED
833 LN_O2IB_ETHTOOL_LINK_SETTINGS
835 ]) # ENABLEO2IB != "no"
841 # check whether to use the Gemini Network Interface lnd
843 AC_DEFUN([LN_CONFIG_GNILND], [
844 AC_MSG_CHECKING([whether to enable GNI lnd])
846 AS_HELP_STRING([--enable-gni],
848 [], [enable_gni="no"])
849 AC_MSG_RESULT([$enable_gni])
851 AS_IF([test "x$enable_gni" = xyes], [
852 # GNICPPFLAGS was set in spec file
853 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
854 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
855 LB_CHECK_COMPILE([if GNI kernel headers are present],
857 #include <linux/types.h>
860 gni_cdm_handle_t kgni_domain;
863 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
864 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
869 AC_MSG_ERROR([cannot compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
871 # at this point, we have gnilnd basic support,
872 # now check for extra features
873 LB_CHECK_COMPILE([to use RCA in gnilnd],
875 #include <linux/types.h>
877 #include <krca_lib.h>
879 gni_cdm_handle_t kgni_domain;
881 krca_ticket_t ticket = KRCA_NULL_TICKET;
883 __u32 nid = 0, nic_addr;
884 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
885 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
886 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
887 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
890 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
892 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
894 AC_SUBST(ENABLE_GNI, yes)
896 AC_SUBST(ENABLE_GNI, no)
898 AC_SUBST(GNICPPFLAGS)
900 ]) # LN_CONFIG_GNILND
905 # check whether to use the kfabric Network Interface lnd
907 AC_DEFUN([LN_CONFIG_KFILND], [
909 AS_HELP_STRING([--with-kfi=<path>], [Kfabric build path for kfilnd]),
911 AC_CHECK_FILE([$with_kfi/Module.symvers],
913 # KFICPPFLAGS was set in spec file
914 KFICPPFLAGS="-I$with_kfi/include"
915 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
916 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $KFICPPFLAGS"
917 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $with_kfi/Module.symvers"
918 LB_CHECK_COMPILE([if kfabric headers are present], KFI_header,
920 #include <kfi_endpoint.h>
922 struct kfi_info *hints;
923 hints = kfi_allocinfo();
926 AC_MSG_NOTICE([adding $with_kfi/Module.symvers to Symbol Path])
927 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $with_kfi/Module.symvers"
929 AC_MSG_ERROR([can't compile kfilnd with given KFICPPFLAGS: $KFICPPFLAGS])
932 AC_MSG_ERROR(["$with_kfi/Module.symvers does not exist"])
935 AC_DEFINE(HAVE_KFILND, 1, [support kfabric LND])
936 AC_SUBST(KFICPPFLAGS)
938 AC_SUBST(EXTRA_SYMBOLS)
939 ]) # LN_CONFIG_KFILND
942 # LN_CONFIG_SOCK_CREATE_KERN
944 # 4.x sock_create_kern() added a first parameter as 'struct net *'
947 AC_DEFUN([LN_SRC_CONFIG_SOCK_CREATE_KERN], [
948 LB2_LINUX_TEST_SRC([sock_create_kern_net], [
949 #include <linux/net.h>
950 #include <net/net_namespace.h>
952 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
955 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
956 AC_MSG_CHECKING([if 'sock_create_kern' first parameter is net])
957 LB2_LINUX_TEST_RESULT([sock_create_kern_net], [
958 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
959 [sock_create_kern use net as first parameter])
961 ]) # LN_CONFIG_SOCK_CREATE_KERN
964 # LN_CONFIG_SK_DATA_READY
966 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
968 AC_DEFUN([LN_SRC_CONFIG_SK_DATA_READY], [
969 LB2_LINUX_TEST_SRC([sk_data_ready], [
970 #include <linux/net.h>
971 #include <net/sock.h>
973 ((struct sock *)0)->sk_data_ready(NULL);
976 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
977 AC_MSG_CHECKING([if 'sk_data_ready' takes only one argument])
978 LB2_LINUX_TEST_RESULT([sk_data_ready], [
979 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
980 [sk_data_ready uses only one argument])
982 ]) # LN_CONFIG_SK_DATA_READY
985 # LN_EXPORT_KMAP_TO_PAGE
987 # 3.10 Export kmap_to_page
989 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
990 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
991 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
992 [kmap_to_page is exported by the kernel])])
993 ]) # LN_EXPORT_KMAP_TO_PAGE
996 # LN_HAVE_HYPERVISOR_IS_TYPE
998 # 4.14 commit 79cc74155218316b9a5d28577c7077b2adba8e58
999 # x86/paravirt: Provide a way to check for hypervisors
1001 AC_DEFUN([LN_SRC_HAVE_HYPERVISOR_IS_TYPE], [
1002 LB2_LINUX_TEST_SRC([hypervisor_is_type_exists], [
1003 #include <asm/hypervisor.h>
1005 (void)hypervisor_is_type(X86_HYPER_NATIVE);
1008 AC_DEFUN([LN_HAVE_HYPERVISOR_IS_TYPE], [
1009 AC_MSG_CHECKING([if hypervisor_is_type function is available])
1010 LB2_LINUX_TEST_RESULT([hypervisor_is_type_exists], [
1011 AC_DEFINE(HAVE_HYPERVISOR_IS_TYPE, 1,
1012 [hypervisor_is_type function exists])
1014 ]) # LN_HAVE_HYPERVISOR_IS_TYPE
1017 # LN_HAVE_ORACLE_OFED_EXTENSIONS
1021 AC_DEFUN([LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS], [
1022 LB2_LINUX_TEST_SRC([oracle_ofed_ext], [
1023 #include <rdma/ib_fmr_pool.h>
1025 struct ib_fmr_pool_param param = {
1030 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
1031 [if Oracle OFED Extensions are enabled])
1034 AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [
1035 AC_MSG_CHECKING([if Oracle OFED Extensions are enabled])
1036 LB2_LINUX_TEST_RESULT([oracle_ofed_ext], [
1037 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
1038 [if Oracle OFED Extensions are enabled])
1040 ]) # LN_HAVE_ORACLE_OFED_EXTENSIONS
1043 # LN_CONFIG_SOCK_GETNAME
1045 # 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
1046 # does not take the length *int argument and returns the length
1048 AC_DEFUN([LN_SRC_CONFIG_SOCK_GETNAME], [
1049 LB2_LINUX_TEST_SRC([kern_sock_getname_2args], [
1050 #include <linux/net.h>
1052 kernel_getsockname(NULL, NULL);
1055 AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
1056 AC_MSG_CHECKING([if 'getname' has two args])
1057 LB2_LINUX_TEST_RESULT([kern_sock_getname_2args], [
1058 AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
1059 ['getname' has two args])
1061 ]) # LN_CONFIG_SOCK_GETNAME
1064 # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1066 # kernel 5.3 commit ef11db3310e272d3d8dbe8739e0770820dd20e52
1067 # and kernel 4.18.0-193.el8:
1068 # added in_dev_for_each_ifa_rtnl and in_dev_for_each_ifa_rcu
1069 # and removed for_ifa and endfor_ifa.
1070 # Use the _rntl variant as the current locking is rtnl.
1072 AC_DEFUN([LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1073 LB2_LINUX_TEST_SRC([in_dev_for_each_ifa_rtnl_test], [
1074 #include <linux/inetdevice.h>
1076 const struct in_ifaddr *ifa = NULL;
1077 struct in_device *in_dev = NULL;
1079 in_dev_for_each_ifa_rtnl(ifa, in_dev) {}
1082 AC_DEFUN([LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1083 AC_MSG_CHECKING([if 'in_dev_for_each_ifa_rtnl' is defined])
1084 LB2_LINUX_TEST_RESULT([in_dev_for_each_ifa_rtnl_test], [
1085 AC_DEFINE(HAVE_IN_DEV_FOR_EACH_IFA_RTNL, 1,
1086 ['in_dev_for_each_ifa_rtnl' is defined])
1088 ]) # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1094 AC_DEFUN([LN_USR_RDMA], [
1095 AC_MSG_CHECKING([if RDMA_PS_TCP exists])
1096 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1097 #include <rdma/rdma_user_cm.h>
1100 int x = (int)RDMA_PS_TCP;
1104 AC_DEFINE(HAVE_USRSPC_RDMA_PS_TCP, 1,
1105 [RDMA_PS_TCP exists])
1110 AC_DEFUN([LN_PROG_LINUX_SRC], [
1113 LN_SRC_CONFIG_SK_DATA_READY
1115 LN_SRC_CONFIG_SOCK_CREATE_KERN
1117 LN_SRC_HAVE_HYPERVISOR_IS_TYPE
1118 LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS
1120 LN_SRC_CONFIG_SOCK_GETNAME
1121 # 5.3 and 4.18.0-193.el8
1122 LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1125 AC_DEFUN([LN_PROG_LINUX_RESULTS], [
1126 LN_CONFIG_O2IB_RESULTS
1128 LN_CONFIG_SK_DATA_READY
1130 LN_CONFIG_SOCK_CREATE_KERN
1132 LN_HAVE_HYPERVISOR_IS_TYPE
1133 LN_HAVE_ORACLE_OFED_EXTENSIONS
1135 LN_CONFIG_SOCK_GETNAME
1136 # 5.3 and 4.18.0-193.el8
1137 LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1143 # LNet linux kernel checks
1145 AC_DEFUN([LN_PROG_LINUX], [
1146 AC_MSG_NOTICE([LNet kernel checks
1147 ==============================================================================])
1153 # 3.10 - Check export
1154 LN_EXPORT_KMAP_TO_PAGE
1160 # default paths for installed files
1162 AC_DEFUN([LN_PATH_DEFAULTS], [
1163 ]) # LN_PATH_DEFAULTS
1168 # other configure checks
1170 AC_DEFUN([LN_CONFIGURE], [
1171 AC_MSG_NOTICE([LNet core checks
1172 ==============================================================================])
1175 AS_HELP_STRING([--with-cuda=path],
1176 [Use a CUDA sources.]),
1177 [LB_ARG_CANON_PATH([cuda], [CUDA_PATH])],
1178 [CUDA_PATH=`ls -d1 /usr/src/nvidia-*/nvidia/ | tail -1`]
1182 AS_HELP_STRING([--with-gds=path],
1183 [Use a gds sources.]),
1184 [LB_ARG_CANON_PATH([gds], [GDS_PATH])],
1185 [GDS_PATH=`ls -d1 /usr/src/nvidia-fs* | tail -1`]
1188 AS_IF([test -n "${CUDA_PATH}" && test -n "${GDS_PATH}"],[
1189 LB_CHECK_FILE([$CUDA_PATH/nv-p2p.h],
1191 AC_MSG_RESULT([CUDA path is $CUDA_PATH])
1194 [AC_MSG_ERROR([CUDA sources don't found. nv-p2p.h don't exit])]
1197 LB_CHECK_FILE([$GDS_PATH/nvfs-dma.h],
1199 LB_CHECK_FILE([$GDS_PATH/config-host.h], [
1200 AC_MSG_RESULT([GDS path is $GDS_PATH])
1202 AC_DEFINE(WITH_GDS, 1, "GDS build enabled")
1207 AC_MSG_WARN([CUDA or GDS sources not found. GDS support disabled])
1211 # lnet/utils/lnetconfig/liblnetconfig_netlink.c
1212 AS_IF([test "x$PKGCONF" = "x"],
1213 [AC_MSG_ERROR([pkg-config package is required to configure Lustre])])
1215 AS_IF([test "x$enable_dist" = xno], [
1216 PKG_CHECK_MODULES(LIBNL3, [libnl-genl-3.0 >= 3.1])
1219 AC_CHECK_LIB([nl-3], [nla_get_s32], [
1220 AC_DEFINE(HAVE_NLA_GET_S32, 1,
1221 [libnl3 supports nla_get_s32])
1225 AC_CHECK_LIB([nl-3], [nla_get_s64], [
1226 AC_DEFINE(HAVE_NLA_GET_S64, 1,
1227 [libnl3 supports nla_get_s64])
1234 AC_DEFUN([LN_USR_NLMSGERR], [
1235 AC_MSG_CHECKING([if 'enum nlmsgerr_attrs' exists])
1236 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1237 #include <linux/netlink.h>
1240 int x = (int)NLMSGERR_ATTR_MAX;
1244 AC_DEFINE(HAVE_USRSPC_NLMSGERR, 1,
1245 ['enum nlmsgerr_attrs' exists])
1247 ]) # LN_USR_NLMGSERR
1249 # lnet/utils/portals.c
1250 AC_CHECK_HEADERS([netdb.h])
1251 AC_CHECK_FUNCS([gethostbyname])
1253 # lnet/utils/wirecheck.c
1254 AC_CHECK_FUNCS([strnlen])
1256 # -------- Check for required packages --------------
1258 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
1259 AC_ARG_ENABLE(efence,
1260 AS_HELP_STRING([--enable-efence],
1261 [use efence library]),
1262 [], [enable_efence="no"])
1263 AC_MSG_RESULT([$enable_efence])
1266 AS_IF([test "$enable_efence" = yes], [
1267 LIBEFENCE="-lefence"
1268 AC_DEFINE(HAVE_LIBEFENCE, 1,
1269 [libefence support is requested])
1270 AC_SUBST(ENABLE_EFENCE, yes)
1272 AC_SUBST(ENABLE_EFENCE, no)
1284 # AM_CONDITIONAL defines for lnet
1286 AC_DEFUN([LN_CONDITIONALS], [
1287 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1288 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
1289 AM_CONDITIONAL(BUILD_KFILND, test x$KFILND = "xkfilnd")
1290 ]) # LN_CONDITIONALS
1295 # files that should be generated with AC_OUTPUT
1297 AC_DEFUN([LN_CONFIG_FILES], [
1301 lnet/autoconf/Makefile
1303 lnet/include/Makefile
1304 lnet/include/lnet/Makefile
1305 lnet/include/uapi/linux/lnet/Makefile
1307 lnet/klnds/autoMakefile
1308 lnet/klnds/o2iblnd/Makefile
1309 lnet/klnds/o2iblnd/autoMakefile
1310 lnet/klnds/gnilnd/Makefile
1311 lnet/klnds/gnilnd/autoMakefile
1312 lnet/klnds/socklnd/Makefile
1313 lnet/klnds/socklnd/autoMakefile
1314 lnet/klnds/kfilnd/Makefile
1315 lnet/klnds/kfilnd/autoMakefile
1317 lnet/lnet/autoMakefile
1318 lnet/selftest/Makefile
1319 lnet/selftest/autoMakefile
1321 lnet/utils/lnetconfig/Makefile
1323 ]) # LN_CONFIG_FILES