Whamcloud - gitweb
LU-12477 lnet: Remove obsolete config options
[fs/lustre-release.git] / lnet / autoconf / lustre-lnet.m4
index 4ea62ad..42ced43 100644 (file)
@@ -1,53 +1,3 @@
-#
-# LN_CHECK_GCC_VERSION
-#
-# Check compiler version
-#
-AC_DEFUN([LN_CHECK_GCC_VERSION], [
-AC_MSG_CHECKING([compiler version])
-PTL_CC_VERSION=`$CC --version | awk '/^gcc/{print $ 3}'`
-PTL_MIN_CC_VERSION="3.2.2"
-v2n() {
-       awk -F. '{printf "%d\n", (($ 1)*100+($ 2))*100+($ 3)}'
-}
-if test -z "$PTL_CC_VERSION" -o \
-       $(echo $PTL_CC_VERSION | v2n) -ge $(echo $PTL_MIN_CC_VERSION | v2n); then
-       AC_MSG_RESULT([ok])
-else
-       AC_MSG_RESULT([Buggy compiler found])
-       AC_MSG_ERROR([Need gcc version >= $PTL_MIN_CC_VERSION])
-fi
-]) # LN_CHECK_GCC_VERSION
-
-#
-# LN_CONFIG_AFFINITY
-#
-# check if cpu affinity is available/wanted
-#
-AC_DEFUN([LN_CONFIG_AFFINITY], [
-AC_MSG_CHECKING([whether to enable CPU affinity support])
-AC_ARG_ENABLE([affinity],
-       AC_HELP_STRING([--disable-affinity],
-               [disable process/irq affinity]),
-       [], [enable_affinity="yes"])
-AC_MSG_RESULT([$enable_affinity])
-AS_IF([test "x$enable_affinity" = xyes], [
-       LB_CHECK_COMPILE([if Linux kernel has cpu affinity support],
-       set_cpus_allowed_ptr, [
-               #include <linux/sched.h>
-       ],[
-               struct task_struct *t = NULL;
-               cpumask_t m = { };
-
-               set_cpus_allowed_ptr(t, &m);
-       ],[
-               AC_DEFINE(CPU_AFFINITY, 1,
-                       [kernel has cpu affinity support])
-       ])
-])
-]) # LN_CONFIG_AFFINITY
-
-#
 # LN_CONFIG_BACKOFF
 #
 # check if tunable tcp backoff is available/wanted
@@ -81,10 +31,12 @@ AS_IF([test "x$enable_backoff" = xyes], [
 # fail to build if libyaml is not installed
 #
 AC_DEFUN([LN_CONFIG_DLC], [
-       AC_CHECK_LIB([yaml], [yaml_parser_initialize],
-                    [LIBYAML="libyaml"],
-                    [AC_MSG_ERROR([YAML development libraries not not installed])],
-                    [-lm])
+       AS_IF([test "x$enable_dist" = xno], [
+               AC_CHECK_LIB([yaml], [yaml_parser_initialize],
+                            [LIBYAML="libyaml"],
+                            [AC_MSG_ERROR([YAML development libraries not not installed])],
+                            [-lm])
+       ])
 ])
 
 #
@@ -537,6 +489,37 @@ AS_IF([test $ENABLEO2IB != "no"], [
                          [function ib_inc_rkey exist])
        ])
 
+       # In MOFED 4.6, the second and third parameters for
+       # ib_post_send() and ib_post_recv() are declared with
+       # 'const'.
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+       LB_CHECK_COMPILE([if 'ib_post_send() and ib_post_recv()' have const parameters],
+       ib_post_send_recv_const, [
+               #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_post_send(NULL, (const struct ib_send_wr *)NULL,
+                            (const struct ib_send_wr **)NULL);
+       ],[
+               AC_DEFINE(HAVE_IB_POST_SEND_RECV_CONST, 1,
+                       [ib_post_send and ib_post_recv have const parameters])
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       # 5.0
+       LN_IB_DEVICE_OPS_EXISTS
+       # 5.1
+       LN_IB_SG_DMA_ADDRESS_EXISTS
+
        EXTRA_CHECK_INCLUDE=""
 ]) # ENABLEO2IB != "no"
 ]) # LN_CONFIG_O2IB
@@ -601,45 +584,6 @@ AC_SUBST(GNICPPFLAGS)
 AC_SUBST(GNILND)
 ]) # LN_CONFIG_GNILND
 
