2 # LN_CONFIG_MAX_PAYLOAD
4 # configure maximum payload
6 AC_DEFUN([LN_CONFIG_MAX_PAYLOAD], [
7 AC_MSG_CHECKING([for non-default maximum LNET payload])
8 AC_ARG_WITH([max-payload-mb],
9 AC_HELP_STRING([--with-max-payload-mb=MBytes],
10 [set maximum lnet payload in MBytes]),
12 AC_MSG_RESULT([$with_max_payload_mb])
13 CONFIG_LNET_MAX_PAYLOAD_MB=$with_max_payload_mb
14 CONFIG_LNET_MAX_PAYLOAD="(($with_max_payload_mb)<<20)"
17 CONFIG_LNET_MAX_PAYLOAD="LNET_MTU"
19 AC_DEFINE_UNQUOTED(CONFIG_LNET_MAX_PAYLOAD, $CONFIG_LNET_MAX_PAYLOAD,
21 ]) # LN_CONFIG_MAX_PAYLOAD
24 # LN_CHECK_GCC_VERSION
26 # Check compiler version
28 AC_DEFUN([LN_CHECK_GCC_VERSION], [
29 AC_MSG_CHECKING([compiler version])
30 PTL_CC_VERSION=`$CC --version | awk '/^gcc/{print $ 3}'`
31 PTL_MIN_CC_VERSION="3.2.2"
33 awk -F. '{printf "%d\n", (($ 1)*100+($ 2))*100+($ 3)}'
35 if test -z "$PTL_CC_VERSION" -o \
36 $(echo $PTL_CC_VERSION | v2n) -ge $(echo $PTL_MIN_CC_VERSION | v2n); then
39 AC_MSG_RESULT([Buggy compiler found])
40 AC_MSG_ERROR([Need gcc version >= $PTL_MIN_CC_VERSION])
42 ]) # LN_CHECK_GCC_VERSION
47 # check if cpu affinity is available/wanted
49 AC_DEFUN([LN_CONFIG_AFFINITY], [
50 AC_MSG_CHECKING([whether to enable CPU affinity support])
51 AC_ARG_ENABLE([affinity],
52 AC_HELP_STRING([--disable-affinity],
53 [disable process/irq affinity]),
54 [], [enable_affinity="yes"])
55 AC_MSG_RESULT([$enable_affinity])
56 AS_IF([test "x$enable_affinity" = xyes], [
57 LB_CHECK_COMPILE([if Linux kernel has cpu affinity support],
58 set_cpus_allowed_ptr, [
59 #include <linux/sched.h>
61 struct task_struct *t;
67 set_cpus_allowed_ptr(t, &m);
69 AC_DEFINE(CPU_AFFINITY, 1,
70 [kernel has cpu affinity support])
73 ]) # LN_CONFIG_AFFINITY
78 # check if tunable tcp backoff is available/wanted
80 AC_DEFUN([LN_CONFIG_BACKOFF], [
81 AC_MSG_CHECKING([whether to enable tunable backoff TCP support])
82 AC_ARG_ENABLE([backoff],
83 AC_HELP_STRING([--disable-backoff],
84 [disable socknal tunable backoff]),
85 [], [enable_backoff="yes"])
86 AC_MSG_RESULT([$enable_backoff])
87 AS_IF([test "x$enable_backoff" = xyes], [
88 AC_MSG_CHECKING([if Linux kernel has tunable backoff TCP support])
89 AS_IF([grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h >/dev/null], [
91 AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
92 AS_IF([grep rto_max $LINUX/include/linux/tcp.h | grep -q __u16 >/dev/null],
93 [AC_DEFINE(SOCKNAL_BACKOFF_MS, 1,
94 [tunable backoff TCP in ms])])
99 ]) # LN_CONFIG_BACKOFF
106 # fail to build if libyaml is not installed
108 AC_DEFUN([LN_CONFIG_DLC], [
109 AC_CHECK_LIB([yaml], [yaml_parser_initialize],
111 [AC_MSG_ERROR([YAML development libraries not not installed])],
118 # If current OFED installed (assume with "ofed_info") and devel
119 # headers are not found, error because we assume OFED infiniband
120 # driver needs to be used and we must configure/build with it.
121 # Current OFED headers detection mechanism allow for non-standard
122 # prefix but relies on "ofed_info" command and on "%prefix/openib"
123 # link (both are ok for 1.5.x and 3.x versions), and should work
124 # for both source and DKMS builds.
126 AC_DEFUN([LN_CONFIG_O2IB], [
127 AC_MSG_CHECKING([whether to use Compat RDMA])
129 AC_HELP_STRING([--with-o2ib=[yes|no|<path>]],
130 [build o2iblnd against path]),
131 [], [with_o2ib="yes"])
134 yes) AS_IF([which ofed_info 2>/dev/null], [
135 AS_IF([test x$uses_dpkg = xyes], [
136 OFED_INFO="ofed_info | awk '{print \[$]2}'"
137 LSPKG="dpkg --listfiles"
139 OFED_INFO="ofed_info"
142 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)
143 AS_IF([test -z "$O2IBPATHS"], [
145 You seem to have an OFED installed but have not installed it's devel package.
146 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
147 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.
150 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
152 It appears that you have multiple OFED versions installed.
153 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.
154 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.
159 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
165 *) O2IBPATHS=$with_o2ib
166 ENABLEO2IB="withpath"
171 AS_IF([test $ENABLEO2IB = "no"], [
175 for O2IBPATH in $O2IBPATHS; do
176 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
177 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
178 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
179 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \)], [
184 if ! $o2ib_found; then
187 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
188 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
189 *) AC_MSG_ERROR([internal error]) ;;
193 compatrdma_found=false
194 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
196 compatrdma_found=true
197 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
198 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
199 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
200 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
205 if ! $compatrdma_found; then
206 if test -f "$O2IBPATH/config.mk"; then
207 . "$O2IBPATH/config.mk"
208 elif test -f "$O2IBPATH/ofed_patch.mk"; then
209 . "$O2IBPATH/ofed_patch.mk"
211 elif test -z "$COMPAT_AUTOCONF"; then
213 if test "x$RHEL_KERNEL" = xyes; then
214 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
215 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
216 while test "$I" -ge 0; do
217 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
220 elif test "x$SUSE_KERNEL" = xyes; then
221 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
222 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
226 AC_MSG_CHECKING([whether to use any OFED backport headers])
227 if test -n "$BACKPORT_INCLUDES"; then
229 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
230 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
236 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
237 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include -I$O2IBPATH/include/uapi"
238 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
239 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
240 openib_gen2_support, [
241 #ifdef HAVE_COMPAT_RDMA
243 #undef PACKAGE_TARNAME
244 #undef PACKAGE_VERSION
245 #undef PACKAGE_STRING
246 #undef PACKAGE_BUGREPORT
248 #include <linux/compat-2.6.h>
250 #include <linux/version.h>
251 #include <linux/pci.h>
252 #include <linux/gfp.h>
253 #include <rdma/rdma_cm.h>
254 #include <rdma/ib_cm.h>
255 #include <rdma/ib_verbs.h>
256 #include <rdma/ib_fmr_pool.h>
258 struct rdma_cm_id *cm_idi __attribute__ ((unused));
259 struct rdma_conn_param conn_param __attribute__ ((unused));
260 struct ib_device_attr device_attr __attribute__ ((unused));
261 struct ib_qp_attr qp_attr __attribute__ ((unused));
262 struct ib_pool_fmr pool_fmr __attribute__ ((unused));
263 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
264 rdma_destroy_id(NULL);
269 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
270 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
271 *) AC_MSG_ERROR([internal error]) ;;
274 # we know at this point that the found OFED source is good
276 if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
277 # OFED default rpm not handle sles10 Modules.symvers name
278 for name in Module.symvers Modules.symvers; do
279 if test -f $O2IBPATH/$name; then
284 if test -n "$O2IB_SYMVER"; then
285 AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to Symbol Path])
286 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IBPATH/$O2IB_SYMVER"
287 AC_SUBST(EXTRA_SYMBOLS)
289 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
293 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
294 linux_kthread_worker, [
295 #ifdef HAVE_COMPAT_RDMA
297 #undef PACKAGE_TARNAME
298 #undef PACKAGE_VERSION
299 #undef PACKAGE_STRING
300 #undef PACKAGE_BUGREPORT
302 #include <linux/compat-2.6.h>
304 #include <linux/kthread.h>
306 struct kthread_work *kth_wrk __attribute__ ((unused));
307 flush_kthread_work(kth_wrk);
309 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
310 if test -z "$COMPAT_AUTOCONF"; then
311 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
314 EXTRA_CHECK_INCLUDE=""
317 AC_SUBST(EXTRA_OFED_CONFIG)
318 AC_SUBST(EXTRA_OFED_INCLUDE)
323 AS_IF([test $ENABLEO2IB != "no"], [
324 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
326 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
327 LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
328 rdma_create_id_4args, [
329 #ifdef HAVE_COMPAT_RDMA
331 #undef PACKAGE_TARNAME
332 #undef PACKAGE_VERSION
333 #undef PACKAGE_STRING
334 #undef PACKAGE_BUGREPORT
336 #include <linux/compat-2.6.h>
338 #include <rdma/rdma_cm.h>
340 rdma_create_id(NULL, NULL, 0, 0);
342 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
343 [rdma_create_id wants 4 args])
346 # 4.4 added network namespace parameter for rdma_create_id()
347 LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
348 rdma_create_id_5args, [
349 #ifdef HAVE_COMPAT_RDMA
351 #undef PACKAGE_TARNAME
352 #undef PACKAGE_VERSION
353 #undef PACKAGE_STRING
354 #undef PACKAGE_BUGREPORT
356 #include <linux/compat-2.6.h>
358 #include <rdma/rdma_cm.h>
360 rdma_create_id(NULL, NULL, NULL, 0, 0);
362 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
363 [rdma_create_id wants 5 args])
366 # 4.2 introduced struct ib_cq_init_attr which is used
367 # by ib_create_cq(). Note some OFED stacks only keep
368 # their headers in sync with latest kernels but not
369 # the functionality which means for infiniband testing
370 # we need to always test functionality testings.
371 LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
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 struct ib_cq_init_attr cq_attr;
386 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
388 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
389 [struct ib_cq_init_attr is used by ib_create_cq])
392 # 4.3 removed ib_alloc_fast_reg_mr()
393 LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
394 ib_alloc_fast_reg_mr, [
395 #ifdef HAVE_COMPAT_RDMA
397 #undef PACKAGE_TARNAME
398 #undef PACKAGE_VERSION
399 #undef PACKAGE_STRING
400 #undef PACKAGE_BUGREPORT
402 #include <linux/compat-2.6.h>
404 #include <rdma/ib_verbs.h>
406 ib_alloc_fast_reg_mr(NULL, 0);
408 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
409 [ib_alloc_fast_reg_mr is defined])
412 # 4.9 must stop using ib_get_dma_mr and the global MR
413 # We then have to use FMR/Fastreg for all RDMA.
414 LB_CHECK_COMPILE([if 'ib_get_dma_mr' exists],
416 #ifdef HAVE_COMPAT_RDMA
418 #undef PACKAGE_TARNAME
419 #undef PACKAGE_VERSION
420 #undef PACKAGE_STRING
421 #undef PACKAGE_BUGREPORT
423 #include <linux/compat-2.6.h>
425 #include <rdma/ib_verbs.h>
427 ib_get_dma_mr(NULL, 0);
429 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
430 [ib_get_dma_mr is defined])
433 # In v4.4 Linux kernel,
434 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
435 # split up struct ib_send_wr so that all non-trivial verbs
436 # use their own structure which embedds struct ib_send_wr.
437 LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
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 struct ib_rdma_wr *wr __attribute__ ((unused));
454 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
455 [struct ib_rdma_wr is defined])
458 # new fast registration API introduced in 4.4
459 LB_CHECK_COMPILE([if 4arg 'ib_map_mr_sg' exists],
460 ib_map_mr_sg_4args, [
461 #ifdef HAVE_COMPAT_RDMA
463 #undef PACKAGE_TARNAME
464 #undef PACKAGE_VERSION
465 #undef PACKAGE_STRING
466 #undef PACKAGE_BUGREPORT
468 #include <linux/compat-2.6.h>
470 #include <rdma/ib_verbs.h>
472 ib_map_mr_sg(NULL, NULL, 0, 0);
474 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
475 [ib_map_mr_sg exists])
478 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
479 # in kernel 4.7 (and RHEL 7.3)
480 LB_CHECK_COMPILE([if 5arg 'ib_map_mr_sg' exists],
481 ib_map_mr_sg_5args, [
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 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
495 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
496 [ib_map_mr_sg exists])
497 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
498 [ib_map_mr_sg has 5 arguments])
501 # ib_query_device() removed in 4.5
502 LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
504 #ifdef HAVE_COMPAT_RDMA
506 #undef PACKAGE_TARNAME
507 #undef PACKAGE_VERSION
508 #undef PACKAGE_STRING
509 #undef PACKAGE_BUGREPORT
511 #include <linux/compat-2.6.h>
513 #include <rdma/ib_verbs.h>
515 struct ib_device dev;
516 struct ib_device_attr dev_attr = {};
517 dev.attrs = dev_attr;
519 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
520 [struct ib_device.attrs is defined])
523 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
524 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
525 LB_CHECK_COMPILE([if 2arg 'ib_alloc_pd' exists],
527 #ifdef HAVE_COMPAT_RDMA
529 #undef PACKAGE_TARNAME
530 #undef PACKAGE_VERSION
531 #undef PACKAGE_STRING
532 #undef PACKAGE_BUGREPORT
534 #include <linux/compat-2.6.h>
536 #include <rdma/ib_verbs.h>
538 ib_alloc_pd(NULL, 0);
540 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
541 [ib_alloc_pd has 2 arguments])
544 LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
546 #ifdef HAVE_COMPAT_RDMA
548 #undef PACKAGE_TARNAME
549 #undef PACKAGE_VERSION
550 #undef PACKAGE_STRING
551 #undef PACKAGE_BUGREPORT
553 #include <linux/compat-2.6.h>
555 #include <rdma/ib_verbs.h>
557 (void)ib_inc_rkey(0);
559 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
560 [function ib_inc_rkey exist])
563 EXTRA_CHECK_INCLUDE=""
564 ]) # ENABLEO2IB != "no"
570 # check whether to use the Gemini Network Interface lnd
572 AC_DEFUN([LN_CONFIG_GNILND], [
573 AC_MSG_CHECKING([whether to enable GNI lnd])
575 AC_HELP_STRING([--enable-gni],
577 [], [enable_gni="no"])
578 AC_MSG_RESULT([$enable_gni])
580 AS_IF([test "x$enable_gni" = xyes], [
581 # GNICPPFLAGS was set in spec file
582 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
583 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
584 LB_CHECK_COMPILE([if GNI kernel headers are present],
586 #include <linux/types.h>
589 gni_cdm_handle_t kgni_domain;
592 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
593 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
598 AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
600 # at this point, we have gnilnd basic support,
601 # now check for extra features
602 LB_CHECK_COMPILE([to use RCA in gnilnd],
604 #include <linux/types.h>
606 #include <krca_lib.h>
608 gni_cdm_handle_t kgni_domain;
610 krca_ticket_t ticket = KRCA_NULL_TICKET;
612 __u32 nid = 0, nic_addr;
613 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
614 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
615 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
616 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
619 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
621 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
623 AC_SUBST(GNICPPFLAGS)
625 ]) # LN_CONFIG_GNILND
630 # 2.6.35 kernel has sk_sleep function
632 AC_DEFUN([LN_CONFIG_SK_SLEEP], [
633 LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
635 #include <net/sock.h>
639 AC_DEFINE(HAVE_SK_SLEEP, 1,
640 [kernel has sk_sleep])
642 ]) # LN_CONFIG_SK_SLEEP
645 # LN_CONFIG_TCP_SENDPAGE
647 # 2.6.36 tcp_sendpage() first parameter is 'struct sock'
648 # instead of 'struct socket'.
650 AC_DEFUN([LN_CONFIG_TCP_SENDPAGE], [
651 tmp_flags="$EXTRA_KCFLAGS"
652 EXTRA_KCFLAGS="-Werror"
653 LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
654 tcp_sendpage_socket, [
655 #include <linux/net.h>
658 tcp_sendpage((struct socket*)0, NULL, 0, 0, 0);
660 AC_DEFINE(HAVE_TCP_SENDPAGE_USE_SOCKET, 1,
661 [tcp_sendpage use socket as first parameter])
663 EXTRA_KCFLAGS="$tmp_flags"
664 ]) # LN_CONFIG_TCP_SENDPAGE
666 # LN_CONFIG_SOCK_CREATE_KERN
668 # 4.x sock_create_kern() added a first parameter as 'struct net *'
671 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
672 tmp_flags="$EXTRA_KCFLAGS"
673 EXTRA_KCFLAGS="-Werror"
674 LB_CHECK_COMPILE([if 'sock_create_kern' first parameter is net],
675 sock_create_kern_net, [
676 #include <linux/net.h>
677 #include <net/net_namespace.h>
679 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
681 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
682 [sock_create_kern use net as first parameter])
684 EXTRA_KCFLAGS="$tmp_flags"
685 ]) # LN_CONFIG_SOCK_CREATE_KERN
688 # LN_CONFIG_SK_DATA_READY
690 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
692 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
693 tmp_flags="$EXTRA_KCFLAGS"
694 EXTRA_KCFLAGS="-Werror"
695 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
697 #include <linux/net.h>
698 #include <net/sock.h>
700 ((struct sock *)0)->sk_data_ready(NULL);
702 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
703 [sk_data_ready uses only one argument])
705 EXTRA_KCFLAGS="$tmp_flags"
706 ]) # LN_CONFIG_SK_DATA_READY
709 # LN_EXPORT_KMAP_TO_PAGE
711 # 3.10 Export kmap_to_page
713 AC_DEFUN([LN_EXPORT_KMAP_TO_PAGE], [
714 LB_CHECK_EXPORT([kmap_to_page], [mm/highmem.c],
715 [AC_DEFINE(HAVE_KMAP_TO_PAGE, 1,
716 [kmap_to_page is exported by the kernel])])
717 ]) # LN_EXPORT_KMAP_TO_PAG
720 # LN_CONFIG_SOCK_ACCEPT
722 # 4.11 commit cdfbabfb2f0ce983fdaa42f20e5f7842178fc01e added a flag
723 # to handle a possible lockdep condition kernel socket accept.
725 AC_DEFUN([LN_CONFIG_SOCK_ACCEPT], [
726 tmp_flags="$EXTRA_KCFLAGS"
727 EXTRA_KCFLAGS="-Werror"
728 LB_CHECK_COMPILE([if 'struct sock' accept function requires a bool argument],
730 #include <linux/net.h>
732 ((struct socket *)0)->ops->accept(NULL, NULL, O_NONBLOCK, false);
734 AC_DEFINE(HAVE_KERN_SOCK_ACCEPT_FLAG_ARG, 1,
735 ['struct sock' accept function requires bool argument])
737 EXTRA_KCFLAGS="$tmp_flags"
738 ]) # LN_CONFIG_SOCK_ACCEPT
743 # LNet linux kernel checks
745 AC_DEFUN([LN_PROG_LINUX], [
746 AC_MSG_NOTICE([LNet kernel checks
747 ==============================================================================])
756 LN_CONFIG_TCP_SENDPAGE
758 LN_EXPORT_KMAP_TO_PAGE
760 LN_CONFIG_SK_DATA_READY
762 LN_CONFIG_SOCK_CREATE_KERN
764 LN_CONFIG_SOCK_ACCEPT
770 # default paths for installed files
772 AC_DEFUN([LN_PATH_DEFAULTS], [
773 ]) # LN_PATH_DEFAULTS
778 # other configure checks
780 AC_DEFUN([LN_CONFIGURE], [
781 AC_MSG_NOTICE([LNet core checks
782 ==============================================================================])
784 # lnet/utils/portals.c
785 AC_CHECK_HEADERS([netdb.h])
786 AC_CHECK_FUNCS([gethostbyname])
788 # lnet/utils/wirecheck.c
789 AC_CHECK_FUNCS([strnlen])
791 # -------- Check for required packages --------------
793 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
794 AC_ARG_ENABLE(efence,
795 AC_HELP_STRING([--enable-efence],
796 [use efence library]),
797 [], [enable_efence="no"])
798 AC_MSG_RESULT([$enable_efence])
801 AS_IF([test "$enable_efence" = yes], [
803 AC_DEFINE(HAVE_LIBEFENCE, 1,
804 [libefence support is requested])
808 LN_CONFIG_MAX_PAYLOAD
815 # AM_CONDITIONAL defines for lnet
817 AC_DEFUN([LN_CONDITIONALS], [
818 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
819 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
825 # files that should be generated with AC_OUTPUT
827 AC_DEFUN([LN_CONFIG_FILES], [
831 lnet/autoconf/Makefile
833 lnet/include/Makefile
834 lnet/include/lnet/Makefile
835 lnet/include/uapi/linux/lnet/Makefile
837 lnet/klnds/autoMakefile
838 lnet/klnds/o2iblnd/Makefile
839 lnet/klnds/o2iblnd/autoMakefile
840 lnet/klnds/gnilnd/Makefile
841 lnet/klnds/gnilnd/autoMakefile
842 lnet/klnds/socklnd/Makefile
843 lnet/klnds/socklnd/autoMakefile
845 lnet/lnet/autoMakefile
846 lnet/selftest/Makefile
847 lnet/selftest/autoMakefile
849 lnet/utils/lnetconfig/Makefile