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 AC_HELP_STRING([--disable-backoff],
9 [disable socknal tunable backoff]),
10 [], [enable_backoff="yes"])
11 AC_MSG_RESULT([$enable_backoff])
12 AS_IF([test "x$enable_backoff" = xyes], [
13 AC_MSG_CHECKING([if Linux kernel has tunable backoff TCP support])
14 AS_IF([grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h >/dev/null], [
16 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
17 AS_IF([grep rto_max $LINUX/include/linux/tcp.h | grep -q __u16 >/dev/null],
18 [AC_DEFINE(SOCKNAL_BACKOFF_MS, 1,
19 [tunable backoff TCP in ms])])
24 ]) # LN_CONFIG_BACKOFF
31 # fail to build if libyaml is not installed
33 AC_DEFUN([LN_CONFIG_DLC], [
34 AS_IF([test "x$enable_dist" = xno], [
35 AC_CHECK_LIB([yaml], [yaml_parser_initialize],
37 [AC_MSG_ERROR([YAML development libraries not not installed])],
45 # If current OFED installed (assume with "ofed_info") and devel
46 # headers are not found, error because we assume OFED infiniband
47 # driver needs to be used and we must configure/build with it.
48 # Current OFED headers detection mechanism allow for non-standard
49 # prefix but relies on "ofed_info" command and on "%prefix/openib"
50 # link (both are ok for 1.5.x and 3.x versions), and should work
51 # for both source and DKMS builds.
53 AC_DEFUN([LN_CONFIG_O2IB], [
54 AC_MSG_CHECKING([whether to use Compat RDMA])
56 AC_HELP_STRING([--with-o2ib=[yes|no|<path>]],
57 [build o2iblnd against path]),
58 [], [with_o2ib="yes"])
61 yes) AS_IF([which ofed_info 2>/dev/null], [
62 AS_IF([test x$uses_dpkg = xyes], [
63 OFED_INFO="ofed_info | awk '{print \[$]2}'"
64 LSPKG="dpkg --listfiles"
69 O2IBPATHS=$(eval $OFED_INFO | egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | xargs $LSPKG | grep '\(/openib\|/ofa_kernel/default\|/ofa_kernel\)$' | head -n1)
70 AS_IF([test -z "$O2IBPATHS"], [
72 You seem to have an OFED installed but have not installed it's devel package.
73 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
74 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.
77 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
79 It appears that you have multiple OFED versions installed.
80 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.
81 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.
84 if test -e $O2IBPATHS/${LINUXRELEASE}; then
85 O2IBPATHS=$O2IBPATHS/${LINUXRELEASE}
86 elif test -e $O2IBPATHS/default; then
87 O2IBPATHS=$O2IBPATHS/default
91 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
97 *) O2IBPATHS=$with_o2ib
103 AS_IF([test $ENABLEO2IB = "no"], [
107 for O2IBPATH in $O2IBPATHS; do
108 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
109 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
110 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
111 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \)], [
116 if ! $o2ib_found; then
119 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
120 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
121 *) AC_MSG_ERROR([internal error]) ;;
125 compatrdma_found=false
126 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
128 compatrdma_found=true
129 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
130 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
131 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
132 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
137 if ! $compatrdma_found; then
138 if test -f "$O2IBPATH/config.mk"; then
139 . "$O2IBPATH/config.mk"
140 elif test -f "$O2IBPATH/ofed_patch.mk"; then
141 . "$O2IBPATH/ofed_patch.mk"
143 elif test -z "$COMPAT_AUTOCONF"; then
145 if test "x$RHEL_KERNEL" = xyes; then
146 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
147 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
148 while test "$I" -ge 0; do
149 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
152 elif test "x$SUSE_KERNEL" = xyes; then
153 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
154 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
158 AC_MSG_CHECKING([whether to use any OFED backport headers])
159 if test -n "$BACKPORT_INCLUDES"; then
161 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
162 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
168 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
169 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include -I$O2IBPATH/include/uapi"
170 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
171 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
172 openib_gen2_support, [
173 #ifdef HAVE_COMPAT_RDMA
175 #undef PACKAGE_TARNAME
176 #undef PACKAGE_VERSION
177 #undef PACKAGE_STRING
178 #undef PACKAGE_BUGREPORT
180 #include <linux/compat-2.6.h>
182 #include <linux/version.h>
183 #include <linux/pci.h>
184 #include <linux/gfp.h>
185 #include <rdma/rdma_cm.h>
186 #include <rdma/ib_cm.h>
187 #include <rdma/ib_verbs.h>
188 #include <rdma/ib_fmr_pool.h>
190 struct rdma_cm_id *cm_idi __attribute__ ((unused));
191 struct rdma_conn_param conn_param __attribute__ ((unused));
192 struct ib_device_attr device_attr __attribute__ ((unused));
193 struct ib_qp_attr qp_attr __attribute__ ((unused));
194 struct ib_pool_fmr pool_fmr __attribute__ ((unused));
195 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
196 rdma_destroy_id(NULL);
201 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
202 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
203 *) AC_MSG_ERROR([internal error]) ;;
206 # we know at this point that the found OFED source is good
208 if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
209 if test -f $O2IBPATH/Module.symvers; then
210 O2IB_SYMVER=$O2IBPATH/Module.symvers;
213 if test -n "$O2IB_SYMVER"; then
214 AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
215 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
216 AC_SUBST(EXTRA_SYMBOLS)
218 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
222 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
223 linux_kthread_worker, [
224 #ifdef HAVE_COMPAT_RDMA
226 #undef PACKAGE_TARNAME
227 #undef PACKAGE_VERSION
228 #undef PACKAGE_STRING
229 #undef PACKAGE_BUGREPORT
231 #include <linux/compat-2.6.h>
233 #include <linux/kthread.h>
235 struct kthread_work *kth_wrk = NULL;
236 flush_kthread_work(kth_wrk);
238 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
239 if test -z "$COMPAT_AUTOCONF"; then
240 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
243 EXTRA_CHECK_INCLUDE=""
246 AC_SUBST(EXTRA_OFED_CONFIG)
247 AC_SUBST(EXTRA_OFED_INCLUDE)
252 AS_IF([test $ENABLEO2IB != "no"], [
253 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
255 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
256 LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
257 rdma_create_id_4args, [
258 #ifdef HAVE_COMPAT_RDMA
260 #undef PACKAGE_TARNAME
261 #undef PACKAGE_VERSION
262 #undef PACKAGE_STRING
263 #undef PACKAGE_BUGREPORT
265 #include <linux/compat-2.6.h>
267 #include <rdma/rdma_cm.h>
269 rdma_create_id(NULL, NULL, 0, 0);
271 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
272 [rdma_create_id wants 4 args])
275 # 4.4 added network namespace parameter for rdma_create_id()
276 LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
277 rdma_create_id_5args, [
278 #ifdef HAVE_COMPAT_RDMA
280 #undef PACKAGE_TARNAME
281 #undef PACKAGE_VERSION
282 #undef PACKAGE_STRING
283 #undef PACKAGE_BUGREPORT
285 #include <linux/compat-2.6.h>
287 #include <rdma/rdma_cm.h>
289 rdma_create_id(NULL, NULL, NULL, 0, 0);
291 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
292 [rdma_create_id wants 5 args])
295 # 4.2 introduced struct ib_cq_init_attr which is used
296 # by ib_create_cq(). Note some OFED stacks only keep
297 # their headers in sync with latest kernels but not
298 # the functionality which means for infiniband testing
299 # we need to always test functionality testings.
300 LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
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/ib_verbs.h>
313 struct ib_cq_init_attr cq_attr;
315 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
317 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
318 [struct ib_cq_init_attr is used by ib_create_cq])
321 # 4.3 removed ib_alloc_fast_reg_mr()
322 LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
323 ib_alloc_fast_reg_mr, [
324 #ifdef HAVE_COMPAT_RDMA
326 #undef PACKAGE_TARNAME
327 #undef PACKAGE_VERSION
328 #undef PACKAGE_STRING
329 #undef PACKAGE_BUGREPORT
331 #include <linux/compat-2.6.h>
333 #include <rdma/ib_verbs.h>
335 ib_alloc_fast_reg_mr(NULL, 0);
337 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
338 [ib_alloc_fast_reg_mr is defined])
341 # 4.9 must stop using ib_get_dma_mr and the global MR
342 # We then have to use FMR/Fastreg for all RDMA.
343 LB_CHECK_COMPILE([if 'ib_get_dma_mr' exists],
345 #ifdef HAVE_COMPAT_RDMA
347 #undef PACKAGE_TARNAME
348 #undef PACKAGE_VERSION
349 #undef PACKAGE_STRING
350 #undef PACKAGE_BUGREPORT
352 #include <linux/compat-2.6.h>
354 #include <rdma/ib_verbs.h>
356 ib_get_dma_mr(NULL, 0);
358 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
359 [ib_get_dma_mr is defined])
362 # In v4.4 Linux kernel,
363 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
364 # split up struct ib_send_wr so that all non-trivial verbs
365 # use their own structure which embedds struct ib_send_wr.
366 LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
368 #ifdef HAVE_COMPAT_RDMA
370 #undef PACKAGE_TARNAME
371 #undef PACKAGE_VERSION
372 #undef PACKAGE_STRING
373 #undef PACKAGE_BUGREPORT
375 #include <linux/compat-2.6.h>
377 #include <rdma/ib_verbs.h>
379 struct ib_rdma_wr *wr __attribute__ ((unused));
383 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
384 [struct ib_rdma_wr is defined])
387 # new fast registration API introduced in 4.4
388 LB_CHECK_COMPILE([if 4arg 'ib_map_mr_sg' exists],
389 ib_map_mr_sg_4args, [
390 #ifdef HAVE_COMPAT_RDMA
392 #undef PACKAGE_TARNAME
393 #undef PACKAGE_VERSION
394 #undef PACKAGE_STRING
395 #undef PACKAGE_BUGREPORT
397 #include <linux/compat-2.6.h>
399 #include <rdma/ib_verbs.h>
401 ib_map_mr_sg(NULL, NULL, 0, 0);
403 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
404 [ib_map_mr_sg exists])
407 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
408 # in kernel 4.7 (and RHEL 7.3)
409 LB_CHECK_COMPILE([if 5arg 'ib_map_mr_sg' exists],
410 ib_map_mr_sg_5args, [
411 #ifdef HAVE_COMPAT_RDMA
413 #undef PACKAGE_TARNAME
414 #undef PACKAGE_VERSION
415 #undef PACKAGE_STRING
416 #undef PACKAGE_BUGREPORT
418 #include <linux/compat-2.6.h>
420 #include <rdma/ib_verbs.h>
422 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
424 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
425 [ib_map_mr_sg exists])
426 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
427 [ib_map_mr_sg has 5 arguments])
430 # ib_query_device() removed in 4.5
431 LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
433 #ifdef HAVE_COMPAT_RDMA
435 #undef PACKAGE_TARNAME
436 #undef PACKAGE_VERSION
437 #undef PACKAGE_STRING
438 #undef PACKAGE_BUGREPORT
440 #include <linux/compat-2.6.h>
442 #include <rdma/ib_verbs.h>
444 struct ib_device dev;
445 struct ib_device_attr dev_attr = {};
446 dev.attrs = dev_attr;
448 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
449 [struct ib_device.attrs is defined])
452 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
453 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
454 LB_CHECK_COMPILE([if 2arg 'ib_alloc_pd' exists],
456 #ifdef HAVE_COMPAT_RDMA
458 #undef PACKAGE_TARNAME
459 #undef PACKAGE_VERSION
460 #undef PACKAGE_STRING
461 #undef PACKAGE_BUGREPORT
463 #include <linux/compat-2.6.h>
465 #include <rdma/ib_verbs.h>
467 ib_alloc_pd(NULL, 0);
469 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
470 [ib_alloc_pd has 2 arguments])
473 LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
475 #ifdef HAVE_COMPAT_RDMA
477 #undef PACKAGE_TARNAME
478 #undef PACKAGE_VERSION
479 #undef PACKAGE_STRING
480 #undef PACKAGE_BUGREPORT
482 #include <linux/compat-2.6.h>
484 #include <rdma/ib_verbs.h>
486 (void)ib_inc_rkey(0);
488 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
489 [function ib_inc_rkey exist])
492 # In MOFED 4.6, the second and third parameters for
493 # ib_post_send() and ib_post_recv() are declared with
495 tmp_flags="$EXTRA_KCFLAGS"
496 EXTRA_KCFLAGS="-Werror"
497 LB_CHECK_COMPILE([if 'ib_post_send() and ib_post_recv()' have const parameters],
498 ib_post_send_recv_const, [
499 #ifdef HAVE_COMPAT_RDMA
501 #undef PACKAGE_TARNAME
502 #undef PACKAGE_VERSION
503 #undef PACKAGE_STRING
504 #undef PACKAGE_BUGREPORT
506 #include <linux/compat-2.6.h>
508 #include <rdma/ib_verbs.h>
510 ib_post_send(NULL, (const struct ib_send_wr *)NULL,
511 (const struct ib_send_wr **)NULL);
513 AC_DEFINE(HAVE_IB_POST_SEND_RECV_CONST, 1,
514 [ib_post_send and ib_post_recv have const parameters])
516 EXTRA_KCFLAGS="$tmp_flags"
519 LN_IB_DEVICE_OPS_EXISTS
521 LN_IB_SG_DMA_ADDRESS_EXISTS
523 EXTRA_CHECK_INCLUDE=""
524 ]) # ENABLEO2IB != "no"
530 # check whether to use the Gemini Network Interface lnd
532 AC_DEFUN([LN_CONFIG_GNILND], [
533 AC_MSG_CHECKING([whether to enable GNI lnd])
535 AC_HELP_STRING([--enable-gni],
537 [], [enable_gni="no"])
538 AC_MSG_RESULT([$enable_gni])
540 AS_IF([test "x$enable_gni" = xyes], [
541 # GNICPPFLAGS was set in spec file
542 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
543 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
544 LB_CHECK_COMPILE([if GNI kernel headers are present],
546 #include <linux/types.h>
549 gni_cdm_handle_t kgni_domain;
552 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
553 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
558 AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
560 # at this point, we have gnilnd basic support,
561 # now check for extra features
562 LB_CHECK_COMPILE([to use RCA in gnilnd],
564 #include <linux/types.h>
566 #include <krca_lib.h>
568 gni_cdm_handle_t kgni_domain;
570 krca_ticket_t ticket = KRCA_NULL_TICKET;
572 __u32 nid = 0, nic_addr;
573 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
574 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
575 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
576 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
579 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
581 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
583 AC_SUBST(GNICPPFLAGS)
585 ]) # LN_CONFIG_GNILND
587 # LN_CONFIG_SOCK_CREATE_KERN
589 # 4.x sock_create_kern() added a first parameter as 'struct net *'
592 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
593 tmp_flags="$EXTRA_KCFLAGS"
594 EXTRA_KCFLAGS="-Werror"
595 LB_CHECK_COMPILE([if 'sock_create_kern' first parameter is net],
596 sock_create_kern_net, [
597 #include <linux/net.h>
598 #include <net/net_namespace.h>
600 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
602 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
603 [sock_create_kern use net as first parameter])
605 EXTRA_KCFLAGS="$tmp_flags"
606 ]) # LN_CONFIG_SOCK_CREATE_KERN
609 # LN_CONFIG_SK_DATA_READY
611 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
613 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
614 tmp_flags="$EXTRA_KCFLAGS"
615 EXTRA_KCFLAGS="-Werror"
616 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
618 #include <linux/net.h>
619 #include <net/sock.h>
621 ((struct sock *)0)->sk_data_ready(NULL);
623 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
624 [sk_data_ready uses only one argument])
626 EXTRA_KCFLAGS="$tmp_flags"
627 ]) # LN_CONFIG_SK_DATA_READY
630 # LN_EXPORT_KMAP_TO_PAGE
632 # 3.10 Export kmap_to_page
634 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
635 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
636 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
637 [kmap_to_page is exported by the kernel])])
638 ]) # LN_EXPORT_KMAP_TO_PAG
641 # LN_HAVE_HYPERVISOR_IS_TYPE
643 # 4.14 commit 79cc74155218316b9a5d28577c7077b2adba8e58
644 # x86/paravirt: Provide a way to check for hypervisors
646 AC_DEFUN([LN_HAVE_HYPERVISOR_IS_TYPE], [
647 tmp_flags="$EXTRA_KCFLAGS"
648 EXTRA_KCFLAGS="-Werror"
649 LB_CHECK_COMPILE([if hypervisor_is_type function is available],
650 hypervisor_is_type_exists, [
651 #include <asm/hypervisor.h>
653 (void)hypervisor_is_type(X86_HYPER_NATIVE);
655 AC_DEFINE(HAVE_HYPERVISOR_IS_TYPE, 1,
656 [hypervisor_is_type function exists])
658 EXTRA_KCFLAGS="$tmp_flags"
659 ]) # LN_HAVE_HYPERVISOR_IS_TYPE
662 # LN_HAVE_ORACLE_OFED_EXTENSIONS
666 AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [
667 LB_CHECK_COMPILE([if Oracle OFED Extensions are enabled],
669 #include <rdma/ib_fmr_pool.h>
671 struct ib_fmr_pool_param param = {
676 AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
677 [if Oracle OFED Extensions are enabled])
679 ]) # LN_HAVE_ORACLE_OFED_EXTENSIONS
682 # LN_CONFIG_SOCK_GETNAME
684 # 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
685 # does not take the length *int argument and returns the length
687 AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
688 tmp_flags="$EXTRA_KCFLAGS"
689 EXTRA_KCFLAGS="-Werror"
690 LB_CHECK_COMPILE([if 'getname' has two args],
691 kern_sock_getname_2args, [
692 #include <linux/net.h>
694 kernel_getsockname(NULL, NULL);
696 AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
697 ['getname' has two args])
699 EXTRA_KCFLAGS="$tmp_flags"
700 ]) # LN_CONFIG_SOCK_GETNAME
703 # LN_IB_DEVICE_OPS_EXISTS
705 # kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
706 # RDMA/core: Introduce ib_device_ops
707 # ... introduces the ib_device_ops structure that defines all the
708 # InfiniBand device operations in one place ...
710 AC_DEFUN([LN_IB_DEVICE_OPS_EXISTS], [
711 tmp_flags="$EXTRA_KCFLAGS"
712 EXTRA_KCFLAGS="-Werror"
713 LB_CHECK_COMPILE([if struct ib_device_ops is defined],
714 ib_device_ops_test, [
715 #include <rdma/ib_verbs.h>
717 int x = offsetof(struct ib_device_ops, unmap_fmr);
721 AC_DEFINE(HAVE_IB_DEVICE_OPS, 1,
722 [if struct ib_device_ops is defined])
724 EXTRA_KCFLAGS="$tmp_flags"
725 ]) # LN_IB_DEVICE_OPS_EXISTS
728 # LN_IB_SG_DMA_ADDRESS_EXISTS
730 # kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
731 # IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
732 # ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
734 AC_DEFUN([LN_IB_SG_DMA_ADDRESS_EXISTS], [
735 tmp_flags="$EXTRA_KCFLAGS"
736 EXTRA_KCFLAGS="-Werror"
737 LB_CHECK_COMPILE([if ib_sg_dma_address wrapper exists],
738 ib_sg_dma_address_test, [
739 #include <rdma/ib_verbs.h>
741 u64 x = ib_sg_dma_address(NULL, NULL);
745 AC_DEFINE(HAVE_IB_SG_DMA_ADDRESS, 1,
746 [if ib_sg_dma_address wrapper exists])
748 EXTRA_KCFLAGS="$tmp_flags"
749 ]) # LN_IB_SG_DMA_ADDRESS_EXISTS
754 # LNet linux kernel checks
756 AC_DEFUN([LN_PROG_LINUX], [
757 AC_MSG_NOTICE([LNet kernel checks
758 ==============================================================================])
764 LN_EXPORT_KMAP_TO_PAGE
766 LN_CONFIG_SK_DATA_READY
768 LN_CONFIG_SOCK_CREATE_KERN
770 LN_HAVE_HYPERVISOR_IS_TYPE
771 LN_HAVE_ORACLE_OFED_EXTENSIONS
773 LN_CONFIG_SOCK_GETNAME
779 # default paths for installed files
781 AC_DEFUN([LN_PATH_DEFAULTS], [
782 ]) # LN_PATH_DEFAULTS
787 # other configure checks
789 AC_DEFUN([LN_CONFIGURE], [
790 AC_MSG_NOTICE([LNet core checks
791 ==============================================================================])
793 # lnet/utils/portals.c
794 AC_CHECK_HEADERS([netdb.h])
795 AC_CHECK_FUNCS([gethostbyname])
797 # lnet/utils/wirecheck.c
798 AC_CHECK_FUNCS([strnlen])
800 # -------- Check for required packages --------------
802 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
803 AC_ARG_ENABLE(efence,
804 AC_HELP_STRING([--enable-efence],
805 [use efence library]),
806 [], [enable_efence="no"])
807 AC_MSG_RESULT([$enable_efence])
810 AS_IF([test "$enable_efence" = yes], [
812 AC_DEFINE(HAVE_LIBEFENCE, 1,
813 [libefence support is requested])
823 # AM_CONDITIONAL defines for lnet
825 AC_DEFUN([LN_CONDITIONALS], [
826 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
827 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
833 # files that should be generated with AC_OUTPUT
835 AC_DEFUN([LN_CONFIG_FILES], [
839 lnet/autoconf/Makefile
841 lnet/include/Makefile
842 lnet/include/lnet/Makefile
843 lnet/include/uapi/linux/lnet/Makefile
845 lnet/klnds/autoMakefile
846 lnet/klnds/o2iblnd/Makefile
847 lnet/klnds/o2iblnd/autoMakefile
848 lnet/klnds/gnilnd/Makefile
849 lnet/klnds/gnilnd/autoMakefile
850 lnet/klnds/socklnd/Makefile
851 lnet/klnds/socklnd/autoMakefile
853 lnet/lnet/autoMakefile
854 lnet/selftest/Makefile
855 lnet/selftest/autoMakefile
857 lnet/utils/lnetconfig/Makefile