-#
-# LN_CONFIG_SK_SLEEP
-#
-# 2.6.35 kernel has sk_sleep function
-#
-AC_DEFUN([LN_CONFIG_SK_SLEEP], [
-LB_CHECK_COMPILE([if Linux kernel has 'sk_sleep'],
-sk_sleep, [
-       #include <net/sock.h>
-],[
-       sk_sleep(NULL);
-],[
-       AC_DEFINE(HAVE_SK_SLEEP, 1,
-                 [kernel has sk_sleep])
-])
-]) # LN_CONFIG_SK_SLEEP
-
-#
-# LN_CONFIG_TCP_SENDPAGE
-#
-# 2.6.36 tcp_sendpage() first parameter is 'struct sock'
-# instead of 'struct socket'.
-#
-AC_DEFUN([LN_CONFIG_TCP_SENDPAGE], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if 'tcp_sendpage' first parameter is socket],
-tcp_sendpage_socket, [
-       #include <linux/net.h>
-       #include <net/tcp.h>
-],[
-       tcp_sendpage((struct socket*)0, NULL, 0, 0, 0);
-],[
-       AC_DEFINE(HAVE_TCP_SENDPAGE_USE_SOCKET, 1,
-               [tcp_sendpage use socket as first parameter])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LN_CONFIG_TCP_SENDPAGE
-
 # LN_CONFIG_SOCK_CREATE_KERN
 #
 # 4.x sock_create_kern() added a first parameter as 'struct net *'
@@ -715,6 +659,96 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LN_CONFIG_SOCK_ACCEPT
 
 #
+# LN_HAVE_ORACLE_OFED_EXTENSIONS
+#
+# Oracle UEK 5
+#
+AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [
+LB_CHECK_COMPILE([if Oracle OFED Extensions are enabled],
+oracle_ofed_ext, [
+       #include <rdma/ib_fmr_pool.h>
+],[
+       struct ib_fmr_pool_param param = {
+               .relaxed           = 0
+       };
+       (void)param;
+],[
+       AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1,
+               [if Oracle OFED Extensions are enabled])
+])
+]) # LN_HAVE_ORACLE_OFED_EXTENSIONS
+
+#
+# LN_CONFIG_SOCK_GETNAME
+#
+# 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname()
+# does not take the length *int argument and returns the length
+#
+AC_DEFUN([LN_CONFIG_SOCK_GETNAME], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'getname' has two args],
+kern_sock_getname_2args, [
+       #include <linux/net.h>
+],[
+       kernel_getsockname(NULL, NULL);
+],[
+       AC_DEFINE(HAVE_KERN_SOCK_GETNAME_2ARGS, 1,
+               ['getname' has two args])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LN_CONFIG_SOCK_GETNAME
+
+#
+# LN_IB_DEVICE_OPS_EXISTS
+#
+# kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
+# RDMA/core: Introduce ib_device_ops
+# ... introduces the ib_device_ops structure that defines all the
+# InfiniBand device operations in one place ...
+#
+AC_DEFUN([LN_IB_DEVICE_OPS_EXISTS], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if struct ib_device_ops is defined],
+ib_device_ops_test, [
+       #include <rdma/ib_verbs.h>
+],[
+       int x = offsetof(struct ib_device_ops, unmap_fmr);
+       x = x;
+       (void)x;
+],[
+       AC_DEFINE(HAVE_IB_DEVICE_OPS, 1,
+               [if struct ib_device_ops is defined])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LN_IB_DEVICE_OPS_EXISTS
+
+#
+# LN_IB_SG_DMA_ADDRESS_EXISTS
+#
+# kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
+# IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
+# ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
+#
+AC_DEFUN([LN_IB_SG_DMA_ADDRESS_EXISTS], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if ib_sg_dma_address wrapper exists],
+ib_sg_dma_address_test, [
+       #include <rdma/ib_verbs.h>
+],[
+       u64 x = ib_sg_dma_address(NULL, NULL);
+       x = x;
+       (void)x;
+],[
+       AC_DEFINE(HAVE_IB_SG_DMA_ADDRESS, 1,
+               [if ib_sg_dma_address wrapper exists])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LN_IB_SG_DMA_ADDRESS_EXISTS
+
+#
 # LN_PROG_LINUX
 #
 # LNet linux kernel checks
@@ -723,14 +757,9 @@ AC_DEFUN([LN_PROG_LINUX], [
 AC_MSG_NOTICE([LNet kernel checks
 ==============================================================================])
 
-LN_CONFIG_AFFINITY
 LN_CONFIG_BACKOFF
 LN_CONFIG_O2IB
 LN_CONFIG_GNILND
-# 2.6.35
-LN_CONFIG_SK_SLEEP
-# 2.6.36
-LN_CONFIG_TCP_SENDPAGE
 # 3.10
 LN_EXPORT_KMAP_TO_PAGE
 # 3.15
@@ -739,6 +768,10 @@ LN_CONFIG_SK_DATA_READY
 LN_CONFIG_SOCK_CREATE_KERN
 # 4.11
 LN_CONFIG_SOCK_ACCEPT
+# 4.14
+LN_HAVE_ORACLE_OFED_EXTENSIONS
+# 4.17
+LN_CONFIG_SOCK_GETNAME
 ]) # LN_PROG_LINUX
 
 #