-f ${O2IBPATH}/include/rdma/ib_cm.h -a \
-f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
-f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \)], [
- AS_IF([test \( \( \( -d ${O2IBPATH}/patches -a \
- \( "x$OFED" = "xyes" \) \) -o \
- -d ${O2IBPATH}/kernel_patches \) -a \
- -f ${O2IBPATH}/Makefile \)], [
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([
-
-trying to use the, explicit or detected, OFED distribution's source
-directory (${O2IBPATH}) rather than the "development/headers"
-directory which is likely in ${O2IBPATH%-*}
-])
- ])
o2ib_found=true
break
])
*) AC_MSG_ERROR([internal error]) ;;
esac
else
+ COMPAT_AUTOCONF=""
compatrdma_found=false
if test -f ${O2IBPATH}/include/linux/compat-2.6.h; then
AC_MSG_RESULT([yes])
compatrdma_found=true
AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
+ EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
+ if test -f "$O2IBPATH/include/linux/compat_autoconf.h"; then
+ COMPAT_AUTOCONF="$O2IBPATH/include/linux/compat_autoconf.h"
+ fi
else
AC_MSG_RESULT([no])
fi
elif test -f "$O2IBPATH/ofed_patch.mk"; then
. "$O2IBPATH/ofed_patch.mk"
fi
- else
+ elif test -z "$COMPAT_AUTOCONF"; then
+ # Depreciated checks
if test "x$RHEL_KERNEL" = xyes; then
- case "$RHEL_RELEASE_NO" in
- 64)
- EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_6_4" ;;
- 65)
- EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_6_4 -DCONFIG_COMPAT_RHEL_6_5" ;;
- esac
+ RHEL_MAJOR=$(awk '/ RHEL_MAJOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
+ I=$(awk '/ RHEL_MINOR / { print [$]3 }' $LINUX_OBJ/include/$VERSION_HDIR/version.h)
+ while test "$I" -ge 0; do
+ EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_RHEL_${RHEL_MAJOR}_$I"
+ I=$(($I-1))
+ done
elif test "x$SUSE_KERNEL" = xyes; then
SP=$(grep PATCHLEVEL /etc/SuSE-release | sed -e 's/.*= *//')
EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_SLES_11_$SP"
fi
fi
- LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
- linux_kthread_worker, [
- #include <linux/kthread.h>
- ],[
- struct kthread_work *kth_wrk __attribute__ ((unused));
- flush_kthread_work(kth_wrk);
- ],[
- EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
- AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
- ])
-
AC_MSG_CHECKING([whether to use any OFED backport headers])
if test -n "$BACKPORT_INCLUDES"; then
AC_MSG_RESULT([yes])
LB_CHECK_COMPILE([whether to enable OpenIB gen2 support],
openib_gen2_support, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <linux/version.h>
AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
fi
fi
+
+ LB_CHECK_COMPILE([if Linux kernel has kthread_worker],
+ linux_kthread_worker, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <linux/kthread.h>
+ ],[
+ struct kthread_work *kth_wrk __attribute__ ((unused));
+ flush_kthread_work(kth_wrk);
+ ],[
+ AC_DEFINE(HAVE_KTHREAD_WORK, 1, [kthread_worker found])
+ if test -z "$COMPAT_AUTOCONF"; then
+ EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -DCONFIG_COMPAT_IS_KTHREAD"
+ fi
+ ])
fi
])
+AC_SUBST(EXTRA_OFED_CONFIG)
AC_SUBST(EXTRA_OFED_INCLUDE)
AC_SUBST(O2IBLND)
-AC_SUBST(O2IBPATHS)
+AC_SUBST(O2IBPATH)
AC_SUBST(ENABLEO2IB)
# In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
LB_CHECK_COMPILE([if 'rdma_create_id' wants four args],
rdma_create_id_4args, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <rdma/rdma_cm.h>
[rdma_create_id wants 4 args])
])
])
+#
+# 4.2 introduced struct ib_cq_init_attr which is used
+# by ib_create_cq(). Note some OFED stacks only keep
+# their headers in sync with latest kernels but not
+# the functionality which means for infiniband testing
+# we need to always test functionality testings.
+#
+AS_IF([test $ENABLEO2IB != "no"], [
+ LB_CHECK_COMPILE([if 'struct ib_cq_init_attr' is used],
+ ib_cq_init_attr, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ struct ib_cq_init_attr cq_attr;
+
+ ib_create_cq(NULL, NULL, NULL, NULL, &cq_attr);
+ ],[
+ AC_DEFINE(HAVE_IB_CQ_INIT_ATTR, 1,
+ [struct ib_cq_init_attr is used by ib_create_cq])
+ ])
+])
+
+# 4.3 removed ib_alloc_fast_reg_mr()
+AS_IF([test $ENABLEO2IB != "no"], [
+ LB_CHECK_COMPILE([if 'ib_alloc_fast_reg_mr' exists],
+ ib_alloc_fast_reg_mr, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ ib_alloc_fast_reg_mr(NULL, 0);
+ ],[
+ AC_DEFINE(HAVE_IB_ALLOC_FAST_REG_MR, 1,
+ [ib_alloc_fast_reg_mr is defined])
+ ])
+])
+
+# 4.4 added network namespace parameter for rdma_create_id()
+AS_IF([test $ENABLEO2IB != "no"], [
+ LB_CHECK_COMPILE([if 'rdma_create_id' wants five args],
+ rdma_create_id_5args, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <rdma/rdma_cm.h>
+ ],[
+ rdma_create_id(NULL, NULL, NULL, 0, 0);
+ ],[
+ AC_DEFINE(HAVE_RDMA_CREATE_ID_5ARG, 1,
+ [rdma_create_id wants 5 args])
+ ])
+])
]) # LN_CONFIG_O2IB
#
LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
sk_sleep, [
#ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
#include <linux/compat-2.6.h>
#endif
#include <net/sock.h>
EXTRA_KCFLAGS="-Werror"
LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
tcp_sendpage_socket, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
#include <linux/net.h>
#include <net/tcp.h>
],[
EXTRA_KCFLAGS="-Werror"
LB_CHECK_COMPILE([if 'sk_data_ready' takes only one argument],
sk_data_ready, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
#include <linux/net.h>
#include <net/sock.h>
],[
]) # LN_CONFIG_SK_DATA_READY
#
+# LN_CONFIG_IB_INC_RKEY
+#
+AC_DEFUN([LN_CONFIG_IB_INC_RKEY], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if function 'ib_inc_rkey' is defined],
+ib_inc_rkey, [
+ #ifdef HAVE_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <rdma/ib_verbs.h>
+],[
+ (void)ib_inc_rkey(0);
+],[
+ AC_DEFINE(HAVE_IB_INC_RKEY, 1,
+ [function ib_inc_rkey exist])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LN_CONFIG_IB_INC_RKEY
+
+#
# LN_PROG_LINUX
#
# LNet linux kernel checks
LN_CONFIG_BACKOFF
LN_CONFIG_O2IB
LN_CONFIG_GNILND
+LN_CONFIG_IB_INC_RKEY
# 2.6.35
LN_CONFIG_SK_SLEEP
# 2.6.36