EXTRA_KCFLAGS="$tmp_flags"
])
-# check cpumask_size (2.6.28)
-AC_DEFUN([LIBCFS_CPUMASK_SIZE],
-[AC_MSG_CHECKING([whether have cpumask_size()])
-LB_LINUX_TRY_COMPILE([
- #include <linux/cpumask.h>
-],[
- int size = cpumask_size();
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_CPUMASK_SIZE, 1, [have cpumask_size()])
-],[
- AC_MSG_RESULT(NO)
-])
-])
-
-# 2.6.24 request not use real numbers for ctl_name
-AC_DEFUN([LIBCFS_SYSCTL_UNNUMBERED],
-[AC_MSG_CHECKING([for CTL_UNNUMBERED])
-LB_LINUX_TRY_COMPILE([
- #include <linux/sysctl.h>
-],[
- #ifndef CTL_UNNUMBERED
- #error CTL_UNNUMBERED not exist in kernel
- #endif
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SYSCTL_UNNUMBERED, 1,
- [sysctl has CTL_UNNUMBERED])
-],[
- AC_MSG_RESULT(NO)
-])
-])
-
-# 2.6.27 have second argument to sock_map_fd
-AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
-[AC_MSG_CHECKING([sock_map_fd have second argument])
-LB_LINUX_TRY_COMPILE([
- #include <linux/net.h>
-],[
- sock_map_fd(NULL, 0);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
- [sock_map_fd have second argument])
-],[
- AC_MSG_RESULT(NO)
-])
-])
-
#
# LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
#
])
])
-AC_DEFUN([LIBCFS_HAVE_KEYTYPE_H],
-[LB_CHECK_FILE([$LINUX/include/linux/key-type.h], [
- AC_DEFINE(HAVE_LINUX_KEYTYPE_H, 1,
- [kernel has include/key-type.h])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
#
# RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
#
])
])
+AC_DEFUN([LIBCFS_HAVE_CRC32],
+[LB_LINUX_CONFIG_IM([CRC32],
+ [have_crc32=true],[have_crc32=false])
+if test x$have_crc32 = xtrue; then
+ AC_DEFINE(HAVE_CRC32, 1, [kernel compiled with CRC32 functions])
+fi
+])
+
+AC_DEFUN([LIBCFS_ENABLE_CRC32_ACCEL],
+[LB_LINUX_CONFIG_IM([CRYPTO_CRC32_PCLMUL],
+ [enable_crc32_crypto=false],[enable_crc32_crypto=true])
+if test x$have_crc32 = xtrue -a x$enable_crc32_crypto = xtrue; then
+ AC_DEFINE(NEED_CRC32_ACCEL, 1, [need pclmulqdq based crc32])
+ AC_MSG_WARN([No crc32 pclmulqdq crypto api found,
+ enable internal pclmulqdq based crc32])
+fi
+])
+
+AC_DEFUN([LIBCFS_ENABLE_CRC32C_ACCEL],
+[LB_LINUX_CONFIG_IM([CRYPTO_CRC32C_INTEL],
+ [enable_crc32c_crypto=false],[enable_crc32c_crypto=true])
+if test x$enable_crc32c_crypto = xtrue; then
+ AC_DEFINE(NEED_CRC32C_ACCEL, 1, [need pclmulqdq based crc32c])
+ AC_MSG_WARN([No crc32c pclmulqdq crypto api found,
+ enable internal pclmulqdq based crc32c])
+fi
+])
+
#
# LIBCFS_PROG_LINUX
#
LIBCFS_CONFIG_PANIC_DUMPLOG
LIBCFS_U64_LONG_LONG_LINUX
-# 2.6.24
-LIBCFS_SYSCTL_UNNUMBERED
-LIBCFS_HAVE_KEYTYPE_H
-# 2.6.30
-LIBCFS_SOCK_MAP_FD_2ARG
# 2.6.32
LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
LC_SHRINKER_WANT_SHRINK_PTR
LIBCFS_STACKTRACE_WARNING
# 3.7
LIBCFS_SOCK_ALLOC_FILE
+# 3.8
+LIBCFS_HAVE_CRC32
+LIBCFS_ENABLE_CRC32_ACCEL
+# 3.10
+LIBCFS_ENABLE_CRC32C_ACCEL
])
#
#
AC_DEFUN([LIBCFS_CONDITIONALS],
[
+AM_CONDITIONAL(HAVE_CRC32, test x$have_crc32 = xtrue)
+AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32, test x$have_crc32 = xtrue -a x$enable_crc32_crypto = xtrue)
+AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32C, test x$enable_crc32c_crypto = xtrue)
])
#