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)
258 EXTRA_OFED_INCLUDE="${EXTRA_OFED_INCLUDE} -DMLNX_OFED_BUILD"
261 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
264 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
265 linux_kthread_worker, [
266 #ifdef HAVE_COMPAT_RDMA
268 #undef PACKAGE_TARNAME
269 #undef PACKAGE_VERSION
270 #undef PACKAGE_STRING
271 #undef PACKAGE_BUGREPORT
273 #include <linux/compat-2.6.h>
275 #include <linux/kthread.h>
277 struct kthread_work *kth_wrk = NULL;
278 flush_kthread_work(kth_wrk);
280 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
281 if test -z "$COMPAT_AUTOCONF"; then
282 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
285 EXTRA_CHECK_INCLUDE=""
288 AC_SUBST(EXTRA_OFED_CONFIG)
289 AC_SUBST(EXTRA_OFED_INCLUDE)
294 AS_IF([test $ENABLEO2IB != "no"], [
295 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
296 if test ! $O2IBPATH -ef $LINUX_OBJ; then
297 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $O2IBPATH/Module.symvers"
300 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
301 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_4A], [
302 LB2_LINUX_TEST_SRC([rdma_create_id_4args], [
303 #ifdef HAVE_COMPAT_RDMA
305 #undef PACKAGE_TARNAME
306 #undef PACKAGE_VERSION
307 #undef PACKAGE_STRING
308 #undef PACKAGE_BUGREPORT
310 #include <linux/compat-2.6.h>
312 #include <rdma/rdma_cm.h>
314 rdma_create_id(NULL, NULL, 0, 0);
315 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
317 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_4A], [
318 AC_MSG_CHECKING([if 'rdma_create_id' wants four args])
319 LB2_LINUX_TEST_RESULT([rdma_create_id_4args], [
320 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
321 [rdma_create_id wants 4 args])
325 # 4.4 added network namespace parameter for rdma_create_id()
326 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_5A], [
327 LB2_LINUX_TEST_SRC([rdma_create_id_5args], [
328 #ifdef HAVE_COMPAT_RDMA
330 #undef PACKAGE_TARNAME
331 #undef PACKAGE_VERSION
332 #undef PACKAGE_STRING
333 #undef PACKAGE_BUGREPORT
335 #include <linux/compat-2.6.h>
337 #include <rdma/rdma_cm.h>
339 rdma_create_id(NULL, NULL, NULL, 0, 0);
340 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
342 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_5A], [
343 AC_MSG_CHECKING([if 'rdma_create_id' wants five args])
344 LB2_LINUX_TEST_RESULT([rdma_create_id_5args], [
345 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
346 [rdma_create_id wants 5 args])
350 # 4.2 introduced struct ib_cq_init_attr which is used
351 # by ib_create_cq(). Note some OFED stacks only keep
352 # their headers in sync with latest kernels but not
353 # the functionality which means for infiniband testing
354 # we need to always test functionality testings.
355 AC_DEFUN([LN_SRC_O2IB_IB_CQ_INIT_ATTR], [
356 LB2_LINUX_TEST_SRC([ib_cq_init_attr], [
357 #ifdef HAVE_COMPAT_RDMA
359 #undef PACKAGE_TARNAME
360 #undef PACKAGE_VERSION
361 #undef PACKAGE_STRING
362 #undef PACKAGE_BUGREPORT
364 #include <linux/compat-2.6.h>
366 #include <rdma/ib_verbs.h>
368 struct ib_cq_init_attr cq_attr;
370 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
371 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
373 AC_DEFUN([LN_O2IB_IB_CQ_INIT_ATTR], [
374 AC_MSG_CHECKING([if 'struct ib_cq_init_attr' is used])
375 LB2_LINUX_TEST_RESULT([ib_cq_init_attr], [
376 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
377 [struct ib_cq_init_attr is used by ib_create_cq])
381 # 4.3 removed ib_alloc_fast_reg_mr()
382 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR], [
383 LB2_LINUX_TEST_SRC([ib_alloc_fast_reg_mr], [
384 #ifdef HAVE_COMPAT_RDMA
386 #undef PACKAGE_TARNAME
387 #undef PACKAGE_VERSION
388 #undef PACKAGE_STRING
389 #undef PACKAGE_BUGREPORT
391 #include <linux/compat-2.6.h>
393 #include <rdma/ib_verbs.h>
395 ib_alloc_fast_reg_mr(NULL, 0);
396 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
398 AC_DEFUN([LN_O2IB_IB_ALLOC_FAST_REG_MR], [
399 AC_MSG_CHECKING([if 'ib_alloc_fast_reg_mr' exists])
400 LB2_LINUX_TEST_RESULT([ib_alloc_fast_reg_mr], [
401 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
402 [ib_alloc_fast_reg_mr is defined])
406 # 4.9 must stop using ib_get_dma_mr and the global MR
407 # We then have to use FMR/Fastreg for all RDMA.
408 AC_DEFUN([LN_SRC_O2IB_IB_GET_DMA_MR], [
409 LB2_LINUX_TEST_SRC([ib_get_dma_mr], [
410 #ifdef HAVE_COMPAT_RDMA
412 #undef PACKAGE_TARNAME
413 #undef PACKAGE_VERSION
414 #undef PACKAGE_STRING
415 #undef PACKAGE_BUGREPORT
417 #include <linux/compat-2.6.h>
419 #include <rdma/ib_verbs.h>
421 ib_get_dma_mr(NULL, 0);
422 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
424 AC_DEFUN([LN_O2IB_IB_GET_DMA_MR], [
425 AC_MSG_CHECKING([if 'ib_get_dma_mr' exists])
426 LB2_LINUX_TEST_RESULT([ib_get_dma_mr], [
427 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
428 [ib_get_dma_mr is defined])
432 # In v4.4 Linux kernel,
433 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
434 # split up struct ib_send_wr so that all non-trivial verbs
435 # use their own structure which embedds struct ib_send_wr.
436 AC_DEFUN([LN_SRC_O2IB_IB_RDMA_WR], [
437 LB2_LINUX_TEST_SRC([ib_rdma_wr], [
438 #ifdef HAVE_COMPAT_RDMA
440 #undef PACKAGE_TARNAME
441 #undef PACKAGE_VERSION
442 #undef PACKAGE_STRING
443 #undef PACKAGE_BUGREPORT
445 #include <linux/compat-2.6.h>
447 #include <rdma/ib_verbs.h>
449 const struct ib_rdma_wr *wr __attribute__ ((unused));
452 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
454 AC_DEFUN([LN_O2IB_IB_RDMA_WR], [
455 AC_MSG_CHECKING([if 'struct ib_rdma_wr' is defined])
456 LB2_LINUX_TEST_RESULT([ib_rdma_wr], [
457 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
458 [struct ib_rdma_wr is defined])
462 # new fast registration API introduced in 4.4
463 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_4A], [
464 LB2_LINUX_TEST_SRC([ib_map_mr_sg_4args], [
465 #ifdef HAVE_COMPAT_RDMA
467 #undef PACKAGE_TARNAME
468 #undef PACKAGE_VERSION
469 #undef PACKAGE_STRING
470 #undef PACKAGE_BUGREPORT
472 #include <linux/compat-2.6.h>
474 #include <rdma/ib_verbs.h>
476 ib_map_mr_sg(NULL, NULL, 0, 0);
477 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
479 # new fast registration API introduced in 4.4
480 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_4A], [
481 AC_MSG_CHECKING([if 4arg 'ib_map_mr_sg' exists])
482 LB2_LINUX_TEST_RESULT([ib_map_mr_sg_4args], [
483 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
484 [ib_map_mr_sg exists])
488 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
489 # in kernel 4.7 (and RHEL 7.3)
490 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_5A], [
491 LB2_LINUX_TEST_SRC([ib_map_mr_sg_5args], [
492 #ifdef HAVE_COMPAT_RDMA
494 #undef PACKAGE_TARNAME
495 #undef PACKAGE_VERSION
496 #undef PACKAGE_STRING
497 #undef PACKAGE_BUGREPORT
499 #include <linux/compat-2.6.h>
501 #include <rdma/ib_verbs.h>
503 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
504 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
506 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_5A], [
507 AC_MSG_CHECKING([if 5arg 'ib_map_mr_sg' exists])
508 LB2_LINUX_TEST_RESULT([ib_map_mr_sg_5args], [
509 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
510 [ib_map_mr_sg exists])
511 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
512 [ib_map_mr_sg has 5 arguments])
516 # ib_query_device() removed in 4.5
517 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_ATTRS], [
518 LB2_LINUX_TEST_SRC([ib_device_attrs], [
519 #ifdef HAVE_COMPAT_RDMA
521 #undef PACKAGE_TARNAME
522 #undef PACKAGE_VERSION
523 #undef PACKAGE_STRING
524 #undef PACKAGE_BUGREPORT
526 #include <linux/compat-2.6.h>
528 #include <rdma/ib_verbs.h>
530 struct ib_device dev;
531 struct ib_device_attr dev_attr = {};
532 dev.attrs = dev_attr;
533 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
535 AC_DEFUN([LN_O2IB_IB_DEVICE_ATTRS], [
536 AC_MSG_CHECKING([if 'struct ib_device' has member 'attrs'])
537 LB2_LINUX_TEST_RESULT([ib_device_attrs], [
538 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
539 [struct ib_device.attrs is defined])
543 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
544 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
545 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_PD], [
546 LB2_LINUX_TEST_SRC([ib_alloc_pd], [
547 #ifdef HAVE_COMPAT_RDMA
549 #undef PACKAGE_TARNAME
550 #undef PACKAGE_VERSION
551 #undef PACKAGE_STRING
552 #undef PACKAGE_BUGREPORT
554 #include <linux/compat-2.6.h>
556 #include <rdma/ib_verbs.h>
558 ib_alloc_pd(NULL, 0);
559 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
561 AC_DEFUN([LN_O2IB_IB_ALLOC_PD], [
562 AC_MSG_CHECKING([if 2arg 'ib_alloc_pd' exists])
563 LB2_LINUX_TEST_RESULT([ib_alloc_pd], [
564 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
565 [ib_alloc_pd has 2 arguments])
569 AC_DEFUN([LN_SRC_O2IB_IB_INC_RKEY], [
570 LB2_LINUX_TEST_SRC([ib_inc_rkey], [
571 #ifdef HAVE_COMPAT_RDMA
573 #undef PACKAGE_TARNAME
574 #undef PACKAGE_VERSION
575 #undef PACKAGE_STRING
576 #undef PACKAGE_BUGREPORT
578 #include <linux/compat-2.6.h>
580 #include <rdma/ib_verbs.h>
582 (void)ib_inc_rkey(0);
583 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
585 AC_DEFUN([LN_O2IB_IB_INC_RKEY], [
586 AC_MSG_CHECKING([if function 'ib_inc_rkey' is defined])
587 LB2_LINUX_TEST_RESULT([ib_inc_rkey], [
588 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
589 [function ib_inc_rkey exist])
593 # In MOFED 4.6, the second and third parameters for
594 # ib_post_send() and ib_post_recv() are declared with
596 AC_DEFUN([LN_SRC_O2IB_IB_POST_SEND_CONST], [
597 LB2_LINUX_TEST_SRC([ib_post_send_recv_const], [
598 #ifdef HAVE_COMPAT_RDMA
600 #undef PACKAGE_TARNAME
601 #undef PACKAGE_VERSION
602 #undef PACKAGE_STRING
603 #undef PACKAGE_BUGREPORT
605 #include <linux/compat-2.6.h>
607 #include <rdma/ib_verbs.h>
609 ib_post_send(NULL, (const struct ib_send_wr *)NULL,
610 (const struct ib_send_wr **)NULL);
611 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
613 AC_DEFUN([LN_O2IB_IB_POST_SEND_CONST], [
614 AC_MSG_CHECKING([if 'ib_post_send() and ib_post_recv()' have const parameters])
615 LB2_LINUX_TEST_RESULT([ib_post_send_recv_const], [
616 AC_DEFINE(HAVE_IB_POST_SEND_RECV_CONST, 1,
617 [ib_post_send and ib_post_recv have const parameters])
621 # MOFED 5.5 fails with:
622 # ERROR: "ib_dma_virt_map_sg" [.../ko2iblnd.ko] undefined!
623 # See if we have a broken ib_dma_map_sg()
624 AC_DEFUN([LN_SRC_SANE_IB_DMA_MAP_SG], [
625 LB2_LINUX_TEST_SRC([sane_ib_dma_map_sg], [
626 #ifdef HAVE_COMPAT_RDMA
628 #undef PACKAGE_TARNAME
629 #undef PACKAGE_VERSION
630 #undef PACKAGE_STRING
631 #undef PACKAGE_BUGREPORT
633 #include <linux/compat-2.6.h>
635 #include <rdma/ib_verbs.h>
637 ib_dma_map_sg((struct ib_device *)NULL,
638 (struct scatterlist *)NULL, 1, 0);
639 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
641 AC_DEFUN([LN_SANE_IB_DMA_MAP_SG], [
642 AC_MSG_CHECKING([if ib_dma_map_sg() is sane])
643 LB2_LINUX_TEST_RESULT([sane_ib_dma_map_sg], [
644 AC_DEFINE(HAVE_SANE_IB_DMA_MAP_SG, 1,
645 [ib_dma_map_sg is sane])
650 # LN_IB_DEVICE_OPS_EXISTS
652 # kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
653 # RDMA/core: Introduce ib_device_ops
654 # ... introduces the ib_device_ops structure that defines all the
655 # InfiniBand device operations in one place ...
657 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS], [
658 LB2_LINUX_TEST_SRC([ib_device_ops_test], [
659 #include <rdma/ib_verbs.h>
661 int x = offsetof(struct ib_device_ops, unmap_fmr);
664 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
666 AC_DEFUN([LN_O2IB_IB_DEVICE_OPS_EXISTS], [
667 AC_MSG_CHECKING([if struct ib_device_ops is defined])
668 LB2_LINUX_TEST_RESULT([ib_device_ops_test], [
669 AC_DEFINE(HAVE_IB_DEVICE_OPS, 1,
670 [if struct ib_device_ops is defined])
672 ]) # LN_IB_DEVICE_OPS_EXISTS
675 # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
677 # kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
678 # IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
679 # ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
681 AC_DEFUN([LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
682 LB2_LINUX_TEST_SRC([ib_sg_dma_address_test], [
683 #include <rdma/ib_verbs.h>
685 u64 x = ib_sg_dma_address(NULL, NULL);
688 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
690 AC_DEFUN([LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
691 AC_MSG_CHECKING([if ib_sg_dma_address wrapper exists])
692 LB2_LINUX_TEST_RESULT([ib_sg_dma_address_test], [
693 AC_DEFINE(HAVE_IB_SG_DMA_ADDRESS, 1,
694 [if ib_sg_dma_address wrapper exists])
696 ]) # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
699 # LN_O2IB_RDMA_REJECT
701 # A reason argument was added to rdma_reject() in Linux 5.8,
702 # commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a
703 AC_DEFUN([LN_SRC_O2IB_RDMA_REJECT], [
704 LB2_LINUX_TEST_SRC([rdma_reject], [
705 #ifdef HAVE_COMPAT_RDMA
707 #undef PACKAGE_TARNAME
708 #undef PACKAGE_VERSION
709 #undef PACKAGE_STRING
710 #undef PACKAGE_BUGREPORT
712 #include <linux/compat-2.6.h>
714 #include <rdma/ib_verbs.h>
715 #include <rdma/ib_cm.h>
716 #include <rdma/rdma_cm.h>
718 rdma_reject(NULL, NULL, 0, 0);
719 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
721 AC_DEFUN([LN_O2IB_RDMA_REJECT], [
722 AC_MSG_CHECKING([if 4arg 'rdma_reject' exists])
723 LB2_LINUX_TEST_RESULT([rdma_reject], [
724 AC_DEFINE(HAVE_RDMA_REJECT_4ARGS, 1,
725 [rdma_reject has 4 arguments])
727 ]) # LN_O2IB_RDMA_REJECT
732 # The FMR pool API was removed in Linux 5.8,
733 # commit 4e373d5417ecbb4f438a8500f0379a2fc29c2643
734 AC_DEFUN([LN_SRC_O2IB_IB_FMR], [
735 LB2_LINUX_TEST_SRC([ib_fmr], [
736 #include <rdma/ib_verbs.h>
738 struct ib_fmr fmr = {};
739 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
741 AC_DEFUN([LN_O2IB_IB_FMR], [
742 AC_MSG_CHECKING([if FMR pools API available])
743 LB2_LINUX_TEST_RESULT([ib_fmr], [
744 AC_DEFINE(HAVE_FMR_POOL_API, 1,
745 [FMR pool API is available])
750 # LN_O2IB_RDMA_CONNECT_LOCKED
752 # rdma_connect_locked() was added in Linux 5.10,
753 # commit 071ba4cc559de47160761b9500b72e8fa09d923d
754 # and in MOFED-5.2-2. rdma_connect_locked() must
755 # be called instead of rdma_connect() in
756 # RDMA_CM_EVENT_ROUTE_RESOLVED handler.
757 AC_DEFUN([LN_SRC_O2IB_RDMA_CONNECT_LOCKED], [
758 LB2_LINUX_TEST_SRC([rdma_connect_locked], [
759 #include <rdma/rdma_cm.h>
761 rdma_connect_locked(NULL, NULL);
762 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
764 AC_DEFUN([LN_O2IB_RDMA_CONNECT_LOCKED], [
765 AC_MSG_CHECKING([if 'rdma_connect_locked' exists])
766 LB2_LINUX_TEST_RESULT([rdma_connect_locked], [
767 AC_DEFINE(HAVE_RDMA_CONNECT_LOCKED, 1,
768 [rdma_connect_locked is defined])
770 ]) # LN_O2IB_RDMA_CONNECT_LOCKED
773 # LN_O2IB_ETHTOOL_LINK_SETTINGS
775 # ethtool_link_settings was added in Linux 4.6
777 AC_DEFUN([LN_SRC_O2IB_ETHTOOL_LINK_SETTINGS], [
778 LB2_LINUX_TEST_SRC([ethtool_link_settings], [
779 #include <linux/ethtool.h>
781 struct ethtool_link_ksettings cmd;
782 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
784 AC_DEFUN([LN_O2IB_ETHTOOL_LINK_SETTINGS], [
785 AC_MSG_CHECKING([if 'ethtool_link_settings' exists])
786 LB2_LINUX_TEST_RESULT([ethtool_link_settings], [
787 AC_DEFINE(HAVE_ETHTOOL_LINK_SETTINGS, 1,
788 [ethtool_link_settings is defined])
790 ]) # LN_O2IB_ETHTOOL_LINK_SETTINGS
792 EXTRA_CHECK_INCLUDE=""
794 AC_DEFUN([LN_CONFIG_O2IB_SRC], [
795 LN_SRC_O2IB_RDMA_CREATE_ID_4A
796 LN_SRC_O2IB_RDMA_CREATE_ID_5A
797 LN_SRC_O2IB_IB_CQ_INIT_ATTR
798 LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR
799 LN_SRC_O2IB_IB_GET_DMA_MR
800 LN_SRC_O2IB_IB_RDMA_WR
801 LN_SRC_O2IB_IB_MAP_MR_SG_4A
802 LN_SRC_O2IB_IB_MAP_MR_SG_5A
803 LN_SRC_O2IB_IB_DEVICE_ATTRS
804 LN_SRC_O2IB_IB_ALLOC_PD
805 LN_SRC_O2IB_IB_INC_RKEY
806 LN_SRC_O2IB_IB_POST_SEND_CONST
807 LN_SRC_SANE_IB_DMA_MAP_SG
808 LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS
809 LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS
810 LN_SRC_O2IB_RDMA_REJECT
812 LN_SRC_O2IB_RDMA_CONNECT_LOCKED
813 LN_SRC_O2IB_ETHTOOL_LINK_SETTINGS
815 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [
816 LN_O2IB_RDMA_CREATE_ID_4A
817 LN_O2IB_RDMA_CREATE_ID_5A
818 LN_O2IB_IB_CQ_INIT_ATTR
819 LN_O2IB_IB_ALLOC_FAST_REG_MR
820 LN_O2IB_IB_GET_DMA_MR
822 LN_O2IB_IB_MAP_MR_SG_4A
823 LN_O2IB_IB_MAP_MR_SG_5A
824 LN_O2IB_IB_DEVICE_ATTRS
827 LN_O2IB_IB_POST_SEND_CONST
828 LN_SANE_IB_DMA_MAP_SG
829 LN_O2IB_IB_DEVICE_OPS_EXISTS
830 LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
833 LN_O2IB_RDMA_CONNECT_LOCKED
834 LN_O2IB_ETHTOOL_LINK_SETTINGS
836 ]) # ENABLEO2IB != "no"
842 # check whether to use the Gemini Network Interface lnd
844 AC_DEFUN([LN_CONFIG_GNILND], [
845 AC_MSG_CHECKING([whether to enable GNI lnd])
847 AS_HELP_STRING([--enable-gni],
849 [], [enable_gni="no"])
850 AC_MSG_RESULT([$enable_gni])
852 AS_IF([test "x$enable_gni" = xyes], [
853 # GNICPPFLAGS was set in spec file
854 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
855 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
856 LB_CHECK_COMPILE([if GNI kernel headers are present],
858 #include <linux/types.h>
861 gni_cdm_handle_t kgni_domain;
864 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
865 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
870 AC_MSG_ERROR([cannot compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
872 # at this point, we have gnilnd basic support,
873 # now check for extra features
874 LB_CHECK_COMPILE([to use RCA in gnilnd],
876 #include <linux/types.h>
878 #include <krca_lib.h>
880 gni_cdm_handle_t kgni_domain;
882 krca_ticket_t ticket = KRCA_NULL_TICKET;
884 __u32 nid = 0, nic_addr;
885 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
886 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
887 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
888 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
891 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
893 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
895 AC_SUBST(ENABLE_GNI, yes)
897 AC_SUBST(ENABLE_GNI, no)
899 AC_SUBST(GNICPPFLAGS)
901 ]) # LN_CONFIG_GNILND
906 # check whether to use the kfabric Network Interface lnd
908 AC_DEFUN([LN_CONFIG_KFILND], [
910 AS_HELP_STRING([--with-kfi=<path>], [Kfabric build path for kfilnd]),
912 AC_CHECK_FILE([$with_kfi/Module.symvers],
914 # KFICPPFLAGS was set in spec file
915 KFICPPFLAGS="-I$with_kfi/include"
916 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
917 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $KFICPPFLAGS"
918 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $with_kfi/Module.symvers"
919 LB_CHECK_COMPILE([if kfabric headers are present], KFI_header,
921 #include <kfi_endpoint.h>
923 struct kfi_info *hints;
924 hints = kfi_allocinfo();
927 AC_MSG_NOTICE([adding $with_kfi/Module.symvers to Symbol Path])
928 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $with_kfi/Module.symvers"
930 AC_MSG_ERROR([can't compile kfilnd with given KFICPPFLAGS: $KFICPPFLAGS])
933 AC_MSG_ERROR(["$with_kfi/Module.symvers does not exist"])
936 AC_DEFINE(HAVE_KFILND, 1, [support kfabric LND])
937 AC_SUBST(KFICPPFLAGS)
939 AC_SUBST(EXTRA_SYMBOLS)
940 ]) # LN_CONFIG_KFILND
943 # LN_CONFIG_SOCK_CREATE_KERN
945 # 4.x sock_create_kern() added a first parameter as 'struct net *'
948 AC_DEFUN([LN_SRC_CONFIG_SOCK_CREATE_KERN], [
949 LB2_LINUX_TEST_SRC([sock_create_kern_net], [
950 #include <linux/net.h>
951 #include <net/net_namespace.h>
953 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
956 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
957 AC_MSG_CHECKING([if 'sock_create_kern' first parameter is net])
958 LB2_LINUX_TEST_RESULT([sock_create_kern_net], [
959 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
960 [sock_create_kern use net as first parameter])
962 ]) # LN_CONFIG_SOCK_CREATE_KERN
965 # LN_CONFIG_SK_DATA_READY
967 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
969 AC_DEFUN([LN_SRC_CONFIG_SK_DATA_READY], [
970 LB2_LINUX_TEST_SRC([sk_data_ready], [
971 #include <linux/net.h>
972 #include <net/sock.h>
974 ((struct sock *)0)->sk_data_ready(NULL);
977 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
978 AC_MSG_CHECKING([if 'sk_data_ready' takes only one argument])
979 LB2_LINUX_TEST_RESULT([sk_data_ready], [
980 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
981 [sk_data_ready uses only one argument])
983 ]) # LN_CONFIG_SK_DATA_READY
986 # LN_HAVE_HYPERVISOR_IS_TYPE
988 # 4.14 commit 79cc74155218316b9a5d28577c7077b2adba8e58
989 # x86/paravirt: Provide a way to check for hypervisors
991 AC_DEFUN([LN_SRC_HAVE_HYPERVISOR_IS_TYPE], [
992 LB2_LINUX_TEST_SRC([hypervisor_is_type_exists], [
993 #include <asm/hypervisor.h>
995 (void)hypervisor_is_type(X86_HYPER_NATIVE);
998 AC_DEFUN([LN_HAVE_HYPERVISOR_IS_TYPE], [
999 AC_MSG_CHECKING([if hypervisor_is_type function is available])
1000 LB2_LINUX_TEST_RESULT([hypervisor_is_type_exists], [
1001 AC_DEFINE(HAVE_HYPERVISOR_IS_TYPE, 1,
1002 [hypervisor_is_type function exists])
1004 ]) # LN_HAVE_HYPERVISOR_IS_TYPE
1007 # LN_HAVE_ORACLE_OFED_EXTENSIONS
1011 AC_DEFUN([LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS], [
1012 LB2_LINUX_TEST_SRC([oracle_ofed_ext], [
1013 #include <rdma/ib_fmr_pool.h>
1015 struct ib_fmr_pool_param param = {
1020 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
1021 [if Oracle OFED Extensions are enabled])
1024 AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [
1025 AC_MSG_CHECKING([if Oracle OFED Extensions are enabled])
1026 LB2_LINUX_TEST_RESULT([oracle_ofed_ext], [
1027 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
1028 [if Oracle OFED Extensions are enabled])
1030 ]) # LN_HAVE_ORACLE_OFED_EXTENSIONS
1033 # LN_CONFIG_SOCK_GETNAME
1035 # 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
1036 # does not take the length *int argument and returns the length
1038 AC_DEFUN([LN_SRC_CONFIG_SOCK_GETNAME], [
1039 LB2_LINUX_TEST_SRC([kern_sock_getname_2args], [
1040 #include <linux/net.h>
1042 kernel_getsockname(NULL, NULL);
1045 AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
1046 AC_MSG_CHECKING([if 'getname' has two args])
1047 LB2_LINUX_TEST_RESULT([kern_sock_getname_2args], [
1048 AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
1049 ['getname' has two args])
1051 ]) # LN_CONFIG_SOCK_GETNAME
1054 # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1056 # kernel 5.3 commit ef11db3310e272d3d8dbe8739e0770820dd20e52
1057 # and kernel 4.18.0-193.el8:
1058 # added in_dev_for_each_ifa_rtnl and in_dev_for_each_ifa_rcu
1059 # and removed for_ifa and endfor_ifa.
1060 # Use the _rntl variant as the current locking is rtnl.
1062 AC_DEFUN([LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1063 LB2_LINUX_TEST_SRC([in_dev_for_each_ifa_rtnl_test], [
1064 #include <linux/inetdevice.h>
1066 const struct in_ifaddr *ifa = NULL;
1067 struct in_device *in_dev = NULL;
1069 in_dev_for_each_ifa_rtnl(ifa, in_dev) {}
1072 AC_DEFUN([LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1073 AC_MSG_CHECKING([if 'in_dev_for_each_ifa_rtnl' is defined])
1074 LB2_LINUX_TEST_RESULT([in_dev_for_each_ifa_rtnl_test], [
1075 AC_DEFINE(HAVE_IN_DEV_FOR_EACH_IFA_RTNL, 1,
1076 ['in_dev_for_each_ifa_rtnl' is defined])
1078 ]) # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1084 AC_DEFUN([LN_USR_RDMA], [
1085 AC_MSG_CHECKING([if RDMA_PS_TCP exists])
1086 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1087 #include <rdma/rdma_user_cm.h>
1090 int x = (int)RDMA_PS_TCP;
1094 AC_DEFINE(HAVE_USRSPC_RDMA_PS_TCP, 1,
1095 [RDMA_PS_TCP exists])
1100 AC_DEFUN([LN_PROG_LINUX_SRC], [
1103 LN_SRC_CONFIG_SK_DATA_READY
1105 LN_SRC_CONFIG_SOCK_CREATE_KERN
1107 LN_SRC_HAVE_HYPERVISOR_IS_TYPE
1108 LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS
1110 LN_SRC_CONFIG_SOCK_GETNAME
1111 # 5.3 and 4.18.0-193.el8
1112 LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1115 AC_DEFUN([LN_PROG_LINUX_RESULTS], [
1116 LN_CONFIG_O2IB_RESULTS
1118 LN_CONFIG_SK_DATA_READY
1120 LN_CONFIG_SOCK_CREATE_KERN
1122 LN_HAVE_HYPERVISOR_IS_TYPE
1123 LN_HAVE_ORACLE_OFED_EXTENSIONS
1125 LN_CONFIG_SOCK_GETNAME
1126 # 5.3 and 4.18.0-193.el8
1127 LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1133 # LNet linux kernel checks
1135 AC_DEFUN([LN_PROG_LINUX], [
1136 AC_MSG_NOTICE([LNet kernel checks
1137 ==============================================================================])
1148 # default paths for installed files
1150 AC_DEFUN([LN_PATH_DEFAULTS], [
1151 ]) # LN_PATH_DEFAULTS
1156 # other configure checks
1158 AC_DEFUN([LN_CONFIGURE], [
1159 AC_MSG_NOTICE([LNet core checks
1160 ==============================================================================])
1163 AS_HELP_STRING([--with-cuda=path],
1164 [Use a CUDA sources.]),
1165 [LB_ARG_CANON_PATH([cuda], [CUDA_PATH])],
1166 [CUDA_PATH=`ls -d1 /usr/src/nvidia-*/nvidia/ | tail -1`]
1170 AS_HELP_STRING([--with-gds=path],
1171 [Use a gds sources.]),
1172 [LB_ARG_CANON_PATH([gds], [GDS_PATH])],
1173 [GDS_PATH=`ls -d1 /usr/src/nvidia-fs* | tail -1`]
1176 AS_IF([test -n "${CUDA_PATH}" && test -n "${GDS_PATH}"],[
1177 LB_CHECK_FILE([$CUDA_PATH/nv-p2p.h],
1179 AC_MSG_RESULT([CUDA path is $CUDA_PATH])
1182 [AC_MSG_ERROR([CUDA sources don't found. nv-p2p.h don't exit])]
1185 LB_CHECK_FILE([$GDS_PATH/nvfs-dma.h],
1187 LB_CHECK_FILE([$GDS_PATH/config-host.h], [
1188 AC_MSG_RESULT([GDS path is $GDS_PATH])
1190 AC_DEFINE(WITH_GDS, 1, "GDS build enabled")
1195 AC_MSG_WARN([CUDA or GDS sources not found. GDS support disabled])
1199 # lnet/utils/lnetconfig/liblnetconfig_netlink.c
1200 AS_IF([test "x$PKGCONF" = "x"],
1201 [AC_MSG_ERROR([pkg-config package is required to configure Lustre])])
1203 AS_IF([test "x$enable_dist" = xno], [
1204 PKG_CHECK_MODULES(LIBNL3, [libnl-genl-3.0 >= 3.1])
1207 AC_CHECK_LIB([nl-3], [nla_get_s32], [
1208 AC_DEFINE(HAVE_NLA_GET_S32, 1,
1209 [libnl3 supports nla_get_s32])
1213 AC_CHECK_LIB([nl-3], [nla_get_s64], [
1214 AC_DEFINE(HAVE_NLA_GET_S64, 1,
1215 [libnl3 supports nla_get_s64])
1222 AC_DEFUN([LN_USR_NLMSGERR], [
1223 AC_MSG_CHECKING([if 'enum nlmsgerr_attrs' exists])
1224 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1225 #include <linux/netlink.h>
1228 int x = (int)NLMSGERR_ATTR_MAX;
1232 AC_DEFINE(HAVE_USRSPC_NLMSGERR, 1,
1233 ['enum nlmsgerr_attrs' exists])
1235 ]) # LN_USR_NLMGSERR
1237 # lnet/utils/portals.c
1238 AC_CHECK_HEADERS([netdb.h])
1239 AC_CHECK_FUNCS([gethostbyname])
1241 # lnet/utils/wirecheck.c
1242 AC_CHECK_FUNCS([strnlen])
1244 # -------- Check for required packages --------------
1246 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
1247 AC_ARG_ENABLE(efence,
1248 AS_HELP_STRING([--enable-efence],
1249 [use efence library]),
1250 [], [enable_efence="no"])
1251 AC_MSG_RESULT([$enable_efence])
1254 AS_IF([test "$enable_efence" = yes], [
1255 LIBEFENCE="-lefence"
1256 AC_DEFINE(HAVE_LIBEFENCE, 1,
1257 [libefence support is requested])
1258 AC_SUBST(ENABLE_EFENCE, yes)
1260 AC_SUBST(ENABLE_EFENCE, no)
1272 # AM_CONDITIONAL defines for lnet
1274 AC_DEFUN([LN_CONDITIONALS], [
1275 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
1276 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
1277 AM_CONDITIONAL(BUILD_KFILND, test x$KFILND = "xkfilnd")
1278 ]) # LN_CONDITIONALS
1283 # files that should be generated with AC_OUTPUT
1285 AC_DEFUN([LN_CONFIG_FILES], [
1289 lnet/autoconf/Makefile
1291 lnet/include/Makefile
1292 lnet/include/lnet/Makefile
1293 lnet/include/uapi/linux/lnet/Makefile
1295 lnet/klnds/autoMakefile
1296 lnet/klnds/o2iblnd/Makefile
1297 lnet/klnds/o2iblnd/autoMakefile
1298 lnet/klnds/gnilnd/Makefile
1299 lnet/klnds/gnilnd/autoMakefile
1300 lnet/klnds/socklnd/Makefile
1301 lnet/klnds/socklnd/autoMakefile
1302 lnet/klnds/kfilnd/Makefile
1303 lnet/klnds/kfilnd/autoMakefile
1305 lnet/lnet/autoMakefile
1306 lnet/selftest/Makefile
1307 lnet/selftest/autoMakefile
1309 lnet/utils/lnetconfig/Makefile
1311 ]) # LN_CONFIG_FILES