From b984a7bed4afec88677c89840d85f40b48d14c23 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Mon, 29 Jun 2015 13:15:23 -0500 Subject: [PATCH] LU-6769 build: Test for kthread_worker support The OFED compatibility layer will backport kthread_worker unless CONFIG_COMPAT_IS_KTHREAD is defined. kthread_worker is available in the SLES 11 SP3 kernel, but not RHEL 6.5 or RHEL 6.6. This mod adds a test to check if kthread is available in the kernel and defines CONFIG_COMPAT_IS_KTHREAD appropriately. Later versions of MLNX_OFED (2.4, 3.0) require that we similarly define HAVE_KTHREAD_WORK. Signed-off-by: Chris Horn Change-Id: Ia89b73e4c8a3ad8549efdea70f0ebd96a1151dba Reviewed-on: http://review.whamcloud.com/15428 Tested-by: Jenkins Reviewed-by: Shuichi Ihara Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 2361415..926d4c9 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -254,6 +254,18 @@ directory which is likely in ${O2IBPATH%-*} 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 + ],[ + 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]) -- 1.8.3.1