])
])
-# 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_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
#
# 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)
])
#