Added macro for iSER on RHEL7.6
[compat-rdma/compat.git] / config / rdma.m4
index 43581da..2b77c3c 100644 (file)
@@ -65,6 +65,22 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if kernel has ktime_get_boottime_ns])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ktime.h>
+       ],[
+               unsigned long long ns;
+
+               ns = ktime_get_boottime_ns();
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KTIME_GET_BOOTTIME_NS, 1,
+                         [ktime_get_boottime_ns defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if timekeeping.h has ktime_get_real_ns])
        LB_LINUX_TRY_COMPILE([
                #include <linux/ktime.h>
@@ -3942,6 +3958,23 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if scsi_host.h struct Scsi_Host has member virt_boundary_mask])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_host.h>
+       ],[
+               struct Scsi_Host sh = {
+                       .virt_boundary_mask = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_VIRT_BOUNDARY_MASK, 1,
+                               [Scsi_Host has members virt_boundary_mask])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if scsi_host.h struct scsi_host_template has member track_queue_depth])
        LB_LINUX_TRY_COMPILE([
                #include <scsi/scsi_host.h>
@@ -6387,6 +6420,21 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if linux/security.h has register_blocking_lsm_notifier])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/security.h>
+       ],[
+               register_blocking_lsm_notifier(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REGISTER_BLOCKING_LSM_NOTIFIER, 1,
+                         [linux/security.h has register_blocking_lsm_notifier])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if refcount.h exists])
        LB_LINUX_TRY_COMPILE([
                #include <linux/refcount.h>
@@ -8747,6 +8795,871 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        ],[
                AC_MSG_RESULT(no)
        ])
