4 # Check compiler version
6 AC_DEFUN([LN_CHECK_GCC_VERSION], [
7 AC_MSG_CHECKING([compiler version])
8 PTL_CC_VERSION=`$CC --version | awk '/^gcc/{print $ 3}'`
9 PTL_MIN_CC_VERSION="3.2.2"
11 awk -F. '{printf "%d\n", (($ 1)*100+($ 2))*100+($ 3)}'
13 if test -z "$PTL_CC_VERSION" -o \
14 $(echo $PTL_CC_VERSION | v2n) -ge $(echo $PTL_MIN_CC_VERSION | v2n); then
17 AC_MSG_RESULT([Buggy compiler found])
18 AC_MSG_ERROR([Need gcc version >= $PTL_MIN_CC_VERSION])
20 ]) # LN_CHECK_GCC_VERSION
25 # check if cpu affinity is available/wanted
27 AC_DEFUN([LN_CONFIG_AFFINITY], [
28 AC_MSG_CHECKING([whether to enable CPU affinity support])
29 AC_ARG_ENABLE([affinity],
30 AC_HELP_STRING([--disable-affinity],
31 [disable process/irq affinity]),
32 [], [enable_affinity="yes"])
33 AC_MSG_RESULT([$enable_affinity])
34 AS_IF([test "x$enable_affinity" = xyes], [
35 LB_CHECK_COMPILE([if Linux kernel has cpu affinity support],
36 set_cpus_allowed_ptr, [
37 #include <linux/sched.h>
39 struct task_struct *t;
45 set_cpus_allowed_ptr(t, &m);
47 AC_DEFINE(CPU_AFFINITY, 1,
48 [kernel has cpu affinity support])
51 ]) # LN_CONFIG_AFFINITY
56 # check if tunable tcp backoff is available/wanted
58 AC_DEFUN([LN_CONFIG_BACKOFF], [
59 AC_MSG_CHECKING([whether to enable tunable backoff TCP support])
60 AC_ARG_ENABLE([backoff],
61 AC_HELP_STRING([--disable-backoff],
62 [disable socknal tunable backoff]),
63 [], [enable_backoff="yes"])
64 AC_MSG_RESULT([$enable_backoff])
65 AS_IF([test "x$enable_backoff" = xyes], [
66 AC_MSG_CHECKING([if Linux kernel has tunable backoff TCP support])
67 AS_IF([grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h >/dev/null], [
69 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
70 AS_IF([grep rto_max $LINUX/include/linux/tcp.h | grep -q __u16 >/dev/null],
71 [AC_DEFINE(SOCKNAL_BACKOFF_MS, 1,
72 [tunable backoff TCP in ms])])
77 ]) # LN_CONFIG_BACKOFF
84 # fail to build if libyaml is not installed
86 AC_DEFUN([LN_CONFIG_DLC], [
87 AC_CHECK_LIB([yaml], [yaml_parser_initialize],
89 [AC_MSG_ERROR([YAML development libraries not not installed])],
96 # If current OFED installed (assume with "ofed_info") and devel
97 # headers are not found, error because we assume OFED infiniband
98 # driver needs to be used and we must configure/build with it.
99 # Current OFED headers detection mechanism allow for non-standard
100 # prefix but relies on "ofed_info" command and on "%prefix/openib"
101 # link (both are ok for 1.5.x and 3.x versions), and should work
102 # for both source and DKMS builds.
104 AC_DEFUN([LN_CONFIG_O2IB], [
105 AC_MSG_CHECKING([whether to use Compat RDMA])
107 AC_HELP_STRING([--with-o2ib=[yes|no|<path>]],
108 [build o2iblnd against path]),
109 [], [with_o2ib="yes"])
112 yes) AS_IF([which ofed_info 2>/dev/null], [
113 AS_IF([test x$uses_dpkg = xyes], [
114 OFED_INFO="ofed_info | awk '{print \[$]2}'"
115 LSPKG="dpkg --listfiles"
117 OFED_INFO="ofed_info"
120 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\)$' | head -n1)
121 AS_IF([test -z "$O2IBPATHS"], [
123 You seem to have an OFED installed but have not installed it's devel package.
124 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
125 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.
128 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
130 It appears that you have multiple OFED versions installed.
131 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.
132 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.
137 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
143 *) O2IBPATHS=$with_o2ib
144 ENABLEO2IB="withpath"
149 AS_IF([test $ENABLEO2IB = "no"], [
153 for O2IBPATH in $O2IBPATHS; do
154 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
155 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
156 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
157 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \)], [
162 if ! $o2ib_found; then
165 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
166 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
167 *) AC_MSG_ERROR([internal error]) ;;
171 compatrdma_found=false
172 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
174 compatrdma_found=true
175 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
176 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
177 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
178 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
183 if ! $compatrdma_found; then
184 if test -f "$O2IBPATH/config.mk"; then
185 . "$O2IBPATH/config.mk"
186 elif test -f "$O2IBPATH/ofed_patch.mk"; then
187 . "$O2IBPATH/ofed_patch.mk"
189 elif test -z "$COMPAT_AUTOCONF"; then
191 if test "x$RHEL_KERNEL" = xyes; then
192 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
193 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
194 while test "$I" -ge 0; do
195 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
198 elif test "x$SUSE_KERNEL" = xyes; then
199 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
200 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
204 AC_MSG_CHECKING([whether to use any OFED backport headers])
205 if test -n "$BACKPORT_INCLUDES"; then
207 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
208 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
214 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
215 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include -I$O2IBPATH/include/uapi"
216 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
217 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
218 openib_gen2_support, [
219 #ifdef HAVE_COMPAT_RDMA
221 #undef PACKAGE_TARNAME
222 #undef PACKAGE_VERSION
223 #undef PACKAGE_STRING
224 #undef PACKAGE_BUGREPORT
226 #include <linux/compat-2.6.h>
228 #include <linux/version.h>
229 #include <linux/pci.h>
230 #include <linux/gfp.h>
231 #include <rdma/rdma_cm.h>
232 #include <rdma/ib_cm.h>
233 #include <rdma/ib_verbs.h>
234 #include <rdma/ib_fmr_pool.h>
236 struct rdma_cm_id *cm_idi __attribute__ ((unused));
237 struct rdma_conn_param conn_param __attribute__ ((unused));
238 struct ib_device_attr device_attr __attribute__ ((unused));
239 struct ib_qp_attr qp_attr __attribute__ ((unused));
240 struct ib_pool_fmr pool_fmr __attribute__ ((unused));
241 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
242 rdma_destroy_id(NULL);
247 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
248 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
249 *) AC_MSG_ERROR([internal error]) ;;
252 # we know at this point that the found OFED source is good
254 if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
255 # OFED default rpm not handle sles10 Modules.symvers name
256 for name in Module.symvers Modules.symvers; do
257 if test -f $O2IBPATH/$name; then
262 if test -n "$O2IB_SYMVER"; then
263 AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to Symbol Path])
264 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IBPATH/$O2IB_SYMVER"
265 AC_SUBST(EXTRA_SYMBOLS)
267 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
271 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
272 linux_kthread_worker, [
273 #ifdef HAVE_COMPAT_RDMA
275 #undef PACKAGE_TARNAME
276 #undef PACKAGE_VERSION
277 #undef PACKAGE_STRING
278 #undef PACKAGE_BUGREPORT
280 #include <linux/compat-2.6.h>
282 #include <linux/kthread.h>
284 struct kthread_work *kth_wrk __attribute__ ((unused));
285 flush_kthread_work(kth_wrk);
287 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
288 if test -z "$COMPAT_AUTOCONF"; then
289 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
292 EXTRA_CHECK_INCLUDE=""
295 AC_SUBST(EXTRA_OFED_CONFIG)
296 AC_SUBST(EXTRA_OFED_INCLUDE)
301 AS_IF([test $ENABLEO2IB != "no"], [
302 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
304 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
305 LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
306 rdma_create_id_4args, [
307 #ifdef HAVE_COMPAT_RDMA
309 #undef PACKAGE_TARNAME
310 #undef PACKAGE_VERSION
311 #undef PACKAGE_STRING
312 #undef PACKAGE_BUGREPORT
314 #include <linux/compat-2.6.h>
316 #include <rdma/rdma_cm.h>
318 rdma_create_id(NULL, NULL, 0, 0);
320 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
321 [rdma_create_id wants 4 args])
324 # 4.4 added network namespace parameter for rdma_create_id()
325 LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
326 rdma_create_id_5args, [
327 #ifdef HAVE_COMPAT_RDMA
329 #undef PACKAGE_TARNAME
330 #undef PACKAGE_VERSION
331 #undef PACKAGE_STRING
332 #undef PACKAGE_BUGREPORT
334 #include <linux/compat-2.6.h>
336 #include <rdma/rdma_cm.h>
338 rdma_create_id(NULL, NULL, NULL, 0, 0);
340 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
341 [rdma_create_id wants 5 args])
344 # 4.2 introduced struct ib_cq_init_attr which is used
345 # by ib_create_cq(). Note some OFED stacks only keep
346 # their headers in sync with latest kernels but not
347 # the functionality which means for infiniband testing
348 # we need to always test functionality testings.
349 LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
351 #ifdef HAVE_COMPAT_RDMA
353 #undef PACKAGE_TARNAME
354 #undef PACKAGE_VERSION
355 #undef PACKAGE_STRING
356 #undef PACKAGE_BUGREPORT
358 #include <linux/compat-2.6.h>
360 #include <rdma/ib_verbs.h>
362 struct ib_cq_init_attr cq_attr;
364 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
366 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
367 [struct ib_cq_init_attr is used by ib_create_cq])
370 # 4.3 removed ib_alloc_fast_reg_mr()
371 LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
372 ib_alloc_fast_reg_mr, [
373 #ifdef HAVE_COMPAT_RDMA
375 #undef PACKAGE_TARNAME
376 #undef PACKAGE_VERSION
377 #undef PACKAGE_STRING
378 #undef PACKAGE_BUGREPORT
380 #include <linux/compat-2.6.h>
382 #include <rdma/ib_verbs.h>
384 ib_alloc_fast_reg_mr(NULL, 0);
386 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
387 [ib_alloc_fast_reg_mr is defined])
390 # 4.9 must stop using ib_get_dma_mr and the global MR
391 # We then have to use FMR/Fastreg for all RDMA.
392 LB_CHECK_COMPILE([if 'ib_get_dma_mr' exists],
394 #ifdef HAVE_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/ib_verbs.h>
405 ib_get_dma_mr(NULL, 0);
407 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
408 [ib_get_dma_mr is defined])
411 # In v4.4 Linux kernel,
412 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
413 # split up struct ib_send_wr so that all non-trivial verbs
414 # use their own structure which embedds struct ib_send_wr.
415 LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
417 #ifdef HAVE_COMPAT_RDMA
419 #undef PACKAGE_TARNAME
420 #undef PACKAGE_VERSION
421 #undef PACKAGE_STRING
422 #undef PACKAGE_BUGREPORT
424 #include <linux/compat-2.6.h>
426 #include <rdma/ib_verbs.h>
428 struct ib_rdma_wr *wr __attribute__ ((unused));
432 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
433 [struct ib_rdma_wr is defined])
436 # new fast registration API introduced in 4.4
437 LB_CHECK_COMPILE([if 4arg 'ib_map_mr_sg' exists],
438 ib_map_mr_sg_4args, [
439 #ifdef HAVE_COMPAT_RDMA
441 #undef PACKAGE_TARNAME
442 #undef PACKAGE_VERSION
443 #undef PACKAGE_STRING
444 #undef PACKAGE_BUGREPORT
446 #include <linux/compat-2.6.h>
448 #include <rdma/ib_verbs.h>
450 ib_map_mr_sg(NULL, NULL, 0, 0);
452 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
453 [ib_map_mr_sg exists])
456 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
457 # in kernel 4.7 (and RHEL 7.3)
458 LB_CHECK_COMPILE([if 5arg 'ib_map_mr_sg' exists],
459 ib_map_mr_sg_5args, [
460 #ifdef HAVE_COMPAT_RDMA
462 #undef PACKAGE_TARNAME
463 #undef PACKAGE_VERSION
464 #undef PACKAGE_STRING
465 #undef PACKAGE_BUGREPORT
467 #include <linux/compat-2.6.h>
469 #include <rdma/ib_verbs.h>
471 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
473 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
474 [ib_map_mr_sg exists])
475 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
476 [ib_map_mr_sg has 5 arguments])
479 # ib_query_device() removed in 4.5
480 LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
482 #ifdef HAVE_COMPAT_RDMA
484 #undef PACKAGE_TARNAME
485 #undef PACKAGE_VERSION
486 #undef PACKAGE_STRING
487 #undef PACKAGE_BUGREPORT
489 #include <linux/compat-2.6.h>
491 #include <rdma/ib_verbs.h>
493 struct ib_device dev;
494 struct ib_device_attr dev_attr = {};
495 dev.attrs = dev_attr;
497 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
498 [struct ib_device.attrs is defined])
501 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
502 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
503 LB_CHECK_COMPILE([if 2arg 'ib_alloc_pd' exists],
505 #ifdef HAVE_COMPAT_RDMA
507 #undef PACKAGE_TARNAME
508 #undef PACKAGE_VERSION
509 #undef PACKAGE_STRING
510 #undef PACKAGE_BUGREPORT
512 #include <linux/compat-2.6.h>
514 #include <rdma/ib_verbs.h>
516 ib_alloc_pd(NULL, 0);
518 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
519 [ib_alloc_pd has 2 arguments])
522 LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
524 #ifdef HAVE_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 (void)ib_inc_rkey(0);
537 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
538 [function ib_inc_rkey exist])
541 EXTRA_CHECK_INCLUDE=""
542 ]) # ENABLEO2IB != "no"
548 # check whether to use the Gemini Network Interface lnd
550 AC_DEFUN([LN_CONFIG_GNILND], [
551 AC_MSG_CHECKING([whether to enable GNI lnd])
553 AC_HELP_STRING([--enable-gni],
555 [], [enable_gni="no"])
556 AC_MSG_RESULT([$enable_gni])
558 AS_IF([test "x$enable_gni" = xyes], [
559 # GNICPPFLAGS was set in spec file
560 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
561 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
562 LB_CHECK_COMPILE([if GNI kernel headers are present],
564 #include <linux/types.h>
567 gni_cdm_handle_t kgni_domain;
570 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
571 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
576 AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
578 # at this point, we have gnilnd basic support,
579 # now check for extra features
580 LB_CHECK_COMPILE([to use RCA in gnilnd],
582 #include <linux/types.h>
584 #include <krca_lib.h>
586 gni_cdm_handle_t kgni_domain;
588 krca_ticket_t ticket = KRCA_NULL_TICKET;
590 __u32 nid = 0, nic_addr;
591 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
592 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
593 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
594 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
597 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
599 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
601 AC_SUBST(GNICPPFLAGS)
603 ]) # LN_CONFIG_GNILND
608 # 2.6.35 kernel has sk_sleep function
610 AC_DEFUN([LN_CONFIG_SK_SLEEP], [
611 LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
613 #include <net/sock.h>
617 AC_DEFINE(HAVE_SK_SLEEP, 1,
618 [kernel has sk_sleep])
620 ]) # LN_CONFIG_SK_SLEEP
623 # LN_CONFIG_TCP_SENDPAGE
625 # 2.6.36 tcp_sendpage() first parameter is 'struct sock'
626 # instead of 'struct socket'.
628 AC_DEFUN([LN_CONFIG_TCP_SENDPAGE], [
629 tmp_flags="$EXTRA_KCFLAGS"
630 EXTRA_KCFLAGS="-Werror"
631 LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
632 tcp_sendpage_socket, [
633 #include <linux/net.h>
636 tcp_sendpage((struct socket*)0, NULL, 0, 0, 0);
638 AC_DEFINE(HAVE_TCP_SENDPAGE_USE_SOCKET, 1,
639 [tcp_sendpage use socket as first parameter])
641 EXTRA_KCFLAGS="$tmp_flags"
642 ]) # LN_CONFIG_TCP_SENDPAGE
644 # LN_CONFIG_SOCK_CREATE_KERN
646 # 4.x sock_create_kern() added a first parameter as 'struct net *'
649 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
650 tmp_flags="$EXTRA_KCFLAGS"
651 EXTRA_KCFLAGS="-Werror"
652 LB_CHECK_COMPILE([if 'sock_create_kern' first parameter is net],
653 sock_create_kern_net, [
654 #include <linux/net.h>
655 #include <net/net_namespace.h>
657 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
659 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
660 [sock_create_kern use net as first parameter])
662 EXTRA_KCFLAGS="$tmp_flags"
663 ]) # LN_CONFIG_SOCK_CREATE_KERN
666 # LN_CONFIG_SK_DATA_READY
668 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
670 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
671 tmp_flags="$EXTRA_KCFLAGS"
672 EXTRA_KCFLAGS="-Werror"
673 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
675 #include <linux/net.h>
676 #include <net/sock.h>
678 ((struct sock *)0)->sk_data_ready(NULL);
680 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
681 [sk_data_ready uses only one argument])
683 EXTRA_KCFLAGS="$tmp_flags"
684 ]) # LN_CONFIG_SK_DATA_READY
687 # LN_EXPORT_KMAP_TO_PAGE
689 # 3.10 Export kmap_to_page
691 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
692 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
693 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
694 [kmap_to_page is exported by the kernel])])
695 ]) # LN_EXPORT_KMAP_TO_PAG
698 # LN_CONFIG_SOCK_ACCEPT
700 # 4.11 commit cdfbabfb2f0ce983fdaa42f20e5f7842178fc01e added a flag
701 # to handle a possible lockdep condition kernel socket accept.
703 AC_DEFUN([LN_CONFIG_SOCK_ACCEPT], [
704 tmp_flags="$EXTRA_KCFLAGS"
705 EXTRA_KCFLAGS="-Werror"
706 LB_CHECK_COMPILE([if 'struct sock' accept function requires a bool argument],
708 #include <linux/net.h>
710 ((struct socket *)0)->ops->accept(NULL, NULL, O_NONBLOCK, false);
712 AC_DEFINE(HAVE_KERN_SOCK_ACCEPT_FLAG_ARG, 1,
713 ['struct sock' accept function requires bool argument])
715 EXTRA_KCFLAGS="$tmp_flags"
716 ]) # LN_CONFIG_SOCK_ACCEPT
721 # LNet linux kernel checks
723 AC_DEFUN([LN_PROG_LINUX], [
724 AC_MSG_NOTICE([LNet kernel checks
725 ==============================================================================])
734 LN_CONFIG_TCP_SENDPAGE
736 LN_EXPORT_KMAP_TO_PAGE
738 LN_CONFIG_SK_DATA_READY
740 LN_CONFIG_SOCK_CREATE_KERN
742 LN_CONFIG_SOCK_ACCEPT
748 # default paths for installed files
750 AC_DEFUN([LN_PATH_DEFAULTS], [
751 ]) # LN_PATH_DEFAULTS
756 # other configure checks
758 AC_DEFUN([LN_CONFIGURE], [
759 AC_MSG_NOTICE([LNet core checks
760 ==============================================================================])
762 # lnet/utils/portals.c
763 AC_CHECK_HEADERS([netdb.h])
764 AC_CHECK_FUNCS([gethostbyname])
766 # lnet/utils/wirecheck.c
767 AC_CHECK_FUNCS([strnlen])
769 # -------- Check for required packages --------------
771 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
772 AC_ARG_ENABLE(efence,
773 AC_HELP_STRING([--enable-efence],
774 [use efence library]),
775 [], [enable_efence="no"])
776 AC_MSG_RESULT([$enable_efence])
779 AS_IF([test "$enable_efence" = yes], [
781 AC_DEFINE(HAVE_LIBEFENCE, 1,
782 [libefence support is requested])
792 # AM_CONDITIONAL defines for lnet
794 AC_DEFUN([LN_CONDITIONALS], [
795 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
796 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
802 # files that should be generated with AC_OUTPUT
804 AC_DEFUN([LN_CONFIG_FILES], [
808 lnet/autoconf/Makefile
810 lnet/include/Makefile
811 lnet/include/lnet/Makefile
812 lnet/include/uapi/linux/lnet/Makefile
814 lnet/klnds/autoMakefile
815 lnet/klnds/o2iblnd/Makefile
816 lnet/klnds/o2iblnd/autoMakefile
817 lnet/klnds/gnilnd/Makefile
818 lnet/klnds/gnilnd/autoMakefile
819 lnet/klnds/socklnd/Makefile
820 lnet/klnds/socklnd/autoMakefile
822 lnet/lnet/autoMakefile
823 lnet/selftest/Makefile
824 lnet/selftest/autoMakefile
826 lnet/utils/lnetconfig/Makefile