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 = NULL;
42 set_cpus_allowed_ptr(t, &m);
44 AC_DEFINE(CPU_AFFINITY, 1,
45 [kernel has cpu affinity support])
48 ]) # LN_CONFIG_AFFINITY
53 # check if tunable tcp backoff is available/wanted
55 AC_DEFUN([LN_CONFIG_BACKOFF], [
56 AC_MSG_CHECKING([whether to enable tunable backoff TCP support])
57 AC_ARG_ENABLE([backoff],
58 AC_HELP_STRING([--disable-backoff],
59 [disable socknal tunable backoff]),
60 [], [enable_backoff="yes"])
61 AC_MSG_RESULT([$enable_backoff])
62 AS_IF([test "x$enable_backoff" = xyes], [
63 AC_MSG_CHECKING([if Linux kernel has tunable backoff TCP support])
64 AS_IF([grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h >/dev/null], [
66 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
67 AS_IF([grep rto_max $LINUX/include/linux/tcp.h | grep -q __u16 >/dev/null],
68 [AC_DEFINE(SOCKNAL_BACKOFF_MS, 1,
69 [tunable backoff TCP in ms])])
74 ]) # LN_CONFIG_BACKOFF
81 # fail to build if libyaml is not installed
83 AC_DEFUN([LN_CONFIG_DLC], [
84 AC_CHECK_LIB([yaml], [yaml_parser_initialize],
86 [AC_MSG_ERROR([YAML development libraries not not installed])],
93 # If current OFED installed (assume with "ofed_info") and devel
94 # headers are not found, error because we assume OFED infiniband
95 # driver needs to be used and we must configure/build with it.
96 # Current OFED headers detection mechanism allow for non-standard
97 # prefix but relies on "ofed_info" command and on "%prefix/openib"
98 # link (both are ok for 1.5.x and 3.x versions), and should work
99 # for both source and DKMS builds.
101 AC_DEFUN([LN_CONFIG_O2IB], [
102 AC_MSG_CHECKING([whether to use Compat RDMA])
104 AC_HELP_STRING([--with-o2ib=[yes|no|<path>]],
105 [build o2iblnd against path]),
106 [], [with_o2ib="yes"])
109 yes) AS_IF([which ofed_info 2>/dev/null], [
110 AS_IF([test x$uses_dpkg = xyes], [
111 OFED_INFO="ofed_info | awk '{print \[$]2}'"
112 LSPKG="dpkg --listfiles"
114 OFED_INFO="ofed_info"
117 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)
118 AS_IF([test -z "$O2IBPATHS"], [
120 You seem to have an OFED installed but have not installed it's devel package.
121 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
122 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.
125 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
127 It appears that you have multiple OFED versions installed.
128 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.
129 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.
134 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
140 *) O2IBPATHS=$with_o2ib
141 ENABLEO2IB="withpath"
146 AS_IF([test $ENABLEO2IB = "no"], [
150 for O2IBPATH in $O2IBPATHS; do
151 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
152 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
153 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
154 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \)], [
159 if ! $o2ib_found; then
162 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
163 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
164 *) AC_MSG_ERROR([internal error]) ;;
168 compatrdma_found=false
169 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
171 compatrdma_found=true
172 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
173 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
174 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
175 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
180 if ! $compatrdma_found; then
181 if test -f "$O2IBPATH/config.mk"; then
182 . "$O2IBPATH/config.mk"
183 elif test -f "$O2IBPATH/ofed_patch.mk"; then
184 . "$O2IBPATH/ofed_patch.mk"
186 elif test -z "$COMPAT_AUTOCONF"; then
188 if test "x$RHEL_KERNEL" = xyes; then
189 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
190 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
191 while test "$I" -ge 0; do
192 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
195 elif test "x$SUSE_KERNEL" = xyes; then
196 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
197 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
201 AC_MSG_CHECKING([whether to use any OFED backport headers])
202 if test -n "$BACKPORT_INCLUDES"; then
204 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
205 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
211 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
212 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include -I$O2IBPATH/include/uapi"
213 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
214 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
215 openib_gen2_support, [
216 #ifdef HAVE_COMPAT_RDMA
218 #undef PACKAGE_TARNAME
219 #undef PACKAGE_VERSION
220 #undef PACKAGE_STRING
221 #undef PACKAGE_BUGREPORT
223 #include <linux/compat-2.6.h>
225 #include <linux/version.h>
226 #include <linux/pci.h>
227 #include <linux/gfp.h>
228 #include <rdma/rdma_cm.h>
229 #include <rdma/ib_cm.h>
230 #include <rdma/ib_verbs.h>
231 #include <rdma/ib_fmr_pool.h>
233 struct rdma_cm_id *cm_idi __attribute__ ((unused));
234 struct rdma_conn_param conn_param __attribute__ ((unused));
235 struct ib_device_attr device_attr __attribute__ ((unused));
236 struct ib_qp_attr qp_attr __attribute__ ((unused));
237 struct ib_pool_fmr pool_fmr __attribute__ ((unused));
238 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
239 rdma_destroy_id(NULL);
244 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
245 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
246 *) AC_MSG_ERROR([internal error]) ;;
249 # we know at this point that the found OFED source is good
251 if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
252 # OFED default rpm not handle sles10 Modules.symvers name
253 for name in Module.symvers Modules.symvers; do
254 if test -f $O2IBPATH/$name; then
259 if test -n "$O2IB_SYMVER"; then
260 AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to Symbol Path])
261 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IBPATH/$O2IB_SYMVER"
262 AC_SUBST(EXTRA_SYMBOLS)
264 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
268 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
269 linux_kthread_worker, [
270 #ifdef HAVE_COMPAT_RDMA
272 #undef PACKAGE_TARNAME
273 #undef PACKAGE_VERSION
274 #undef PACKAGE_STRING
275 #undef PACKAGE_BUGREPORT
277 #include <linux/compat-2.6.h>
279 #include <linux/kthread.h>
281 struct kthread_work *kth_wrk = NULL;
282 flush_kthread_work(kth_wrk);
284 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
285 if test -z "$COMPAT_AUTOCONF"; then
286 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
289 EXTRA_CHECK_INCLUDE=""
292 AC_SUBST(EXTRA_OFED_CONFIG)
293 AC_SUBST(EXTRA_OFED_INCLUDE)
298 AS_IF([test $ENABLEO2IB != "no"], [
299 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
301 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
302 LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
303 rdma_create_id_4args, [
304 #ifdef HAVE_COMPAT_RDMA
306 #undef PACKAGE_TARNAME
307 #undef PACKAGE_VERSION
308 #undef PACKAGE_STRING
309 #undef PACKAGE_BUGREPORT
311 #include <linux/compat-2.6.h>
313 #include <rdma/rdma_cm.h>
315 rdma_create_id(NULL, NULL, 0, 0);
317 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
318 [rdma_create_id wants 4 args])
321 # 4.4 added network namespace parameter for rdma_create_id()
322 LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
323 rdma_create_id_5args, [
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/rdma_cm.h>
335 rdma_create_id(NULL, NULL, NULL, 0, 0);
337 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
338 [rdma_create_id wants 5 args])
341 # 4.2 introduced struct ib_cq_init_attr which is used
342 # by ib_create_cq(). Note some OFED stacks only keep
343 # their headers in sync with latest kernels but not
344 # the functionality which means for infiniband testing
345 # we need to always test functionality testings.
346 LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
348 #ifdef HAVE_COMPAT_RDMA
350 #undef PACKAGE_TARNAME
351 #undef PACKAGE_VERSION
352 #undef PACKAGE_STRING
353 #undef PACKAGE_BUGREPORT
355 #include <linux/compat-2.6.h>
357 #include <rdma/ib_verbs.h>
359 struct ib_cq_init_attr cq_attr;
361 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
363 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
364 [struct ib_cq_init_attr is used by ib_create_cq])
367 # 4.3 removed ib_alloc_fast_reg_mr()
368 LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
369 ib_alloc_fast_reg_mr, [
370 #ifdef HAVE_COMPAT_RDMA
372 #undef PACKAGE_TARNAME
373 #undef PACKAGE_VERSION
374 #undef PACKAGE_STRING
375 #undef PACKAGE_BUGREPORT
377 #include <linux/compat-2.6.h>
379 #include <rdma/ib_verbs.h>
381 ib_alloc_fast_reg_mr(NULL, 0);
383 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
384 [ib_alloc_fast_reg_mr is defined])
387 # 4.9 must stop using ib_get_dma_mr and the global MR
388 # We then have to use FMR/Fastreg for all RDMA.
389 LB_CHECK_COMPILE([if 'ib_get_dma_mr' exists],
391 #ifdef HAVE_COMPAT_RDMA
393 #undef PACKAGE_TARNAME
394 #undef PACKAGE_VERSION
395 #undef PACKAGE_STRING
396 #undef PACKAGE_BUGREPORT
398 #include <linux/compat-2.6.h>
400 #include <rdma/ib_verbs.h>
402 ib_get_dma_mr(NULL, 0);
404 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
405 [ib_get_dma_mr is defined])
408 # In v4.4 Linux kernel,
409 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
410 # split up struct ib_send_wr so that all non-trivial verbs
411 # use their own structure which embedds struct ib_send_wr.
412 LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
414 #ifdef HAVE_COMPAT_RDMA
416 #undef PACKAGE_TARNAME
417 #undef PACKAGE_VERSION
418 #undef PACKAGE_STRING
419 #undef PACKAGE_BUGREPORT
421 #include <linux/compat-2.6.h>
423 #include <rdma/ib_verbs.h>
425 struct ib_rdma_wr *wr __attribute__ ((unused));
429 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
430 [struct ib_rdma_wr is defined])
433 # new fast registration API introduced in 4.4
434 LB_CHECK_COMPILE([if 4arg 'ib_map_mr_sg' exists],
435 ib_map_mr_sg_4args, [
436 #ifdef HAVE_COMPAT_RDMA
438 #undef PACKAGE_TARNAME
439 #undef PACKAGE_VERSION
440 #undef PACKAGE_STRING
441 #undef PACKAGE_BUGREPORT
443 #include <linux/compat-2.6.h>
445 #include <rdma/ib_verbs.h>
447 ib_map_mr_sg(NULL, NULL, 0, 0);
449 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
450 [ib_map_mr_sg exists])
453 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
454 # in kernel 4.7 (and RHEL 7.3)
455 LB_CHECK_COMPILE([if 5arg 'ib_map_mr_sg' exists],
456 ib_map_mr_sg_5args, [
457 #ifdef HAVE_COMPAT_RDMA
459 #undef PACKAGE_TARNAME
460 #undef PACKAGE_VERSION
461 #undef PACKAGE_STRING
462 #undef PACKAGE_BUGREPORT
464 #include <linux/compat-2.6.h>
466 #include <rdma/ib_verbs.h>
468 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
470 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
471 [ib_map_mr_sg exists])
472 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
473 [ib_map_mr_sg has 5 arguments])
476 # ib_query_device() removed in 4.5
477 LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
479 #ifdef HAVE_COMPAT_RDMA
481 #undef PACKAGE_TARNAME
482 #undef PACKAGE_VERSION
483 #undef PACKAGE_STRING
484 #undef PACKAGE_BUGREPORT
486 #include <linux/compat-2.6.h>
488 #include <rdma/ib_verbs.h>
490 struct ib_device dev;
491 struct ib_device_attr dev_attr = {};
492 dev.attrs = dev_attr;
494 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
495 [struct ib_device.attrs is defined])
498 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
499 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
500 LB_CHECK_COMPILE([if 2arg 'ib_alloc_pd' exists],
502 #ifdef HAVE_COMPAT_RDMA
504 #undef PACKAGE_TARNAME
505 #undef PACKAGE_VERSION
506 #undef PACKAGE_STRING
507 #undef PACKAGE_BUGREPORT
509 #include <linux/compat-2.6.h>
511 #include <rdma/ib_verbs.h>
513 ib_alloc_pd(NULL, 0);
515 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
516 [ib_alloc_pd has 2 arguments])
519 LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
521 #ifdef HAVE_COMPAT_RDMA
523 #undef PACKAGE_TARNAME
524 #undef PACKAGE_VERSION
525 #undef PACKAGE_STRING
526 #undef PACKAGE_BUGREPORT
528 #include <linux/compat-2.6.h>
530 #include <rdma/ib_verbs.h>
532 (void)ib_inc_rkey(0);
534 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
535 [function ib_inc_rkey exist])
538 EXTRA_CHECK_INCLUDE=""
539 ]) # ENABLEO2IB != "no"
545 # check whether to use the Gemini Network Interface lnd
547 AC_DEFUN([LN_CONFIG_GNILND], [
548 AC_MSG_CHECKING([whether to enable GNI lnd])
550 AC_HELP_STRING([--enable-gni],
552 [], [enable_gni="no"])
553 AC_MSG_RESULT([$enable_gni])
555 AS_IF([test "x$enable_gni" = xyes], [
556 # GNICPPFLAGS was set in spec file
557 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
558 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
559 LB_CHECK_COMPILE([if GNI kernel headers are present],
561 #include <linux/types.h>
564 gni_cdm_handle_t kgni_domain;
567 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
568 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
573 AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
575 # at this point, we have gnilnd basic support,
576 # now check for extra features
577 LB_CHECK_COMPILE([to use RCA in gnilnd],
579 #include <linux/types.h>
581 #include <krca_lib.h>
583 gni_cdm_handle_t kgni_domain;
585 krca_ticket_t ticket = KRCA_NULL_TICKET;
587 __u32 nid = 0, nic_addr;
588 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
589 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
590 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
591 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
594 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
596 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
598 AC_SUBST(GNICPPFLAGS)
600 ]) # LN_CONFIG_GNILND
605 # 2.6.35 kernel has sk_sleep function
607 AC_DEFUN([LN_CONFIG_SK_SLEEP], [
608 LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
610 #include <net/sock.h>
614 AC_DEFINE(HAVE_SK_SLEEP, 1,
615 [kernel has sk_sleep])
617 ]) # LN_CONFIG_SK_SLEEP
620 # LN_CONFIG_TCP_SENDPAGE
622 # 2.6.36 tcp_sendpage() first parameter is 'struct sock'
623 # instead of 'struct socket'.
625 AC_DEFUN([LN_CONFIG_TCP_SENDPAGE], [
626 tmp_flags="$EXTRA_KCFLAGS"
627 EXTRA_KCFLAGS="-Werror"
628 LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
629 tcp_sendpage_socket, [
630 #include <linux/net.h>
633 tcp_sendpage((struct socket*)0, NULL, 0, 0, 0);
635 AC_DEFINE(HAVE_TCP_SENDPAGE_USE_SOCKET, 1,
636 [tcp_sendpage use socket as first parameter])
638 EXTRA_KCFLAGS="$tmp_flags"
639 ]) # LN_CONFIG_TCP_SENDPAGE
641 # LN_CONFIG_SOCK_CREATE_KERN
643 # 4.x sock_create_kern() added a first parameter as 'struct net *'
646 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
647 tmp_flags="$EXTRA_KCFLAGS"
648 EXTRA_KCFLAGS="-Werror"
649 LB_CHECK_COMPILE([if 'sock_create_kern' first parameter is net],
650 sock_create_kern_net, [
651 #include <linux/net.h>
652 #include <net/net_namespace.h>
654 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
656 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
657 [sock_create_kern use net as first parameter])
659 EXTRA_KCFLAGS="$tmp_flags"
660 ]) # LN_CONFIG_SOCK_CREATE_KERN
663 # LN_CONFIG_SK_DATA_READY
665 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
667 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
668 tmp_flags="$EXTRA_KCFLAGS"
669 EXTRA_KCFLAGS="-Werror"
670 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
672 #include <linux/net.h>
673 #include <net/sock.h>
675 ((struct sock *)0)->sk_data_ready(NULL);
677 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
678 [sk_data_ready uses only one argument])
680 EXTRA_KCFLAGS="$tmp_flags"
681 ]) # LN_CONFIG_SK_DATA_READY
684 # LN_EXPORT_KMAP_TO_PAGE
686 # 3.10 Export kmap_to_page
688 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
689 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
690 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
691 [kmap_to_page is exported by the kernel])])
692 ]) # LN_EXPORT_KMAP_TO_PAG
695 # LN_CONFIG_SOCK_ACCEPT
697 # 4.11 commit cdfbabfb2f0ce983fdaa42f20e5f7842178fc01e added a flag
698 # to handle a possible lockdep condition kernel socket accept.
700 AC_DEFUN([LN_CONFIG_SOCK_ACCEPT], [
701 tmp_flags="$EXTRA_KCFLAGS"
702 EXTRA_KCFLAGS="-Werror"
703 LB_CHECK_COMPILE([if 'struct sock' accept function requires a bool argument],
705 #include <linux/net.h>
707 ((struct socket *)0)->ops->accept(NULL, NULL, O_NONBLOCK, false);
709 AC_DEFINE(HAVE_KERN_SOCK_ACCEPT_FLAG_ARG, 1,
710 ['struct sock' accept function requires bool argument])
712 EXTRA_KCFLAGS="$tmp_flags"
713 ]) # LN_CONFIG_SOCK_ACCEPT
718 # LNet linux kernel checks
720 AC_DEFUN([LN_PROG_LINUX], [
721 AC_MSG_NOTICE([LNet kernel checks
722 ==============================================================================])
731 LN_CONFIG_TCP_SENDPAGE
733 LN_EXPORT_KMAP_TO_PAGE
735 LN_CONFIG_SK_DATA_READY
737 LN_CONFIG_SOCK_CREATE_KERN
739 LN_CONFIG_SOCK_ACCEPT
745 # default paths for installed files
747 AC_DEFUN([LN_PATH_DEFAULTS], [
748 ]) # LN_PATH_DEFAULTS
753 # other configure checks
755 AC_DEFUN([LN_CONFIGURE], [
756 AC_MSG_NOTICE([LNet core checks
757 ==============================================================================])
759 # lnet/utils/portals.c
760 AC_CHECK_HEADERS([netdb.h])
761 AC_CHECK_FUNCS([gethostbyname])
763 # lnet/utils/wirecheck.c
764 AC_CHECK_FUNCS([strnlen])
766 # -------- Check for required packages --------------
768 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
769 AC_ARG_ENABLE(efence,
770 AC_HELP_STRING([--enable-efence],
771 [use efence library]),
772 [], [enable_efence="no"])
773 AC_MSG_RESULT([$enable_efence])
776 AS_IF([test "$enable_efence" = yes], [
778 AC_DEFINE(HAVE_LIBEFENCE, 1,
779 [libefence support is requested])
789 # AM_CONDITIONAL defines for lnet
791 AC_DEFUN([LN_CONDITIONALS], [
792 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
793 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
799 # files that should be generated with AC_OUTPUT
801 AC_DEFUN([LN_CONFIG_FILES], [
805 lnet/autoconf/Makefile
807 lnet/include/Makefile
808 lnet/include/lnet/Makefile
809 lnet/include/uapi/linux/lnet/Makefile
811 lnet/klnds/autoMakefile
812 lnet/klnds/o2iblnd/Makefile
813 lnet/klnds/o2iblnd/autoMakefile
814 lnet/klnds/gnilnd/Makefile
815 lnet/klnds/gnilnd/autoMakefile
816 lnet/klnds/socklnd/Makefile
817 lnet/klnds/socklnd/autoMakefile
819 lnet/lnet/autoMakefile
820 lnet/selftest/Makefile
821 lnet/selftest/autoMakefile
823 lnet/utils/lnetconfig/Makefile