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 if test -f $O2IBPATH/Module.symvers; then
253 O2IB_SYMVER=$O2IBPATH/Module.symvers;
256 if test -n "$O2IB_SYMVER"; then
257 AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path])
258 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER"
259 AC_SUBST(EXTRA_SYMBOLS)
261 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
265 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
266 linux_kthread_worker, [
267 #ifdef HAVE_COMPAT_RDMA
269 #undef PACKAGE_TARNAME
270 #undef PACKAGE_VERSION
271 #undef PACKAGE_STRING
272 #undef PACKAGE_BUGREPORT
274 #include <linux/compat-2.6.h>
276 #include <linux/kthread.h>
278 struct kthread_work *kth_wrk = NULL;
279 flush_kthread_work(kth_wrk);
281 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
282 if test -z "$COMPAT_AUTOCONF"; then
283 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
286 EXTRA_CHECK_INCLUDE=""
289 AC_SUBST(EXTRA_OFED_CONFIG)
290 AC_SUBST(EXTRA_OFED_INCLUDE)
295 AS_IF([test $ENABLEO2IB != "no"], [
296 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
298 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
299 LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
300 rdma_create_id_4args, [
301 #ifdef HAVE_COMPAT_RDMA
303 #undef PACKAGE_TARNAME
304 #undef PACKAGE_VERSION
305 #undef PACKAGE_STRING
306 #undef PACKAGE_BUGREPORT
308 #include <linux/compat-2.6.h>
310 #include <rdma/rdma_cm.h>
312 rdma_create_id(NULL, NULL, 0, 0);
314 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
315 [rdma_create_id wants 4 args])
318 # 4.4 added network namespace parameter for rdma_create_id()
319 LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
320 rdma_create_id_5args, [
321 #ifdef HAVE_COMPAT_RDMA
323 #undef PACKAGE_TARNAME
324 #undef PACKAGE_VERSION
325 #undef PACKAGE_STRING
326 #undef PACKAGE_BUGREPORT
328 #include <linux/compat-2.6.h>
330 #include <rdma/rdma_cm.h>
332 rdma_create_id(NULL, NULL, NULL, 0, 0);
334 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
335 [rdma_create_id wants 5 args])
338 # 4.2 introduced struct ib_cq_init_attr which is used
339 # by ib_create_cq(). Note some OFED stacks only keep
340 # their headers in sync with latest kernels but not
341 # the functionality which means for infiniband testing
342 # we need to always test functionality testings.
343 LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
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 struct ib_cq_init_attr cq_attr;
358 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
360 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
361 [struct ib_cq_init_attr is used by ib_create_cq])
364 # 4.3 removed ib_alloc_fast_reg_mr()
365 LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
366 ib_alloc_fast_reg_mr, [
367 #ifdef HAVE_COMPAT_RDMA
369 #undef PACKAGE_TARNAME
370 #undef PACKAGE_VERSION
371 #undef PACKAGE_STRING
372 #undef PACKAGE_BUGREPORT
374 #include <linux/compat-2.6.h>
376 #include <rdma/ib_verbs.h>
378 ib_alloc_fast_reg_mr(NULL, 0);
380 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
381 [ib_alloc_fast_reg_mr is defined])
384 # 4.9 must stop using ib_get_dma_mr and the global MR
385 # We then have to use FMR/Fastreg for all RDMA.
386 LB_CHECK_COMPILE([if 'ib_get_dma_mr' exists],
388 #ifdef HAVE_COMPAT_RDMA
390 #undef PACKAGE_TARNAME
391 #undef PACKAGE_VERSION
392 #undef PACKAGE_STRING
393 #undef PACKAGE_BUGREPORT
395 #include <linux/compat-2.6.h>
397 #include <rdma/ib_verbs.h>
399 ib_get_dma_mr(NULL, 0);
401 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
402 [ib_get_dma_mr is defined])
405 # In v4.4 Linux kernel,
406 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
407 # split up struct ib_send_wr so that all non-trivial verbs
408 # use their own structure which embedds struct ib_send_wr.
409 LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
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 struct ib_rdma_wr *wr __attribute__ ((unused));
426 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
427 [struct ib_rdma_wr is defined])
430 # new fast registration API introduced in 4.4
431 LB_CHECK_COMPILE([if 4arg 'ib_map_mr_sg' exists],
432 ib_map_mr_sg_4args, [
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 ib_map_mr_sg(NULL, NULL, 0, 0);
446 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
447 [ib_map_mr_sg exists])
450 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
451 # in kernel 4.7 (and RHEL 7.3)
452 LB_CHECK_COMPILE([if 5arg 'ib_map_mr_sg' exists],
453 ib_map_mr_sg_5args, [
454 #ifdef HAVE_COMPAT_RDMA
456 #undef PACKAGE_TARNAME
457 #undef PACKAGE_VERSION
458 #undef PACKAGE_STRING
459 #undef PACKAGE_BUGREPORT
461 #include <linux/compat-2.6.h>
463 #include <rdma/ib_verbs.h>
465 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
467 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
468 [ib_map_mr_sg exists])
469 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
470 [ib_map_mr_sg has 5 arguments])
473 # ib_query_device() removed in 4.5
474 LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
476 #ifdef HAVE_COMPAT_RDMA
478 #undef PACKAGE_TARNAME
479 #undef PACKAGE_VERSION
480 #undef PACKAGE_STRING
481 #undef PACKAGE_BUGREPORT
483 #include <linux/compat-2.6.h>
485 #include <rdma/ib_verbs.h>
487 struct ib_device dev;
488 struct ib_device_attr dev_attr = {};
489 dev.attrs = dev_attr;
491 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
492 [struct ib_device.attrs is defined])
495 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
496 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
497 LB_CHECK_COMPILE([if 2arg 'ib_alloc_pd' exists],
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_alloc_pd(NULL, 0);
512 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
513 [ib_alloc_pd has 2 arguments])
516 LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
518 #ifdef HAVE_COMPAT_RDMA
520 #undef PACKAGE_TARNAME
521 #undef PACKAGE_VERSION
522 #undef PACKAGE_STRING
523 #undef PACKAGE_BUGREPORT
525 #include <linux/compat-2.6.h>
527 #include <rdma/ib_verbs.h>
529 (void)ib_inc_rkey(0);
531 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
532 [function ib_inc_rkey exist])
535 EXTRA_CHECK_INCLUDE=""
536 ]) # ENABLEO2IB != "no"
542 # check whether to use the Gemini Network Interface lnd
544 AC_DEFUN([LN_CONFIG_GNILND], [
545 AC_MSG_CHECKING([whether to enable GNI lnd])
547 AC_HELP_STRING([--enable-gni],
549 [], [enable_gni="no"])
550 AC_MSG_RESULT([$enable_gni])
552 AS_IF([test "x$enable_gni" = xyes], [
553 # GNICPPFLAGS was set in spec file
554 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
555 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
556 LB_CHECK_COMPILE([if GNI kernel headers are present],
558 #include <linux/types.h>
561 gni_cdm_handle_t kgni_domain;
564 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
565 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
570 AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
572 # at this point, we have gnilnd basic support,
573 # now check for extra features
574 LB_CHECK_COMPILE([to use RCA in gnilnd],
576 #include <linux/types.h>
578 #include <krca_lib.h>
580 gni_cdm_handle_t kgni_domain;
582 krca_ticket_t ticket = KRCA_NULL_TICKET;
584 __u32 nid = 0, nic_addr;
585 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
586 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
587 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
588 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
591 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
593 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
595 AC_SUBST(GNICPPFLAGS)
597 ]) # LN_CONFIG_GNILND
602 # 2.6.35 kernel has sk_sleep function
604 AC_DEFUN([LN_CONFIG_SK_SLEEP], [
605 LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
607 #include <net/sock.h>
611 AC_DEFINE(HAVE_SK_SLEEP, 1,
612 [kernel has sk_sleep])
614 ]) # LN_CONFIG_SK_SLEEP
617 # LN_CONFIG_TCP_SENDPAGE
619 # 2.6.36 tcp_sendpage() first parameter is 'struct sock'
620 # instead of 'struct socket'.
622 AC_DEFUN([LN_CONFIG_TCP_SENDPAGE], [
623 tmp_flags="$EXTRA_KCFLAGS"
624 EXTRA_KCFLAGS="-Werror"
625 LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
626 tcp_sendpage_socket, [
627 #include <linux/net.h>
630 tcp_sendpage((struct socket*)0, NULL, 0, 0, 0);
632 AC_DEFINE(HAVE_TCP_SENDPAGE_USE_SOCKET, 1,
633 [tcp_sendpage use socket as first parameter])
635 EXTRA_KCFLAGS="$tmp_flags"
636 ]) # LN_CONFIG_TCP_SENDPAGE
638 # LN_CONFIG_SOCK_CREATE_KERN
640 # 4.x sock_create_kern() added a first parameter as 'struct net *'
643 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
644 tmp_flags="$EXTRA_KCFLAGS"
645 EXTRA_KCFLAGS="-Werror"
646 LB_CHECK_COMPILE([if 'sock_create_kern' first parameter is net],
647 sock_create_kern_net, [
648 #include <linux/net.h>
649 #include <net/net_namespace.h>
651 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
653 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
654 [sock_create_kern use net as first parameter])
656 EXTRA_KCFLAGS="$tmp_flags"
657 ]) # LN_CONFIG_SOCK_CREATE_KERN
660 # LN_CONFIG_SK_DATA_READY
662 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
664 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
665 tmp_flags="$EXTRA_KCFLAGS"
666 EXTRA_KCFLAGS="-Werror"
667 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
669 #include <linux/net.h>
670 #include <net/sock.h>
672 ((struct sock *)0)->sk_data_ready(NULL);
674 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
675 [sk_data_ready uses only one argument])
677 EXTRA_KCFLAGS="$tmp_flags"
678 ]) # LN_CONFIG_SK_DATA_READY
681 # LN_EXPORT_KMAP_TO_PAGE
683 # 3.10 Export kmap_to_page
685 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
686 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
687 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
688 [kmap_to_page is exported by the kernel])])
689 ]) # LN_EXPORT_KMAP_TO_PAG
692 # LN_CONFIG_SOCK_ACCEPT
694 # 4.11 commit cdfbabfb2f0ce983fdaa42f20e5f7842178fc01e added a flag
695 # to handle a possible lockdep condition kernel socket accept.
697 AC_DEFUN([LN_CONFIG_SOCK_ACCEPT], [
698 tmp_flags="$EXTRA_KCFLAGS"
699 EXTRA_KCFLAGS="-Werror"
700 LB_CHECK_COMPILE([if 'struct sock' accept function requires a bool argument],
702 #include <linux/net.h>
704 ((struct socket *)0)->ops->accept(NULL, NULL, O_NONBLOCK, false);
706 AC_DEFINE(HAVE_KERN_SOCK_ACCEPT_FLAG_ARG, 1,
707 ['struct sock' accept function requires bool argument])
709 EXTRA_KCFLAGS="$tmp_flags"
710 ]) # LN_CONFIG_SOCK_ACCEPT
715 # LNet linux kernel checks
717 AC_DEFUN([LN_PROG_LINUX], [
718 AC_MSG_NOTICE([LNet kernel checks
719 ==============================================================================])
728 LN_CONFIG_TCP_SENDPAGE
730 LN_EXPORT_KMAP_TO_PAGE
732 LN_CONFIG_SK_DATA_READY
734 LN_CONFIG_SOCK_CREATE_KERN
736 LN_CONFIG_SOCK_ACCEPT
742 # default paths for installed files
744 AC_DEFUN([LN_PATH_DEFAULTS], [
745 ]) # LN_PATH_DEFAULTS
750 # other configure checks
752 AC_DEFUN([LN_CONFIGURE], [
753 AC_MSG_NOTICE([LNet core checks
754 ==============================================================================])
756 # lnet/utils/portals.c
757 AC_CHECK_HEADERS([netdb.h])
758 AC_CHECK_FUNCS([gethostbyname])
760 # lnet/utils/wirecheck.c
761 AC_CHECK_FUNCS([strnlen])
763 # -------- Check for required packages --------------
765 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
766 AC_ARG_ENABLE(efence,
767 AC_HELP_STRING([--enable-efence],
768 [use efence library]),
769 [], [enable_efence="no"])
770 AC_MSG_RESULT([$enable_efence])
773 AS_IF([test "$enable_efence" = yes], [
775 AC_DEFINE(HAVE_LIBEFENCE, 1,
776 [libefence support is requested])
786 # AM_CONDITIONAL defines for lnet
788 AC_DEFUN([LN_CONDITIONALS], [
789 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
790 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
796 # files that should be generated with AC_OUTPUT
798 AC_DEFUN([LN_CONFIG_FILES], [
802 lnet/autoconf/Makefile
804 lnet/include/Makefile
805 lnet/include/lnet/Makefile
806 lnet/include/uapi/linux/lnet/Makefile
808 lnet/klnds/autoMakefile
809 lnet/klnds/o2iblnd/Makefile
810 lnet/klnds/o2iblnd/autoMakefile
811 lnet/klnds/gnilnd/Makefile
812 lnet/klnds/gnilnd/autoMakefile
813 lnet/klnds/socklnd/Makefile
814 lnet/klnds/socklnd/autoMakefile
816 lnet/lnet/autoMakefile
817 lnet/selftest/Makefile
818 lnet/selftest/autoMakefile
820 lnet/utils/lnetconfig/Makefile