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_ARG_ENABLE([multiple-lnds],
60 [AS_HELP_STRING([--enable-multiple-lnds],
61 [enable multiple lnds to build in-kernel and external o2iblnd])],
62 [AS_IF([test x$enable_multiple_lnds != xyes -a x$enable_multiple_lnds != xno],
63 [AC_MSG_ERROR([multiple-lnds valid options are "yes" or "no"])])],
64 [enable_multiple_lnds="no"])
65 ENABLE_MULTIPLE_LNDS="$enable_multiple_lnds"
67 AC_MSG_CHECKING([if external o2iblnd needs to use Compat RDMA])
69 AS_HELP_STRING([--with-o2ib=[yes|no|<path>]],
70 [build o2iblnd against path]),
71 [], [with_o2ib="yes"])
74 yes) INT_O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
75 BUILT_IN_KO2IBLND="yes"
76 # Use ofed_info to find external driver
77 AS_IF([which ofed_info 2>/dev/null], [
78 AS_IF([test x$uses_dpkg = xyes], [
79 LIST_ALL_PKG="dpkg -l | awk '{print \[$]2}'"
80 LSPKG="dpkg --listfiles"
82 LIST_ALL_PKG="rpm -qa"
86 O2IBPKG="mlnx-ofed-kernel-dkms"
87 O2IBPKG+="|mlnx-ofed-kernel-modules"
88 O2IBPKG+="|mlnx-ofa_kernel-devel"
89 O2IBPKG+="|compat-rdma-devel"
90 O2IBPKG+="|kernel-ib-devel"
91 O2IBPKG+="|ofa_kernel-devel"
94 O2IBDIR+="|/ofa_kernel/default"
97 O2IBDIR_PATH=$(eval $LIST_ALL_PKG |
98 egrep -w "$O2IBPKG" | xargs $LSPKG |
99 egrep "${O2IBDIR}$" | head -n1)
101 if test -n "$O2IBDIR_PATH"; then
102 EXT_O2IBPATHS=$(find $O2IBDIR_PATH -name rdma_cm.h |
103 grep -F -e "$(uname -r)" -e default |
104 sed -e 's/\/include\/rdma\/rdma_cm.h//')
107 # When ofed-scripts are installed and either the devel
108 # package is missing or multiple devel packages are
109 # installed. Give the user a warning
110 # The in-kernel ofed stack can be built .. so we can
113 EXTERNAL_KO2IBLND="yes"
114 AS_IF([test -z "$EXT_O2IBPATHS"], [
115 EXTERNAL_KO2IBLND="no"
117 * You seem to have an OFED installed but have not installed the associated
119 * If you still want to build Lustre for your External OFED I/B stack,
120 * you need to install its devel headers RPM.
121 * Only the kernel built-in I/B stack support will be built.
124 AS_IF([test $(echo $EXT_O2IBPATHS | wc -w) -ge 2], [
125 BUILT_IN_KO2IBLND="no"
127 * It appears that you have multiple OFED versions installed.
128 * If you still want to build Lustre for your External OFED I/B stack, you
129 * need to install a single version with the associated devel package.
130 * Only the kernel built-in I/B stack support will be built.
133 if test x$EXTERNAL_KO2IBLND != "xno" ; then
134 if test -e $EXT_O2IBPATHS/${LINUXRELEASE}; then
135 EXT_O2IBPATHS=$EXT_O2IBPATHS/${LINUXRELEASE}
136 elif test -e $EXT_O2IBPATHS/default; then
137 EXT_O2IBPATHS=$EXT_O2IBPATHS/default
144 EXTERNAL_KO2IBLND="no"
145 BUILT_IN_KO2IBLND="no"
147 *) ENABLEO2IB="withpath"
148 EXT_O2IBPATHS=$with_o2ib
149 EXTERNAL_KO2IBLND="yes"
150 INT_O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
151 BUILT_IN_KO2IBLND="yes"
155 AS_IF([test $ENABLEO2IB = "no"], [
157 AC_DEFUN([LN_CONFIG_O2IB_SRC], [])
158 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [])
162 # Verify in-kernel O2IB can be built (headers exist) ... or disable it.
164 for INT_O2IBPATH in $INT_O2IBPATHS; do
165 AS_IF([test \( -f ${INT_O2IBPATH}/include/rdma/rdma_cm.h -a \
166 -f ${INT_O2IBPATH}/include/rdma/ib_cm.h -a \
167 -f ${INT_O2IBPATH}/include/rdma/ib_verbs.h \)], [
172 if ! $int_o2ib_found; then
173 AC_MSG_WARN([kernel does not support in-kernel o2ib, it will not be built])
174 BUILT_IN_KO2IBLND="no"
177 # Verify external O2IB can be built (headers exist), or abort
179 for EXT_O2IBPATH in $EXT_O2IBPATHS; do
180 AS_IF([test \( -f ${EXT_O2IBPATH}/include/rdma/rdma_cm.h -a \
181 -f ${EXT_O2IBPATH}/include/rdma/ib_cm.h -a \
182 -f ${EXT_O2IBPATH}/include/rdma/ib_verbs.h \)], [
187 if ! $ext_o2ib_found; then
188 case $EXT_ENABLEO2IB in
189 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
191 Auto detection of external O2IB failed. Build of external o2ib disabled.])
192 EXTERNAL_KO2IBLND="no"
197 if test "x$EXTERNAL_KO2IBLND" != no ; then
198 # Additional checks for external O2IB
200 compatrdma_found=false
201 if test -f ${EXT_O2IBPATH}/include/linux/compat-2.6.h; then
203 compatrdma_found=true
204 AC_DEFINE(HAVE_OFED_COMPAT_RDMA, 1, [compat rdma found])
205 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${EXT_O2IBPATH}/include/linux/compat-2.6.h"
206 if test -f "$EXT_O2IBPATH/include/linux/compat_autoconf.h"; then
207 COMPAT_AUTOCONF="$EXT_O2IBPATH/include/linux/compat_autoconf.h"
212 if ! $compatrdma_found; then
213 if test -f "$EXT_O2IBPATH/config.mk"; then
214 . "$EXT_O2IBPATH/config.mk"
215 elif test -f "$EXT_O2IBPATH/ofed_patch.mk"; then
216 . "$EXT_O2IBPATH/ofed_patch.mk"
218 elif test -z "$COMPAT_AUTOCONF"; then
220 if test "x$RHEL_KERNEL" = xyes; then
221 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
222 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
223 while test "$I" -ge 0; do
224 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
227 elif test "x$SUSE_KERNEL" = xyes; then
228 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
229 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
233 AC_MSG_CHECKING([whether to use any OFED backport headers])
234 if test -n "$BACKPORT_INCLUDES"; then
236 OFED_BACKPORT_PATH="$EXT_O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
237 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
243 EXT_O2IBPATH=$(readlink --canonicalize $EXT_O2IBPATH)
244 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$EXT_O2IBPATH/include"
245 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$EXT_O2IBPATH/include/uapi"
246 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
247 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
248 openib_gen2_support, [
249 #ifdef HAVE_OFED_COMPAT_RDMA
251 #undef PACKAGE_TARNAME
252 #undef PACKAGE_VERSION
253 #undef PACKAGE_STRING
254 #undef PACKAGE_BUGREPORT
256 #include <linux/compat-2.6.h>
258 #include <linux/version.h>
259 #include <linux/pci.h>
260 #include <linux/gfp.h>
261 #include <rdma/rdma_cm.h>
262 #include <rdma/ib_cm.h>
263 #include <rdma/ib_verbs.h>
265 struct rdma_cm_id *cm_idi __attribute__ ((unused));
266 struct rdma_conn_param conn_param __attribute__ ((unused));
267 struct ib_device_attr device_attr __attribute__ ((unused));
268 struct ib_qp_attr qp_attr __attribute__ ((unused));
269 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
271 rdma_destroy_id(NULL);
273 EXT_O2IBLND="o2iblnd"
276 "yes") AC_MSG_ERROR([cannot compile with OpenIB gen2 headers]) ;;
277 "withpath") AC_MSG_ERROR([cannot compile with OpenIB gen2 headers under $EXT_O2IBPATH]) ;;
278 *) AC_MSG_ERROR([internal error]) ;;
281 # we know that the found external OFED source+headers are good
284 if test -f $EXT_O2IBPATH/Module.symvers ; then
285 CHECK_SYMBOLS=$EXT_O2IBPATH/Module.symvers
287 if test -n "$CHECK_SYMBOLS"; then
288 if test ! "$CHECK_SYMBOLS" -ef "$LINUX_OBJ/Module.symvers"; then
289 AC_MSG_NOTICE([adding $CHECK_SYMBOLS to external o2ib symbols])
290 EXT_O2IB_SYMBOLS="${CHECK_SYMBOLS}"
292 EXTERNAL_KO2IBLND="no"
294 elif test "x$EXTERNAL_KO2IBLND" != "xno" ; then
296 * Module.symvers for external o2iblnd was not found.
297 * Expected: $EXT_O2IBPATH/Module.symvers
298 * ko2iblnd.ko for external OFED will not be built.
300 EXTERNAL_KO2IBLND="no"
304 # we suspect that the found in-kernel OFED source+headers are good
305 # the above compile test *could* be repeated with in-kernel paths ...
308 if test -f $INT_O2IBPATH/Module.symvers; then
309 CHECK_SYMBOLS=$INT_O2IBPATH/Module.symvers
310 elif test "x$SUSE_KERNEL" = "xyes"; then
311 CHECK_SYMBOLS=$(find ${INT_O2IBPATH}* -name Module.symvers)
312 # Select only the current 'flavor' if there is more than 1
313 NUM_AVAIL=$(find ${INT_O2IBPATH}* -name Module.symvers | wc -l)
314 if test ${NUM_AVAIL} -gt 1; then
315 PREFER=$(basename ${LINUX_OBJ})
316 for F in $(find ${O2IBPATH}-obj -name Module.symvers)
318 maybe=$(echo $F | grep "/${PREFER}")
319 if test "x$maybe" != "x"; then
324 elif test -f $LINUX_OBJ/Module.symvers; then
325 # Debian symvers is in the arch tree
326 CHECK_SYMBOLS=$LINUX_OBJ/Module.symvers
329 if test -n "$CHECK_SYMBOLS"; then
330 if test ! "$CHECK_SYMBOLS" -ef "$LINUX_OBJ/Module.symvers"; then
331 AC_MSG_NOTICE([adding $CHECK_SYMBOLS to o2ib in-kernel symbols])
332 INT_O2IB_SYMBOLS="${CHECK_SYMBOLS}"
335 AC_MSG_WARN([Module.symvers for in-kernel o2iblnd was not found, in-kernel ofed will not be built])
336 BUILT_IN_KO2IBLND="no"
339 if test "x$EXTERNAL_KO2IBLND" = "xno" -a "x$BUILT_IN_KO2IBLND" = "xno" ; then
340 AC_MSG_ERROR([No o2iblnd can be built])
341 elif test "x$ENABLE_MULTIPLE_LNDS" = "xno" -a \
342 "x$EXTERNAL_KO2IBLND" != "xno" -a "x$BUILT_IN_KO2IBLND" != "xno"; then
344 NOTE: --enable-multiple-lnds is needed to enable both o2iblnd drivers.
345 * Disabling in-kernel o2iblnd in favor of external o2iblnd driver.
346 * There can be only one in this configuration
348 BUILT_IN_KO2IBLND="no"
351 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
352 linux_kthread_worker, [
353 #ifdef HAVE_OFED_COMPAT_RDMA
355 #undef PACKAGE_TARNAME
356 #undef PACKAGE_VERSION
357 #undef PACKAGE_STRING
358 #undef PACKAGE_BUGREPORT
360 #include <linux/compat-2.6.h>
362 #include <linux/kthread.h>
364 struct kthread_work *kth_wrk = NULL;
365 flush_kthread_work(kth_wrk);
367 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
368 if test -z "$COMPAT_AUTOCONF"; then
369 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
372 EXTRA_CHECK_INCLUDE=""
374 AC_SUBST(EXTRA_OFED_CONFIG)
375 AC_SUBST(EXTRA_OFED_INCLUDE)
376 AC_SUBST(EXT_O2IBLND)
377 AC_SUBST(EXT_O2IB_SYMBOLS)
378 AC_SUBST(INT_O2IB_SYMBOLS)
380 # Passed down to deb packaging via autoMakefile.am
381 AC_SUBST(EXT_O2IBPATH)
383 AC_SUBST(ENABLE_MULTIPLE_LNDS)
385 AS_IF([test $ENABLEO2IB != "no"], [
386 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
387 if test ! $EXT_O2IBPATH -ef $LINUX_OBJ; then
388 EXTERNAL_KO2IBLND="yes"
391 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
392 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_4A], [
393 LB2_OFED_TEST_SRC([rdma_create_id_4args], [
394 #ifdef HAVE_OFED_COMPAT_RDMA
396 #undef PACKAGE_TARNAME
397 #undef PACKAGE_VERSION
398 #undef PACKAGE_STRING
399 #undef PACKAGE_BUGREPORT
401 #include <linux/compat-2.6.h>
403 #include <rdma/rdma_cm.h>
405 rdma_create_id(NULL, NULL, 0, 0);
406 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
408 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_4A], [
409 LB2_OFED_TEST_RESULTS(
410 ['rdma_create_id' wants four args],
411 [rdma_create_id_4args],
412 [HAVE_OFED_RDMA_CREATE_ID_4ARG])
415 # 4.4 added network namespace parameter for rdma_create_id()
416 AC_DEFUN([LN_SRC_O2IB_RDMA_CREATE_ID_5A], [
417 LB2_OFED_TEST_SRC([rdma_create_id_5args], [
418 #ifdef HAVE_OFED_COMPAT_RDMA
420 #undef PACKAGE_TARNAME
421 #undef PACKAGE_VERSION
422 #undef PACKAGE_STRING
423 #undef PACKAGE_BUGREPORT
425 #include <linux/compat-2.6.h>
427 #include <rdma/rdma_cm.h>
429 rdma_create_id(NULL, NULL, NULL, 0, 0);
430 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
432 AC_DEFUN([LN_O2IB_RDMA_CREATE_ID_5A], [
433 LB2_OFED_TEST_RESULTS(
434 ['rdma_create_id' wants five args],
435 [rdma_create_id_5args],
436 [HAVE_OFED_RDMA_CREATE_ID_5ARG])
439 # 4.2 introduced struct ib_cq_init_attr which is used
440 # by ib_create_cq(). Note some OFED stacks only keep
441 # their headers in sync with latest kernels but not
442 # the functionality which means for infiniband testing
443 # we need to always test functionality testings.
444 AC_DEFUN([LN_SRC_O2IB_IB_CQ_INIT_ATTR], [
445 LB2_OFED_TEST_SRC([ib_cq_init_attr], [
446 #ifdef HAVE_OFED_COMPAT_RDMA
448 #undef PACKAGE_TARNAME
449 #undef PACKAGE_VERSION
450 #undef PACKAGE_STRING
451 #undef PACKAGE_BUGREPORT
453 #include <linux/compat-2.6.h>
455 #include <rdma/ib_verbs.h>
457 struct ib_cq_init_attr cq_attr;
459 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
460 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
462 AC_DEFUN([LN_O2IB_IB_CQ_INIT_ATTR], [
463 LB2_OFED_TEST_RESULTS(
464 ['struct ib_cq_init_attr' is used by ib_create_cq],
466 [HAVE_OFED_IB_CQ_INIT_ATTR])
469 # 4.3 removed ib_alloc_fast_reg_mr()
470 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR], [
471 LB2_OFED_TEST_SRC([ib_alloc_fast_reg_mr], [
472 #ifdef HAVE_OFED_COMPAT_RDMA
474 #undef PACKAGE_TARNAME
475 #undef PACKAGE_VERSION
476 #undef PACKAGE_STRING
477 #undef PACKAGE_BUGREPORT
479 #include <linux/compat-2.6.h>
481 #include <rdma/ib_verbs.h>
483 ib_alloc_fast_reg_mr(NULL, 0);
484 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
486 AC_DEFUN([LN_O2IB_IB_ALLOC_FAST_REG_MR], [
487 LB2_OFED_TEST_RESULTS(
488 ['ib_alloc_fast_reg_mr' exists],
489 [ib_alloc_fast_reg_mr],
490 [HAVE_OFED_IB_ALLOC_FAST_REG_MR])
493 # 4.9 must stop using ib_get_dma_mr and the global MR
494 # We then have to use FMR/Fastreg for all RDMA.
495 AC_DEFUN([LN_SRC_O2IB_IB_GET_DMA_MR], [
496 LB2_OFED_TEST_SRC([ib_get_dma_mr], [
497 #ifdef HAVE_OFED_COMPAT_RDMA
499 #undef PACKAGE_TARNAME
500 #undef PACKAGE_VERSION
501 #undef PACKAGE_STRING
502 #undef PACKAGE_BUGREPORT
504 #include <linux/compat-2.6.h>
506 #include <rdma/ib_verbs.h>
508 ib_get_dma_mr(NULL, 0);
509 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
511 AC_DEFUN([LN_O2IB_IB_GET_DMA_MR], [
512 LB2_OFED_TEST_RESULTS(
513 ['ib_get_dma_mr' exists],
515 [HAVE_OFED_IB_GET_DMA_MR])
518 # In v4.4 Linux kernel,
519 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
520 # split up struct ib_send_wr so that all non-trivial verbs
521 # use their own structure which embedds struct ib_send_wr.
522 AC_DEFUN([LN_SRC_O2IB_IB_RDMA_WR], [
523 LB2_OFED_TEST_SRC([ib_rdma_wr], [
524 #ifdef HAVE_OFED_COMPAT_RDMA
526 #undef PACKAGE_TARNAME
527 #undef PACKAGE_VERSION
528 #undef PACKAGE_STRING
529 #undef PACKAGE_BUGREPORT
531 #include <linux/compat-2.6.h>
533 #include <rdma/ib_verbs.h>
535 const struct ib_rdma_wr *wr __attribute__ ((unused));
538 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
540 AC_DEFUN([LN_O2IB_IB_RDMA_WR], [
541 LB2_OFED_TEST_RESULTS(
542 ['struct ib_rdma_wr' is defined],
544 [HAVE_OFED_IB_RDMA_WR])
547 # new fast registration API introduced in 4.4
548 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_4A], [
549 LB2_OFED_TEST_SRC([ib_map_mr_sg_4args], [
550 #ifdef HAVE_OFED_COMPAT_RDMA
552 #undef PACKAGE_TARNAME
553 #undef PACKAGE_VERSION
554 #undef PACKAGE_STRING
555 #undef PACKAGE_BUGREPORT
557 #include <linux/compat-2.6.h>
559 #include <rdma/ib_verbs.h>
561 ib_map_mr_sg(NULL, NULL, 0, 0);
562 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
564 # new fast registration API introduced in 4.4
565 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_4A], [
566 LB2_OFED_TEST_RESULTS(
567 ['ib_map_mr_sg' with 4 args exists],
568 [ib_map_mr_sg_4args],
569 [HAVE_OFED_IB_MAP_MR_SG])
572 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
573 # in kernel 4.7 (and RHEL 7.3)
574 AC_DEFUN([LN_SRC_O2IB_IB_MAP_MR_SG_5A], [
575 LB2_OFED_TEST_SRC([ib_map_mr_sg_5args], [
576 #ifdef HAVE_OFED_COMPAT_RDMA
578 #undef PACKAGE_TARNAME
579 #undef PACKAGE_VERSION
580 #undef PACKAGE_STRING
581 #undef PACKAGE_BUGREPORT
583 #include <linux/compat-2.6.h>
585 #include <rdma/ib_verbs.h>
587 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
588 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
590 AC_DEFUN([LN_O2IB_IB_MAP_MR_SG_5A], [
591 LB2_OFED_TEST_RESULTS(
592 [struct ib_reg_wr exists],
593 [ib_map_mr_sg_5args],
594 [HAVE_OFED_IB_MAP_MR_SG])
595 LB2_OFED_TEST_RESULTS(
596 ['ib_map_mr_sg()' with 5 args exists],
597 [ib_map_mr_sg_5args],
598 [HAVE_OFED_IB_MAP_MR_SG_5ARGS])
601 # ib_query_device() removed in 4.5
602 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_ATTRS], [
603 LB2_OFED_TEST_SRC([ib_device_attrs], [
604 #ifdef HAVE_OFED_COMPAT_RDMA
606 #undef PACKAGE_TARNAME
607 #undef PACKAGE_VERSION
608 #undef PACKAGE_STRING
609 #undef PACKAGE_BUGREPORT
611 #include <linux/compat-2.6.h>
613 #include <rdma/ib_verbs.h>
615 struct ib_device dev;
616 struct ib_device_attr dev_attr = {};
617 dev.attrs = dev_attr;
618 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
620 AC_DEFUN([LN_O2IB_IB_DEVICE_ATTRS], [
621 LB2_OFED_TEST_RESULTS(
622 ['struct ib_device' has member 'attrs'],
624 [HAVE_OFED_IB_DEVICE_ATTRS])
627 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
628 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
629 AC_DEFUN([LN_SRC_O2IB_IB_ALLOC_PD], [
630 LB2_OFED_TEST_SRC([ib_alloc_pd], [
631 #ifdef HAVE_OFED_COMPAT_RDMA
633 #undef PACKAGE_TARNAME
634 #undef PACKAGE_VERSION
635 #undef PACKAGE_STRING
636 #undef PACKAGE_BUGREPORT
638 #include <linux/compat-2.6.h>
640 #include <rdma/ib_verbs.h>
642 ib_alloc_pd(NULL, 0);
643 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
645 AC_DEFUN([LN_O2IB_IB_ALLOC_PD], [
646 LB2_OFED_TEST_RESULTS(
647 [2arg 'ib_alloc_pd' exists],
649 [HAVE_OFED_IB_ALLOC_PD_2ARGS])
652 AC_DEFUN([LN_SRC_O2IB_IB_INC_RKEY], [
653 LB2_OFED_TEST_SRC([ib_inc_rkey], [
654 #ifdef HAVE_OFED_COMPAT_RDMA
656 #undef PACKAGE_TARNAME
657 #undef PACKAGE_VERSION
658 #undef PACKAGE_STRING
659 #undef PACKAGE_BUGREPORT
661 #include <linux/compat-2.6.h>
663 #include <rdma/ib_verbs.h>
665 (void)ib_inc_rkey(0);
666 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
668 AC_DEFUN([LN_O2IB_IB_INC_RKEY], [
669 LB2_OFED_TEST_RESULTS(
670 [function 'ib_inc_rkey' is defined],
672 [HAVE_OFED_IB_INC_RKEY])
675 # In MOFED 4.6, the second and third parameters for
676 # ib_post_send() and ib_post_recv() are declared with
678 AC_DEFUN([LN_SRC_O2IB_IB_POST_SEND_CONST], [
679 LB2_OFED_TEST_SRC([ib_post_send_recv_const], [
680 #ifdef HAVE_OFED_COMPAT_RDMA
682 #undef PACKAGE_TARNAME
683 #undef PACKAGE_VERSION
684 #undef PACKAGE_STRING
685 #undef PACKAGE_BUGREPORT
687 #include <linux/compat-2.6.h>
689 #include <rdma/ib_verbs.h>
691 ib_post_send(NULL, (const struct ib_send_wr *)NULL,
692 (const struct ib_send_wr **)NULL);
693 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
695 AC_DEFUN([LN_O2IB_IB_POST_SEND_CONST], [
696 LB2_OFED_TEST_RESULTS(
697 ['ib_post_send() and ib_post_recv()' have const parameters],
698 [ib_post_send_recv_const],
699 [HAVE_OFED_IB_POST_SEND_RECV_CONST])
702 # MOFED 5.5 fails with:
703 # ERROR: "ib_dma_virt_map_sg" [.../ko2iblnd.ko] undefined!
704 # See if we have a broken ib_dma_map_sg()
705 AC_DEFUN([LN_SRC_SANE_IB_DMA_MAP_SG], [
706 LB2_OFED_TEST_SRC([sane_ib_dma_map_sg], [
707 #ifdef HAVE_OFED_COMPAT_RDMA
709 #undef PACKAGE_TARNAME
710 #undef PACKAGE_VERSION
711 #undef PACKAGE_STRING
712 #undef PACKAGE_BUGREPORT
714 #include <linux/compat-2.6.h>
716 #include <rdma/ib_verbs.h>
718 ib_dma_map_sg((struct ib_device *)NULL,
719 (struct scatterlist *)NULL, 1, 0);
720 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
722 AC_DEFUN([LN_SANE_IB_DMA_MAP_SG], [
723 LB2_OFED_TEST_RESULTS(
724 [if ib_dma_map_sg() is sane],
725 [sane_ib_dma_map_sg],
726 [HAVE_OFED_IB_DMA_MAP_SG_SANE],[module])
730 # LN_IB_DEVICE_OPS_EXISTS
732 # kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
733 # RDMA/core: Introduce ib_device_ops
734 # ... introduces the ib_device_ops structure that defines all the
735 # InfiniBand device operations in one place ...
737 AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS], [
738 LB2_OFED_TEST_SRC([ib_device_ops_test], [
739 #include <rdma/ib_verbs.h>
741 int x = offsetof(struct ib_device_ops, unmap_fmr);
744 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
746 AC_DEFUN([LN_O2IB_IB_DEVICE_OPS_EXISTS], [
747 LB2_OFED_TEST_RESULTS(
748 [struct ib_device_ops is defined],
749 [ib_device_ops_test],
750 [HAVE_OFED_IB_DEVICE_OPS])
751 ]) # LN_IB_DEVICE_OPS_EXISTS
754 # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
756 # kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
757 # IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
758 # ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
760 AC_DEFUN([LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
761 LB2_OFED_TEST_SRC([ib_sg_dma_address_test], [
762 #include <rdma/ib_verbs.h>
764 u64 x = ib_sg_dma_address(NULL, NULL);
767 ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
769 AC_DEFUN([LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
770 LB2_OFED_TEST_RESULTS(
771 [ib_sg_dma_address wrapper exists],
772 [ib_sg_dma_address_test],
773 [HAVE_OFED_IB_SG_DMA_ADDRESS])
774 ]) # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
777 # LN_O2IB_RDMA_REJECT
779 # A reason argument was added to rdma_reject() in Linux 5.8,
780 # commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a
781 AC_DEFUN([LN_SRC_O2IB_RDMA_REJECT], [
782 LB2_OFED_TEST_SRC([rdma_reject], [
783 #ifdef HAVE_OFED_COMPAT_RDMA
785 #undef PACKAGE_TARNAME
786 #undef PACKAGE_VERSION
787 #undef PACKAGE_STRING
788 #undef PACKAGE_BUGREPORT
790 #include <linux/compat-2.6.h>
792 #include <rdma/ib_verbs.h>
793 #include <rdma/ib_cm.h>
794 #include <rdma/rdma_cm.h>
796 rdma_reject(NULL, NULL, 0, 0);
797 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
799 AC_DEFUN([LN_O2IB_RDMA_REJECT], [
800 LB2_OFED_TEST_RESULTS(
801 [4arg 'rdma_reject' exists],
803 [HAVE_OFED_RDMA_REJECT_4ARGS])
804 ]) # LN_O2IB_RDMA_REJECT
809 # The FMR pool API was removed in Linux 5.8,
810 # commit 4e373d5417ecbb4f438a8500f0379a2fc29c2643
811 AC_DEFUN([LN_SRC_O2IB_IB_FMR], [
812 LB2_OFED_TEST_SRC([ib_fmr], [
813 #include <rdma/ib_verbs.h>
815 struct ib_fmr fmr = {};
816 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
818 AC_DEFUN([LN_O2IB_IB_FMR], [
819 LB2_OFED_TEST_RESULTS(
820 [FMR pools API available],
822 [HAVE_OFED_FMR_POOL_API])
826 # LN_O2IB_RDMA_CONNECT_LOCKED
828 # rdma_connect_locked() was added in Linux 5.10,
829 # commit 071ba4cc559de47160761b9500b72e8fa09d923d
830 # and in MOFED-5.2-2. rdma_connect_locked() must
831 # be called instead of rdma_connect() in
832 # RDMA_CM_EVENT_ROUTE_RESOLVED handler.
833 AC_DEFUN([LN_SRC_O2IB_RDMA_CONNECT_LOCKED], [
834 LB2_OFED_TEST_SRC([rdma_connect_locked], [
835 #include <rdma/rdma_cm.h>
837 rdma_connect_locked(NULL, NULL);
838 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
840 AC_DEFUN([LN_O2IB_RDMA_CONNECT_LOCKED], [
841 LB2_OFED_TEST_RESULTS(
842 ['rdma_connect_locked' exists],
843 [rdma_connect_locked],
844 [HAVE_OFED_RDMA_CONNECT_LOCKED])
845 ]) # LN_O2IB_RDMA_CONNECT_LOCKED
847 EXTRA_CHECK_INCLUDE=""
849 AC_DEFUN([LN_CONFIG_O2IB_SRC], [
850 LN_SRC_O2IB_RDMA_CREATE_ID_4A
851 LN_SRC_O2IB_RDMA_CREATE_ID_5A
852 LN_SRC_O2IB_IB_CQ_INIT_ATTR
853 LN_SRC_O2IB_IB_ALLOC_FAST_REG_MR
854 LN_SRC_O2IB_IB_GET_DMA_MR
855 LN_SRC_O2IB_IB_RDMA_WR
856 LN_SRC_O2IB_IB_MAP_MR_SG_4A
857 LN_SRC_O2IB_IB_MAP_MR_SG_5A
858 LN_SRC_O2IB_IB_DEVICE_ATTRS
859 LN_SRC_O2IB_IB_ALLOC_PD
860 LN_SRC_O2IB_IB_INC_RKEY
861 LN_SRC_O2IB_IB_POST_SEND_CONST
862 LN_SRC_SANE_IB_DMA_MAP_SG
863 LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS
864 LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS
865 LN_SRC_O2IB_RDMA_REJECT
867 LN_SRC_O2IB_RDMA_CONNECT_LOCKED
869 AC_DEFUN([LN_CONFIG_O2IB_RESULTS], [
870 LN_O2IB_RDMA_CREATE_ID_4A
871 LN_O2IB_RDMA_CREATE_ID_5A
872 LN_O2IB_IB_CQ_INIT_ATTR
873 LN_O2IB_IB_ALLOC_FAST_REG_MR
874 LN_O2IB_IB_GET_DMA_MR
876 LN_O2IB_IB_MAP_MR_SG_4A
877 LN_O2IB_IB_MAP_MR_SG_5A
878 LN_O2IB_IB_DEVICE_ATTRS
881 LN_O2IB_IB_POST_SEND_CONST
882 LN_SANE_IB_DMA_MAP_SG
883 LN_O2IB_IB_DEVICE_OPS_EXISTS
884 LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
887 LN_O2IB_RDMA_CONNECT_LOCKED
889 ]) # ENABLEO2IB != "no"
895 # check whether to use the Gemini Network Interface lnd
897 AC_DEFUN([LN_CONFIG_GNILND], [
898 AC_MSG_CHECKING([whether to enable GNI lnd])
900 AS_HELP_STRING([--enable-gni],
902 [], [enable_gni="no"])
903 AC_MSG_RESULT([$enable_gni])
905 AS_IF([test "x$enable_gni" = xyes], [
906 # GNICPPFLAGS was set in spec file
907 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
908 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
909 LB_CHECK_COMPILE([if GNI kernel headers are present],
911 #include <linux/types.h>
914 gni_cdm_handle_t kgni_domain;
917 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
918 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
923 AC_MSG_ERROR([cannot compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
925 # at this point, we have gnilnd basic support,
926 # now check for extra features
927 LB_CHECK_COMPILE([to use RCA in gnilnd],
929 #include <linux/types.h>
931 #include <krca_lib.h>
933 gni_cdm_handle_t kgni_domain;
935 krca_ticket_t ticket = KRCA_NULL_TICKET;
937 __u32 nid = 0, nic_addr;
938 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
939 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
940 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
941 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
944 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
946 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
948 AC_SUBST(ENABLE_GNI, yes)
950 AC_SUBST(ENABLE_GNI, no)
952 AC_SUBST(GNICPPFLAGS)
954 ]) # LN_CONFIG_GNILND
959 # check whether to use the kfabric Network Interface lnd
961 AC_DEFUN([LN_CONFIG_KFILND], [
963 AS_HELP_STRING([--with-kfi=<path>], [Kfabric build path for kfilnd]),
965 AC_CHECK_FILE([$with_kfi/Module.symvers],
967 # KFICPPFLAGS was set in spec file
968 KFICPPFLAGS="-I$with_kfi/include"
969 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
970 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $KFICPPFLAGS"
971 KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $with_kfi/Module.symvers"
972 LB_CHECK_COMPILE([if kfabric headers are present], KFI_header,
974 #include <kfi_endpoint.h>
976 struct kfi_info *hints;
977 hints = kfi_allocinfo();
980 AC_MSG_NOTICE([adding $with_kfi/Module.symvers to Symbol Path])
981 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $with_kfi/Module.symvers"
983 AC_MSG_ERROR([cannot compile kfilnd with given KFICPPFLAGS: $KFICPPFLAGS])
986 AC_MSG_ERROR(["$with_kfi/Module.symvers does not exist"])
989 AC_DEFINE(HAVE_KFILND, 1, [support kfabric LND])
990 AC_SUBST(KFICPPFLAGS)
992 AC_SUBST(EXTRA_SYMBOLS)
993 ]) # LN_CONFIG_KFILND
996 # LN_CONFIG_SOCK_CREATE_KERN
998 # 4.x sock_create_kern() added a first parameter as 'struct net *'
1001 AC_DEFUN([LN_SRC_CONFIG_SOCK_CREATE_KERN], [
1002 LB2_LINUX_TEST_SRC([sock_create_kern_net], [
1003 #include <linux/net.h>
1004 #include <net/net_namespace.h>
1006 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
1009 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
1010 LB2_MSG_LINUX_TEST_RESULT([if 'sock_create_kern' first parameter is net],
1011 [sock_create_kern_net], [
1012 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
1013 [sock_create_kern use net as first parameter])
1015 ]) # LN_CONFIG_SOCK_CREATE_KERN
1018 # LN_CONFIG_SK_DATA_READY
1020 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
1022 AC_DEFUN([LN_SRC_CONFIG_SK_DATA_READY], [
1023 LB2_LINUX_TEST_SRC([sk_data_ready], [
1024 #include <linux/net.h>
1025 #include <net/sock.h>
1027 ((struct sock *)0)->sk_data_ready(NULL);
1030 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
1031 LB2_MSG_LINUX_TEST_RESULT([if 'sk_data_ready' takes only one argument],
1033 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
1034 [sk_data_ready uses only one argument])
1036 ]) # LN_CONFIG_SK_DATA_READY
1039 # LN_ETHTOOL_LINK_SETTINGS
1041 # ethtool_link_settings was added in Linux 4.6
1043 AC_DEFUN([LN_SRC_ETHTOOL_LINK_SETTINGS], [
1044 LB2_LINUX_TEST_SRC([ethtool_link_settings], [
1045 #include <linux/ethtool.h>
1047 struct ethtool_link_ksettings cmd;
1048 ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
1050 AC_DEFUN([LN_ETHTOOL_LINK_SETTINGS], [
1051 LB2_MSG_LINUX_TEST_RESULT([if 'ethtool_link_settings' exists],
1052 [ethtool_link_settings], [
1053 AC_DEFINE(HAVE_ETHTOOL_LINK_SETTINGS, 1,
1054 [ethtool_link_settings is defined])
1056 ]) # LN_ETHTOOL_LINK_SETTINGS
1059 # LN_HAVE_HYPERVISOR_IS_TYPE
1061 # 4.14 commit 79cc74155218316b9a5d28577c7077b2adba8e58
1062 # x86/paravirt: Provide a way to check for hypervisors
1064 AC_DEFUN([LN_SRC_HAVE_HYPERVISOR_IS_TYPE], [
1065 LB2_LINUX_TEST_SRC([hypervisor_is_type_exists], [
1066 #include <asm/hypervisor.h>
1068 (void)hypervisor_is_type(X86_HYPER_NATIVE);
1071 AC_DEFUN([LN_HAVE_HYPERVISOR_IS_TYPE], [
1072 LB2_MSG_LINUX_TEST_RESULT([if hypervisor_is_type function is available],
1073 [hypervisor_is_type_exists], [
1074 AC_DEFINE(HAVE_HYPERVISOR_IS_TYPE, 1,
1075 [hypervisor_is_type function exists])
1077 ]) # LN_HAVE_HYPERVISOR_IS_TYPE
1080 # LN_HAVE_ORACLE_OFED_EXTENSIONS
1084 AC_DEFUN([LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS], [
1085 LB2_LINUX_TEST_SRC([oracle_ofed_ext], [
1086 #include <rdma/ib_fmr_pool.h>
1088 struct ib_fmr_pool_param param = {
1094 AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [
1095 LB2_MSG_LINUX_TEST_RESULT([if Oracle OFED Extensions are enabled],
1096 [oracle_ofed_ext], [
1097 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
1098 [if Oracle OFED Extensions are enabled])
1100 ]) # LN_HAVE_ORACLE_OFED_EXTENSIONS
1103 # LN_CONFIG_SOCK_GETNAME
1105 # 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
1106 # does not take the length *int argument and returns the length
1108 AC_DEFUN([LN_SRC_CONFIG_SOCK_GETNAME], [
1109 LB2_LINUX_TEST_SRC([kern_sock_getname_2args], [
1110 #include <linux/net.h>
1112 kernel_getsockname(NULL, NULL);
1115 AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
1116 LB2_MSG_LINUX_TEST_RESULT([if 'getname' has two args],
1117 [kern_sock_getname_2args], [
1118 AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
1119 ['getname' has two args])
1121 ]) # LN_CONFIG_SOCK_GETNAME
1124 # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1126 # kernel 5.3 commit ef11db3310e272d3d8dbe8739e0770820dd20e52
1127 # and kernel 4.18.0-193.el8:
1128 # added in_dev_for_each_ifa_rtnl and in_dev_for_each_ifa_rcu
1129 # and removed for_ifa and endfor_ifa.
1130 # Use the _rntl variant as the current locking is rtnl.
1132 AC_DEFUN([LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1133 LB2_LINUX_TEST_SRC([in_dev_for_each_ifa_rtnl_test], [
1134 #include <linux/inetdevice.h>
1136 const struct in_ifaddr *ifa = NULL;
1137 struct in_device *in_dev = NULL;
1139 in_dev_for_each_ifa_rtnl(ifa, in_dev) {}
1142 AC_DEFUN([LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL], [
1143 LB2_MSG_LINUX_TEST_RESULT([if 'in_dev_for_each_ifa_rtnl' is defined],
1144 [in_dev_for_each_ifa_rtnl_test], [
1145 AC_DEFINE(HAVE_IN_DEV_FOR_EACH_IFA_RTNL, 1,
1146 ['in_dev_for_each_ifa_rtnl' is defined])
1148 ]) # LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1154 AC_DEFUN([LN_USR_RDMA], [
1155 AC_MSG_CHECKING([if RDMA_PS_TCP exists])
1156 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1157 #include <rdma/rdma_user_cm.h>
1160 int x = (int)RDMA_PS_TCP;
1164 AC_DEFINE(HAVE_USRSPC_RDMA_PS_TCP, 1,
1165 [RDMA_PS_TCP exists])
1169 AC_DEFUN([LN_PROG_LINUX_SRC], [
1172 LN_SRC_CONFIG_SK_DATA_READY
1174 LN_SRC_CONFIG_SOCK_CREATE_KERN
1176 LN_SRC_ETHTOOL_LINK_SETTINGS
1178 LN_SRC_HAVE_HYPERVISOR_IS_TYPE
1179 LN_SRC_HAVE_ORACLE_OFED_EXTENSIONS
1181 LN_SRC_CONFIG_SOCK_GETNAME
1182 # 5.3 and 4.18.0-193.el8
1183 LN_SRC_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1186 AC_DEFUN([LN_PROG_LINUX_RESULTS], [
1187 LN_CONFIG_O2IB_RESULTS
1189 LN_CONFIG_SK_DATA_READY
1191 LN_CONFIG_SOCK_CREATE_KERN
1193 LN_ETHTOOL_LINK_SETTINGS
1195 LN_HAVE_HYPERVISOR_IS_TYPE
1196 LN_HAVE_ORACLE_OFED_EXTENSIONS
1198 LN_CONFIG_SOCK_GETNAME
1199 # 5.3 and 4.18.0-193.el8
1200 LN_HAVE_IN_DEV_FOR_EACH_IFA_RTNL
1206 # LNet linux kernel checks
1208 AC_DEFUN([LN_PROG_LINUX], [
1209 AC_MSG_NOTICE([LNet kernel checks
1210 ==============================================================================])
1221 # default paths for installed files
1223 AC_DEFUN([LN_PATH_DEFAULTS], [
1224 ]) # LN_PATH_DEFAULTS
1229 # other configure checks
1231 AC_DEFUN([LN_CONFIGURE], [
1232 AC_MSG_NOTICE([LNet core checks
1233 ==============================================================================])
1236 AS_HELP_STRING([--with-cuda=path],
1237 [Path to the CUDA sources. Set to 'no' to disable.]),
1238 [cudapath="$withval"],
1239 [cudapath1=`ls -d1 /usr/src/nvidia-*/nvidia/ 2>/dev/null | tail -1`])
1242 AS_HELP_STRING([--with-gds=path],
1243 [Path to the GDS sources. Set to 'no' to disable.]),
1244 [gdspath="$withval"],
1245 [gdspath1=`ls -d1 /usr/src/nvidia-fs*/ 2>/dev/null | tail -1`])
1247 AC_MSG_CHECKING([cuda source directory])
1248 AS_IF([test -z "${cudapath}"], [
1249 AS_IF([test -e "${cudapath1}/nv-p2p.h"], [
1250 cudapath=${cudapath1}
1252 cudapath="[Not found]"
1255 AC_MSG_RESULT([$cudapath])
1257 AC_MSG_CHECKING([gds source directory])
1258 AS_IF([test -z "${gdspath}"], [
1259 AS_IF([test -e "${gdspath1}/nvfs-dma.h"], [
1262 gdspath="[Not found]"
1265 AC_MSG_RESULT([$gdspath])
1267 AS_IF([test -e "${cudapath}" && test -e "${gdspath}"],[
1268 LB_CHECK_FILE([$cudapath/nv-p2p.h], [
1269 AC_MSG_RESULT([CUDA path is $cudapath])
1270 [CUDA_PATH=${cudapath}]
1273 AC_MSG_RESULT([CUDA sources not found: nv-p2p.h does not exist])
1276 LB_CHECK_FILE([$gdspath/nvfs-dma.h], [
1277 LB_CHECK_FILE([$gdspath/config-host.h], [
1278 AC_MSG_RESULT([GDS path is ${gdspath}])
1279 [GDS_PATH=${gdspath}]
1281 AC_DEFINE(WITH_GDS, 1, "GDS build enabled")
1283 AC_MSG_RESULT([GDS sources not found: config-host.h does not exist])
1286 AC_MSG_RESULT([GDS sources not found: nvfs-dma.h does not exist])
1289 AC_MSG_WARN([CUDA or GDS sources not found. GDS support disabled])
1292 # lnet/utils/lnetconfig/liblnetconfig_netlink.c
1293 AS_IF([test "x$PKGCONF" = "x"],
1294 [AC_MSG_ERROR([pkg-config package is required to configure Lustre])])
1296 AS_IF([test "x$enable_dist" = xno], [
1297 PKG_CHECK_MODULES(LIBNL3, [libnl-genl-3.0 >= 3.1])
1300 AC_CHECK_LIB([nl-3], [nla_get_s32], [
1301 AC_DEFINE(HAVE_NLA_GET_S32, 1,
1302 [libnl3 supports nla_get_s32])
1306 AC_CHECK_LIB([nl-3], [nla_get_s64], [
1307 AC_DEFINE(HAVE_NLA_GET_S64, 1,
1308 [libnl3 supports nla_get_s64])
1315 AC_DEFUN([LN_USR_NLMSGERR], [
1316 AC_MSG_CHECKING([if 'enum nlmsgerr_attrs' exists])
1317 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1318 #include <linux/netlink.h>
1321 int x = (int)NLMSGERR_ATTR_MAX;
1325 AC_DEFINE(HAVE_USRSPC_NLMSGERR, 1,
1326 ['enum nlmsgerr_attrs' exists])
1328 ]) # LN_USR_NLMGSERR
1330 # lnet/utils/portals.c
1331 AC_CHECK_HEADERS([netdb.h])
1333 # lnet/utils/wirecheck.c
1334 AC_CHECK_FUNCS([strnlen])
1336 # -------- Check for required packages --------------
1338 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
1339 AC_ARG_ENABLE(efence,
1340 AS_HELP_STRING([--enable-efence],
1341 [use efence library]),
1342 [], [enable_efence="no"])
1343 AC_MSG_RESULT([$enable_efence])
1346 AS_IF([test "$enable_efence" = yes], [
1347 LIBEFENCE="-lefence"
1348 AC_DEFINE(HAVE_LIBEFENCE, 1,
1349 [libefence support is requested])
1350 AC_SUBST(ENABLE_EFENCE, yes)
1352 AC_SUBST(ENABLE_EFENCE, no)
1364 # AM_CONDITIONAL defines for lnet
1366 AC_DEFUN([LN_CONDITIONALS], [
1367 AM_CONDITIONAL(EXTERNAL_KO2IBLND, test x$EXTERNAL_KO2IBLND = "xyes")
1368 AM_CONDITIONAL(BUILT_IN_KO2IBLND, test x$BUILT_IN_KO2IBLND = "xyes")
1369 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
1370 AM_CONDITIONAL(BUILD_KFILND, test x$KFILND = "xkfilnd")
1371 ]) # LN_CONDITIONALS
1376 # files that should be generated with AC_OUTPUT
1378 AC_DEFUN([LN_CONFIG_FILES], [
1382 lnet/autoconf/Makefile
1384 lnet/include/Makefile
1385 lnet/include/lnet/Makefile
1386 lnet/include/uapi/linux/lnet/Makefile
1388 lnet/klnds/autoMakefile
1389 lnet/klnds/o2iblnd/Makefile
1390 lnet/klnds/o2iblnd/autoMakefile
1391 lnet/klnds/in-kernel-o2iblnd/Makefile
1392 lnet/klnds/in-kernel-o2iblnd/autoMakefile
1393 lnet/klnds/gnilnd/Makefile
1394 lnet/klnds/gnilnd/autoMakefile
1395 lnet/klnds/socklnd/Makefile
1396 lnet/klnds/socklnd/autoMakefile
1397 lnet/klnds/kfilnd/Makefile
1398 lnet/klnds/kfilnd/autoMakefile
1400 lnet/lnet/autoMakefile
1401 lnet/selftest/Makefile
1402 lnet/selftest/autoMakefile
1404 lnet/utils/lnetconfig/Makefile
1406 ]) # LN_CONFIG_FILES