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
104 # Configure dlc if enabled
106 # if libyaml is set (IE libyaml installed) and enable_dlc = yes then build
107 # dlc other wise (IE if libyaml is not set or enable_dlc = no) then don't
110 AC_DEFUN([LN_CONFIG_DLC], [
111 AC_CHECK_LIB([yaml], [yaml_parser_initialize],[
114 AC_MSG_CHECKING([whether to enable dlc])
116 AC_HELP_STRING([--disable-dlc],
117 [disable building dlc]),
118 [], [enable_dlc="yes"])
120 AS_IF([test "x$enable_dlc" = xyes],
121 [AS_IF([test "x$LIBYAML" = xlibyaml], [
125 AC_MSG_RESULT([no (libyaml not present)])
136 # If current OFED installed (assume with "ofed_info") and devel
137 # headers are not found, error because we assume OFED infiniband
138 # driver needs to be used and we must configure/build with it.
139 # Current OFED headers detection mechanism allow for non-standard
140 # prefix but relies on "ofed_info" command and on "%prefix/openib"
141 # link (both are ok for 1.5.x and 3.x versions), and should work
142 # for both source and DKMS builds.
144 AC_DEFUN([LN_CONFIG_O2IB], [
145 AC_MSG_CHECKING([whether to use Compat RDMA])
147 AC_HELP_STRING([--with-o2ib=[yes|no|<path>]],
148 [build o2iblnd against path]),
149 [], [with_o2ib="yes"])
152 yes) AS_IF([which ofed_info 2>/dev/null], [
153 AS_IF([test x$uses_dpkg = xyes], [
154 OFED_INFO="ofed_info | awk '{print \[$]2}'"
155 LSPKG="dpkg --listfiles"
157 OFED_INFO="ofed_info"
160 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)
161 AS_IF([test -z "$O2IBPATHS"], [
163 You seem to have an OFED installed but have not installed it's devel package.
164 If you still want to build Lustre for your OFED I/B stack, you need to install its devel headers RPM.
165 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.
168 AS_IF([test $(echo $O2IBPATHS | wc -w) -ge 2], [
170 It appears that you have multiple OFED versions installed.
171 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.
172 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.
177 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
183 *) O2IBPATHS=$with_o2ib
184 ENABLEO2IB="withpath"
189 AS_IF([test $ENABLEO2IB = "no"], [
193 for O2IBPATH in $O2IBPATHS; do
194 AS_IF([test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
195 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
196 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
197 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \)], [
202 if ! $o2ib_found; then
205 "yes") AC_MSG_ERROR([no OFED nor kernel OpenIB gen2 headers present]) ;;
206 "withpath") AC_MSG_ERROR([bad --with-o2ib path]) ;;
207 *) AC_MSG_ERROR([internal error]) ;;
211 compatrdma_found=false
212 if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
214 compatrdma_found=true
215 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
216 EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
217 if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
218 COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
223 if ! $compatrdma_found; then
224 if test -f "$O2IBPATH/config.mk"; then
225 . "$O2IBPATH/config.mk"
226 elif test -f "$O2IBPATH/ofed_patch.mk"; then
227 . "$O2IBPATH/ofed_patch.mk"
229 elif test -z "$COMPAT_AUTOCONF"; then
231 if test "x$RHEL_KERNEL" = xyes; then
232 RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
233 I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
234 while test "$I" -ge 0; do
235 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
238 elif test "x$SUSE_KERNEL" = xyes; then
239 SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
240 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
244 AC_MSG_CHECKING([whether to use any OFED backport headers])
245 if test -n "$BACKPORT_INCLUDES"; then
247 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
248 EXTRA_OFED_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_OFED_INCLUDE"
254 O2IBPATH=$(readlink --canonicalize $O2IBPATH)
255 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include"
256 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
257 LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
258 openib_gen2_support, [
259 #ifdef HAVE_COMPAT_RDMA
261 #undef PACKAGE_TARNAME
262 #undef PACKAGE_VERSION
263 #undef PACKAGE_STRING
264 #undef PACKAGE_BUGREPORT
266 #include <linux/compat-2.6.h>
268 #include <linux/version.h>
269 #include <linux/pci.h>
270 #include <linux/gfp.h>
271 #include <rdma/rdma_cm.h>
272 #include <rdma/ib_cm.h>
273 #include <rdma/ib_verbs.h>
274 #include <rdma/ib_fmr_pool.h>
276 struct rdma_cm_id *cm_idi __attribute__ ((unused));
277 struct rdma_conn_param conn_param __attribute__ ((unused));
278 struct ib_device_attr device_attr __attribute__ ((unused));
279 struct ib_qp_attr qp_attr __attribute__ ((unused));
280 struct ib_pool_fmr pool_fmr __attribute__ ((unused));
281 enum ib_cm_rej_reason rej_reason __attribute__ ((unused));
282 rdma_destroy_id(NULL);
287 "yes") AC_MSG_ERROR([can't compile with OpenIB gen2 headers]) ;;
288 "withpath") AC_MSG_ERROR([can't compile with OpenIB gen2 headers under $O2IBPATH]) ;;
289 *) AC_MSG_ERROR([internal error]) ;;
292 # we know at this point that the found OFED source is good
294 if test $ENABLEO2IB = "withpath" -o "x$OFED" = "xyes" ; then
295 # OFED default rpm not handle sles10 Modules.symvers name
296 for name in Module.symvers Modules.symvers; do
297 if test -f $O2IBPATH/$name; then
302 if test -n "$O2IB_SYMVER"; then
303 AC_MSG_NOTICE([adding $O2IBPATH/$O2IB_SYMVER to Symbol Path])
304 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IBPATH/$O2IB_SYMVER"
305 AC_SUBST(EXTRA_SYMBOLS)
307 AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
311 LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
312 linux_kthread_worker, [
313 #ifdef HAVE_COMPAT_RDMA
315 #undef PACKAGE_TARNAME
316 #undef PACKAGE_VERSION
317 #undef PACKAGE_STRING
318 #undef PACKAGE_BUGREPORT
320 #include <linux/compat-2.6.h>
322 #include <linux/kthread.h>
324 struct kthread_work *kth_wrk __attribute__ ((unused));
325 flush_kthread_work(kth_wrk);
327 AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
328 if test -z "$COMPAT_AUTOCONF"; then
329 EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
332 EXTRA_CHECK_INCLUDE=""
335 AC_SUBST(EXTRA_OFED_CONFIG)
336 AC_SUBST(EXTRA_OFED_INCLUDE)
341 AS_IF([test $ENABLEO2IB != "no"], [
342 EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
344 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
345 LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
346 rdma_create_id_4args, [
347 #ifdef HAVE_COMPAT_RDMA
349 #undef PACKAGE_TARNAME
350 #undef PACKAGE_VERSION
351 #undef PACKAGE_STRING
352 #undef PACKAGE_BUGREPORT
354 #include <linux/compat-2.6.h>
356 #include <rdma/rdma_cm.h>
358 rdma_create_id(NULL, NULL, 0, 0);
360 AC_DEFINE(HAVE_RDMA_CREATE_ID_4ARG, 1,
361 [rdma_create_id wants 4 args])
364 # 4.4 added network namespace parameter for rdma_create_id()
365 LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
366 rdma_create_id_5args, [
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/rdma_cm.h>
378 rdma_create_id(NULL, NULL, NULL, 0, 0);
380 AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
381 [rdma_create_id wants 5 args])
384 # 4.2 introduced struct ib_cq_init_attr which is used
385 # by ib_create_cq(). Note some OFED stacks only keep
386 # their headers in sync with latest kernels but not
387 # the functionality which means for infiniband testing
388 # we need to always test functionality testings.
389 LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
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 struct ib_cq_init_attr cq_attr;
404 ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
406 AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
407 [struct ib_cq_init_attr is used by ib_create_cq])
410 # 4.3 removed ib_alloc_fast_reg_mr()
411 LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
412 ib_alloc_fast_reg_mr, [
413 #ifdef HAVE_COMPAT_RDMA
415 #undef PACKAGE_TARNAME
416 #undef PACKAGE_VERSION
417 #undef PACKAGE_STRING
418 #undef PACKAGE_BUGREPORT
420 #include <linux/compat-2.6.h>
422 #include <rdma/ib_verbs.h>
424 ib_alloc_fast_reg_mr(NULL, 0);
426 AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
427 [ib_alloc_fast_reg_mr is defined])
430 # 4.9 must stop using ib_get_dma_mr and the global MR
431 # We then have to use FMR/Fastreg for all RDMA.
432 LB_CHECK_COMPILE([if 'ib_get_dma_mr' exists],
434 #ifdef HAVE_COMPAT_RDMA
436 #undef PACKAGE_TARNAME
437 #undef PACKAGE_VERSION
438 #undef PACKAGE_STRING
439 #undef PACKAGE_BUGREPORT
441 #include <linux/compat-2.6.h>
443 #include <rdma/ib_verbs.h>
445 ib_get_dma_mr(NULL, 0);
447 AC_DEFINE(HAVE_IB_GET_DMA_MR, 1,
448 [ib_get_dma_mr is defined])
451 # In v4.4 Linux kernel,
452 # commit e622f2f4ad2142d2a613a57fb85f8cf737935ef5
453 # split up struct ib_send_wr so that all non-trivial verbs
454 # use their own structure which embedds struct ib_send_wr.
455 LB_CHECK_COMPILE([if 'struct ib_rdma_wr' is defined],
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 struct ib_rdma_wr *wr __attribute__ ((unused));
472 AC_DEFINE(HAVE_IB_RDMA_WR, 1,
473 [struct ib_rdma_wr is defined])
476 # new fast registration API introduced in 4.4
477 LB_CHECK_COMPILE([if 4arg 'ib_map_mr_sg' exists],
478 ib_map_mr_sg_4args, [
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 ib_map_mr_sg(NULL, NULL, 0, 0);
492 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
493 [ib_map_mr_sg exists])
496 # ib_map_mr_sg changes from 4 to 5 args (adding sg_offset_p)
497 # in kernel 4.7 (and RHEL 7.3)
498 LB_CHECK_COMPILE([if 5arg 'ib_map_mr_sg' exists],
499 ib_map_mr_sg_5args, [
500 #ifdef HAVE_COMPAT_RDMA
502 #undef PACKAGE_TARNAME
503 #undef PACKAGE_VERSION
504 #undef PACKAGE_STRING
505 #undef PACKAGE_BUGREPORT
507 #include <linux/compat-2.6.h>
509 #include <rdma/ib_verbs.h>
511 ib_map_mr_sg(NULL, NULL, 0, NULL, 0);
513 AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
514 [ib_map_mr_sg exists])
515 AC_DEFINE(HAVE_IB_MAP_MR_SG_5ARGS, 1,
516 [ib_map_mr_sg has 5 arguments])
519 # ib_query_device() removed in 4.5
520 LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
522 #ifdef HAVE_COMPAT_RDMA
524 #undef PACKAGE_TARNAME
525 #undef PACKAGE_VERSION
526 #undef PACKAGE_STRING
527 #undef PACKAGE_BUGREPORT
529 #include <linux/compat-2.6.h>
531 #include <rdma/ib_verbs.h>
533 struct ib_device dev;
534 struct ib_device_attr dev_attr = {};
535 dev.attrs = dev_attr;
537 AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
538 [struct ib_device.attrs is defined])
541 # A flags argument was added to ib_alloc_pd() in Linux 4.9,
542 # commit ed082d36a7b2c27d1cda55fdfb28af18040c4a89
543 LB_CHECK_COMPILE([if 2arg 'ib_alloc_pd' exists],
545 #ifdef HAVE_COMPAT_RDMA
547 #undef PACKAGE_TARNAME
548 #undef PACKAGE_VERSION
549 #undef PACKAGE_STRING
550 #undef PACKAGE_BUGREPORT
552 #include <linux/compat-2.6.h>
554 #include <rdma/ib_verbs.h>
556 ib_alloc_pd(NULL, 0);
558 AC_DEFINE(HAVE_IB_ALLOC_PD_2ARGS, 1,
559 [ib_alloc_pd has 2 arguments])
562 LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
564 #ifdef HAVE_COMPAT_RDMA
566 #undef PACKAGE_TARNAME
567 #undef PACKAGE_VERSION
568 #undef PACKAGE_STRING
569 #undef PACKAGE_BUGREPORT
571 #include <linux/compat-2.6.h>
573 #include <rdma/ib_verbs.h>
575 (void)ib_inc_rkey(0);
577 AC_DEFINE(HAVE_IB_INC_RKEY, 1,
578 [function ib_inc_rkey exist])
581 EXTRA_CHECK_INCLUDE=""
582 ]) # ENABLEO2IB != "no"
588 # check whether to use the Gemini Network Interface lnd
590 AC_DEFUN([LN_CONFIG_GNILND], [
591 AC_MSG_CHECKING([whether to enable GNI lnd])
593 AC_HELP_STRING([--enable-gni],
595 [], [enable_gni="no"])
596 AC_MSG_RESULT([$enable_gni])
598 AS_IF([test "x$enable_gni" = xyes], [
599 # GNICPPFLAGS was set in spec file
600 EXTRA_KCFLAGS_save="$EXTRA_KCFLAGS"
601 EXTRA_KCFLAGS="$EXTRA_KCFLAGS $GNICPPFLAGS"
602 LB_CHECK_COMPILE([if GNI kernel headers are present],
604 #include <linux/types.h>
607 gni_cdm_handle_t kgni_domain;
610 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
611 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
616 AC_MSG_ERROR([can't compile gnilnd with given GNICPPFLAGS: $GNICPPFLAGS])
618 # at this point, we have gnilnd basic support,
619 # now check for extra features
620 LB_CHECK_COMPILE([to use RCA in gnilnd],
622 #include <linux/types.h>
624 #include <krca_lib.h>
626 gni_cdm_handle_t kgni_domain;
628 krca_ticket_t ticket = KRCA_NULL_TICKET;
630 __u32 nid = 0, nic_addr;
631 rc = gni_cdm_create(0, 1, 1, 0, &kgni_domain);
632 rrc = (rc == GNI_RC_SUCCESS) ? 0 : 1;
633 rrc += krca_nid_to_nicaddrs(nid, 1, &nic_addr);
634 rrc += krca_register(&ticket, RCA_MAKE_SERVICE_INDEX(RCA_IO_CLASS, 9), 99, 0);
637 GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1"
639 EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
641 AC_SUBST(GNICPPFLAGS)
643 ]) # LN_CONFIG_GNILND
648 # 2.6.35 kernel has sk_sleep function
650 AC_DEFUN([LN_CONFIG_SK_SLEEP], [
651 LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
653 #include <net/sock.h>
657 AC_DEFINE(HAVE_SK_SLEEP, 1,
658 [kernel has sk_sleep])
660 ]) # LN_CONFIG_SK_SLEEP
663 # LN_CONFIG_TCP_SENDPAGE
665 # 2.6.36 tcp_sendpage() first parameter is 'struct sock'
666 # instead of 'struct socket'.
668 AC_DEFUN([LN_CONFIG_TCP_SENDPAGE], [
669 tmp_flags="$EXTRA_KCFLAGS"
670 EXTRA_KCFLAGS="-Werror"
671 LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
672 tcp_sendpage_socket, [
673 #include <linux/net.h>
676 tcp_sendpage((struct socket*)0, NULL, 0, 0, 0);
678 AC_DEFINE(HAVE_TCP_SENDPAGE_USE_SOCKET, 1,
679 [tcp_sendpage use socket as first parameter])
681 EXTRA_KCFLAGS="$tmp_flags"
682 ]) # LN_CONFIG_TCP_SENDPAGE
684 # LN_CONFIG_SOCK_CREATE_KERN
686 # 4.x sock_create_kern() added a first parameter as 'struct net *'
689 AC_DEFUN([LN_CONFIG_SOCK_CREATE_KERN], [
690 tmp_flags="$EXTRA_KCFLAGS"
691 EXTRA_KCFLAGS="-Werror"
692 LB_CHECK_COMPILE([if 'sock_create_kern' first parameter is net],
693 sock_create_kern_net, [
694 #include <linux/net.h>
695 #include <net/net_namespace.h>
697 sock_create_kern((struct net*)0, 0, 0, 0, NULL);
699 AC_DEFINE(HAVE_SOCK_CREATE_KERN_USE_NET, 1,
700 [sock_create_kern use net as first parameter])
702 EXTRA_KCFLAGS="$tmp_flags"
703 ]) # LN_CONFIG_SOCK_CREATE_KERN
706 # LN_CONFIG_SK_DATA_READY
708 # 3.15 for struct sock the *sk_data_ready() field only takes one argument now
710 AC_DEFUN([LN_CONFIG_SK_DATA_READY], [
711 tmp_flags="$EXTRA_KCFLAGS"
712 EXTRA_KCFLAGS="-Werror"
713 LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
715 #include <linux/net.h>
716 #include <net/sock.h>
718 ((struct sock *)0)->sk_data_ready(NULL);
720 AC_DEFINE(HAVE_SK_DATA_READY_ONE_ARG, 1,
721 [sk_data_ready uses only one argument])
723 EXTRA_KCFLAGS="$tmp_flags"
724 ]) # LN_CONFIG_SK_DATA_READY
729 # LNet linux kernel checks
731 AC_DEFUN([LN_PROG_LINUX], [
732 AC_MSG_NOTICE([LNet kernel checks
733 ==============================================================================])
742 LN_CONFIG_TCP_SENDPAGE
744 LN_CONFIG_SOCK_CREATE_KERN
746 LN_CONFIG_SK_DATA_READY
752 # default paths for installed files
754 AC_DEFUN([LN_PATH_DEFAULTS], [
755 ]) # LN_PATH_DEFAULTS
760 # other configure checks
762 AC_DEFUN([LN_CONFIGURE], [
763 AC_MSG_NOTICE([LNet core checks
764 ==============================================================================])
766 # lnet/utils/portals.c
767 AC_CHECK_HEADERS([netdb.h])
768 AC_CHECK_FUNCS([gethostbyname])
770 # lnet/utils/wirecheck.c
771 AC_CHECK_FUNCS([strnlen])
773 # -------- Check for required packages --------------
775 AC_MSG_CHECKING([whether to enable 'efence' debugging support])
776 AC_ARG_ENABLE(efence,
777 AC_HELP_STRING([--enable-efence],
778 [use efence library]),
779 [], [enable_efence="no"])
780 AC_MSG_RESULT([$enable_efence])
783 AS_IF([test "$enable_efence" = yes], [
785 AC_DEFINE(HAVE_LIBEFENCE, 1,
786 [libefence support is requested])
790 LN_CONFIG_MAX_PAYLOAD
797 # AM_CONDITIONAL defines for lnet
799 AC_DEFUN([LN_CONDITIONALS], [
800 AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd")
801 AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd")
802 AM_CONDITIONAL(BUILD_DLC, test x$USE_DLC = "xyes")
808 # files that should be generated with AC_OUTPUT
810 AC_DEFUN([LN_CONFIG_FILES], [
814 lnet/autoconf/Makefile
816 lnet/include/Makefile
817 lnet/include/lnet/Makefile
819 lnet/klnds/autoMakefile
820 lnet/klnds/o2iblnd/Makefile
821 lnet/klnds/o2iblnd/autoMakefile
822 lnet/klnds/gnilnd/Makefile
823 lnet/klnds/gnilnd/autoMakefile
824 lnet/klnds/socklnd/Makefile
825 lnet/klnds/socklnd/autoMakefile
827 lnet/lnet/autoMakefile
828 lnet/selftest/Makefile
829 lnet/selftest/autoMakefile
831 lnet/utils/lnetconfig/Makefile