+       AC_MSG_CHECKING([if struct mm_struct has member atomic_pinned_vm])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm_types.h>
+       ],[
+               struct mm_struct x;
+                atomic64_t y;
+               x.pinned_vm = y;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ATOMIC_PINNED_VM, 1,
+                         [atomic_pinned_vm is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/ipv6_stubs.h exists])
+       LB_LINUX_TRY_COMPILE([
+                #include <net/ipv6_stubs.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IPV6_STUBS, 1,
+                         [net/ipv6_stubs.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h has nla_parse_deprecated ])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/netlink.h>
+       ],[
+               nla_parse_deprecated(NULL, 0, NULL, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NLA_PARSE_DEPRECATED, 1,
+                         [nla_parse_deprecated exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if xarray is defined])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/xarray.h>
+       ],[
+                struct xa_limit x;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_XARRAY, 1,
+                         [xa_array is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h alloc_netdev_mq has 4 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               alloc_netdev_mq(0, NULL, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ALLOC_NETDEV_MQ_4_PARAMS, 1,
+                         [alloc_netdev_mq has 4 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h alloc_netdev_mqs has 5 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               alloc_netdev_mqs(0, NULL, NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ALLOC_NETDEV_MQS_5_PARAMS, 1,
+                         [alloc_netdev_mqs has 5 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/pci-p2pdma.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci-p2pdma.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_P2PDMA_H, 1,
+                         [linux/pci-p2pdma.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if idr.h has ida_alloc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               ida_alloc(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDA_ALLOC, 1,
+                         [ida_alloc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/overflow.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/overflow.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_OVERFLOW_H, 1,
+                         [linux/overflow.h is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if route.h struct rtable has member rt_gw_family])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/route.h>
+       ],[
+               struct rtable x = {
+                       .rt_gw_family = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RT_GW_FAMILY, 1,
+                         [rt_gw_family is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if route.h struct rtable has member rt_uses_gateway])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/route.h>
+       ],[
+               struct rtable x = {
+                       .rt_uses_gateway = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RT_USES_GATEWAY, 1,
+                         [rt_uses_gateway is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([devlink_params_publish],
+               [net/core/devlink.c],
+               [AC_DEFINE(HAVE_DEVLINK_PARAMS_PUBLISHED, 1,
+                       [devlink_params_publish is exported by the kernel])],
+       [])
+       LB_CHECK_SYMBOL_EXPORT([split_page],
+               [mm/page_alloc.c],
+               [AC_DEFINE(HAVE_SPLIT_PAGE_EXPORTED, 1,
+                       [split_page is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([ip6_dst_hoplimit],
+                [net/ipv6/output_core.c],
+                [AC_DEFINE(HAVE_IP6_DST_HOPLIMIT, 1,
+                        [ip6_dst_hoplimit is exported by the kernel])],
+        [])
+
+       LB_CHECK_SYMBOL_EXPORT([udp4_hwcsum],
+               [net/ipv4/udp.c],
+               [AC_DEFINE(HAVE_UDP4_HWCSUM, 1,
+                       [udp4_hwcsum is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([__ip_dev_find],
+               [net/ipv4/devinet.c],
+               [AC_DEFINE(HAVE___IP_DEV_FIND, 1,
+                       [HAVE___IP_DEV_FIND is exported by the kernel])],
+       [])
+       LB_CHECK_SYMBOL_EXPORT([inet_confirm_addr],
+               [net/ipv4/devinet.c],
+               [AC_DEFINE(HAVE_INET_CONFIRM_ADDR_EXPORTED, 1,
+                       [inet_confirm_addr is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if tracepoint.h supports trace_event_raw_ib_mad_send_template])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/dma-mapping.h>
+               #include <linux/slab.h>
+               #include <linux/module.h>
+               #include <linux/security.h>
+               #include <linux/xarray.h>
+               #include <rdma/ib_cache.h>
+
+               #include "mad_priv.h"
+               #include "core_priv.h"
+               #include "mad_rmpp.h"
+               #include "smi.h"
+               #include "opa_smi.h"
+               #include "agent.h"
+
+               #include <trace/events/ib_mad.h>
+       ],[
+               #ifdef CONFIG_TRACEPOINTS
+               static void create_mad_addr_info(struct ib_mad_send_wr_private *mad_send_wr,
+                                        struct ib_mad_qp_info *qp_info,
+                                        struct trace_event_raw_ib_mad_send_template *entry)
+               {
+                      u16 pkey;
+                      struct ib_device *dev = qp_info->port_priv->device;
+                      u8 pnum = qp_info->port_priv->port_num;
+                      struct ib_ud_wr *wr = &mad_send_wr->send_wr;
+                      struct rdma_ah_attr attr = {};
+
+                      rdma_query_ah(wr->ah, &attr);
+
+                      /* These are common */
+                      entry->sl = attr.sl;
+                      ib_query_pkey(dev, pnum, wr->pkey_index, &pkey);
+                      entry->pkey = pkey;
+                      entry->rqpn = wr->remote_qpn;
+                      entry->rqkey = wr->remote_qkey;
+                      entry->dlid = rdma_ah_get_dlid(&attr);
+               }
+               #endif
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TRACE_EVENT_RAW_IB_MAD_SEND_TEMPLATE, 1,
+                         [trace_event_raw_ib_mad_send_template is supported])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h struct netlink_skb_parms has portid])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netlink.h>
+       ],[
+               struct netlink_skb_parms xx = {
+                       .portid = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETLINK_SKB_PARMS_PORTID, 1,
+                         [struct netlink_skb_parms has portid])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h has nla_nest_start_noflag])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/netlink.h>
+       ],[
+               nla_nest_start_noflag(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NLA_NEST_START_NOFLAG, 1,
+                         [nla_nest_start_noflag exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h has nlmsg_parse_deprecated ])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/netlink.h>
+       ],[
+               nlmsg_parse_deprecated(NULL, 0, NULL, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NLMSG_PARSE_DEPRECATED, 1,
+                         [nlmsg_parse_deprecated exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if idr.h has ida_alloc_max])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               ida_alloc_max(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDA_ALLOC_MAX, 1,
+                         [ida_alloc_max is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h has nlmsg_validate_deprecated ])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/netlink.h>
+       ],[
+               nlmsg_validate_deprecated(NULL, 0, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NLMSG_VALIDATE_DEPRECATED, 1,
+                         [nlmsg_validate_deprecated exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if fs.h has stream_open])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               stream_open(NULL, NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_STREAM_OPEN, 1,
+                       [fs.h has stream_open])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+
+       AC_MSG_CHECKING([if mm.h has mmget])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/mm.h>
+       ],[
+               mmget(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MMGET, 1,
+                       [mmget is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has mmget_not_zero])
+       LB_LINUX_TRY_COMPILE([
+                #include <linux/sched/mm.h>
+       ],[
+               mmget_not_zero(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MMGET_NOT_ZERO, 1,
+                       [mmget_not_zero is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has mmget_still_valid])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/mm.h>
+       ],[
+               mmget_still_valid(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MMGET_STILL_VALID, 1,
+                       [mmget_still_valid is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has mmgrab])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/mm.h>
+       ],[
+               mmgrab(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MMGRAB, 1,
+                       [mmgrab is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/sched.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCHED_H, 1,
+                         [linux/sched.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if sched/mm.h has mmget_not_zero])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/mm.h>
+       ],[
+               mmget_not_zero(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCHED_MMGET_NOT_ZERO, 1,
+                       [mmget_not_zero is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if vm_fault_t exist in mm_types.h])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm_types.h>
+       ],[
+               vm_fault_t a;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VM_FAULT_T, 1,
+                         [vm_fault_t is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if uaccess.h access_ok has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/uaccess.h>
+       ],[
+               access_ok(0, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ACCESS_OK_HAS_3_PARAMS, 1,
+                         [access_okhas 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/atomic.h has __atomic_add_unless])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/highmem.h>
+       ],[
+               atomic_t x;
+               __atomic_add_unless(&x, 1, 1);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE___ATOMIC_ADD_UNLESS, 1,
+                         [__atomic_add_unless is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/atomic.h has atomic_fetch_add_unless])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/highmem.h>
+       ],[
+               atomic_t x;
+               atomic_fetch_add_unless(&x, 1, 1);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ATOMIC_FETCH_ADD_UNLESS, 1,
+                         [atomic_fetch_add_unless is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/cgroup_rdma.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/cgroup_rdma.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_CGROUP_RDMA_H, 1,
+                         [linux/cgroup_rdma exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if idr.h has ida_simple_get])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               ida_simple_get(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDA_SIMPLE_GET, 1,
+                         [ida_simple_get is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if idr.h has idr_for_each_entry])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+                int id;
+               void * entry;
+               struct idr * tmp_idr;
+               idr_for_each_entry(tmp_idr, entry, id);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDR_FOR_EACH_ENTRY, 1,
+                         [idr_for_each_entry is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h has pci_irq_get_affinity])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_irq_get_affinity(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_IRQ_GET_AFFINITY, 1,
+                         [pci_irq_get_affinity is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
+               [kernel/crash_dump.c],
+               [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
+                       [elfcorehdr_addr is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([fib_lookup],
+               [net/ipv4/fib_rules.c],
+               [AC_DEFINE(HAVE_FIB_LOOKUP_EXPORTED, 1,
+                       [fib_lookup is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([idr_get_next_ul],
+               [lib/idr.c],
+               [AC_DEFINE(HAVE_IDR_GET_NEXT_UL_EXPORTED, 1,
+                       [idr_get_next_ul is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([idr_get_next],
+               [lib/idr.c],
+               [AC_DEFINE(HAVE_IDR_GET_NEXT_EXPORTED, 1,
+                       [idr_get_next is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if pci.h has pci_irq_get_affinity])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_irq_get_affinity(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_IRQ_GET_AFFINITY, 1,
+                         [pci_irq_get_affinity is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
+               [kernel/crash_dump.c],
+               [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
+                       [elfcorehdr_addr is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([fib_lookup],
+               [net/ipv4/fib_rules.c],
+               [AC_DEFINE(HAVE_FIB_LOOKUP_EXPORTED, 1,
+                       [fib_lookup is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([idr_get_next_ul],
+               [lib/idr.c],
+               [AC_DEFINE(HAVE_IDR_GET_NEXT_UL_EXPORTED, 1,
+                       [idr_get_next_ul is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([idr_get_next],
+               [lib/idr.c],
+               [AC_DEFINE(HAVE_IDR_GET_NEXT_EXPORTED, 1,
+                       [idr_get_next is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if idr.h has idr_preload_end])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               idr_preload_end();
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDR_PRELOAD_END, 1,
+                         [idr_preload_end is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if smp_load_acquire is defined])
+       LB_LINUX_TRY_COMPILE([
+               #include <asm-generic/barrier.h>
+       ],[
+               u32 x;
+               smp_load_acquire(&x);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SMP_LOAD_ACQUIRE, 1,
+                         [smp_load_acquire is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([idr_preload],
+               [lib/radix-tree.c],
+               [AC_DEFINE(HAVE_IDR_PRELOAD_EXPORTED, 1,
+                       [idr_preload is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([radix_tree_iter_delete],
+               [lib/radix-tree.c],
+               [AC_DEFINE(HAVE_RADIX_TREE_ITER_DELETE_EXPORTED, 1,
+                       [radix_tree_iter_delete is exported by the kernel])],
+       [])
+       LB_CHECK_SYMBOL_EXPORT([kobj_ns_grab_current],
+               [lib/kobject.c],
+               [AC_DEFINE(HAVE_KOBJ_NS_GRAB_CURRENT_EXPORTED, 1,
+                       [kobj_ns_grab_current is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if mm.h struct vm_operations_struct has .fault])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+               static vm_fault_t rdma_umap_fault(struct vm_fault *vmf) {
+                       return NULL;
+               }
+
+       ],[
+               struct vm_operations_struct rdma_umap_ops = {
+                       .fault = rdma_umap_fault,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VM_OPERATIONS_STRUCT_HAS_FAULT, 1,
+                         [vm_operations_struct has .fault])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if radix-tree.h has radix_tree_iter_lookup])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/radix-tree.h>
+       ],[
+               radix_tree_iter_lookup(NULL, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RADIX_TREE_ITER_LOOKUP, 1,
+               [radix_tree_iter_lookup is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if device.h struct class has member class_groups])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/device.h>
+               #include <linux/sysfs.h>
+       ],[
+               static struct attribute *umad_class_attrs[] = {
+                       NULL,
+               };
+               ATTRIBUTE_GROUPS(umad_class);
+
+               struct class x = {
+                       .class_groups = umad_class_groups,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_CLASS_GROUPS, 1,
+                         [class_groups is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has want_init_on_alloc])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/mm.h>
+       ],[
+               gfp_t flags = __GFP_ZERO;
+               want_init_on_alloc(flags);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_WANT_INIT_ON_ALLOC, 1,
+               [want_init_on_alloc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has FOLL_LONGTERM])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               int x = FOLL_LONGTERM;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_FOLL_LONGTERM, 1,
+                       [FOLL_LONGTERM is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if get_user_pages has 7 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               unsigned long start;
+               unsigned long nr_pages;
+               unsigned int gup_flags;
+               struct page **page_list;
+               struct vm_area_struct **vmas;
+               int ret;
+
+               ret = get_user_pages(NULL, NULL, start, nr_pages, gup_flags,
+                                       page_list, vmas);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_7_PARAMS, 1,
+                       [get_user_pages has 7 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if radix-tree.h has radix_tree_iter_delete])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/radix-tree.h>
+       ],[
+               radix_tree_iter_delete(NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RADIX_TREE_ITER_DELETE, 1,
+               [radix_tree_iter_delete is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has put_user_page])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               struct page *page;
+
+               put_user_page(page);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PUT_USER_PAGE, 1,
+                       [put_user_page is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h dev_change_flags has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               dev_change_flags(NULL, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEV_CHANGE_FLAGS_HAS_3_PARAMS, 1,
+                         [dev_change_flags has 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device has close_list])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev = NULL;
+               struct list_head xlist;
+
+               dev->close_list = xlist;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DEVICE_HAS_CLOSE_LIST, 1,
+                         [net_device close_list is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device has needs_free_netdev])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev = NULL;
+
+               dev->needs_free_netdev = true;
+               dev->priv_destructor = NULL;
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DEVICE_NEEDS_FREE_NETDEV, 1,
+                         [net_device needs_free_netdev is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has kvcalloc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               kvcalloc(0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KVCALLOC, 1,
+                       [kvcalloc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
 ])
 #
 # COMPAT_CONFIG_HEADERS