Added macro for iSER on RHEL7.6
[compat-rdma/compat.git] / config / rdma.m4
index cc10449..2b77c3c 100644 (file)
@@ -1,141 +1,3 @@
-dnl Checks for the in-box ib_core
-AC_DEFUN([RDMA_CONFIG_COMPAT],
-[
-       AC_MSG_CHECKING([if ib_verbs has ib_dma_map_single])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <linux/pci.h>
-               #include <linux/gfp.h>
-               #include <rdma/ib_verbs.h>
-       ],[
-               ib_dma_map_single(NULL, NULL, 0, 0);
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_IB_DMA_MAP, 1,
-                         [ib_dma_map_single defined])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if ib_create_cq wants comp_vector])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <linux/pci.h>
-               #include <linux/gfp.h>
-               #include <rdma/ib_verbs.h>
-       ],[
-               ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_IB_COMP_VECTOR, 1,
-                         [has completion vector])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_ADDR_CHANGE])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <linux/pci.h>
-               #include <linux/gfp.h>
-               #include <rdma/rdma_cm.h>
-       ],[
-               return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_RDMA_CMEV_ADDRCHANGE, 1,
-                         [has completion vector])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_TIMEWAIT_EXIT])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <linux/pci.h>
-               #include <linux/gfp.h>
-               #include <rdma/rdma_cm.h>
-       ],[
-               return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_RDMA_CMEV_TIMEWAIT_EXIT, 1,
-                         [has completion vector])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if rdma_cm has rdma_set_reuseaddr])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <linux/pci.h>
-               #include <linux/gfp.h>
-               #include <rdma/rdma_cm.h>
-       ],[
-               rdma_set_reuseaddr(NULL, 1);
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_RDMA_SET_REUSEADDR, 1,
-                         [rdma_set_reuse defined])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if struct ib_wc has member named ts])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <rdma/ib_verbs.h>
-       ],[
-        struct ib_wc wc;
-        wc->ts.timestamp = 0;
-
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_IB_WC_TS, 1,
-                         [ib_wc has member named ts])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if struct ib_ah_attr has member named dmac])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <rdma/ib_verbs.h>
-       ],[
-        struct ib_ah_attr *ah_attr;
-        memset(ah_attr->dmac, 0, 6);
-
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_DMAC, 1,
-                         [ah_attr has member named dmac])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
-       AC_MSG_CHECKING([if struct ib_ah_attr has member named vlan_id])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/version.h>
-               #include <rdma/ib_verbs.h>
-       ],[
-        struct ib_ah_attr *ah_attr;
-        ah_attr->vlan_id = 0;
-
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_VLAN_ID, 1,
-                         [ah_attr has member named vlan_id])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
 dnl Examine kernel functionality
 AC_DEFUN([LINUX_CONFIG_COMPAT],
 [
@@ -203,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>
@@ -219,6 +97,24 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if time.h has time64_to_tm])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/time.h>
+       ],[
+               struct tm tm;
+               time64_t now = 0;
+
+               time64_to_tm(now, 0, &tm);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TIME64_TO_TM, 1,
+                         [time64_to_tm is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if svc_xprt_class has xcl_ident])
        LB_LINUX_TRY_COMPILE([
                #include <linux/sunrpc/xprt.h>
@@ -254,6 +150,21 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if netdev_master_upper_dev_link gets 4 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               netdev_master_upper_dev_link(NULL, NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(NETDEV_MASTER_UPPER_DEV_LINK_4_PARAMS, 1,
+                         [netdev_master_upper_dev_link gets 4 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
        LB_LINUX_TRY_COMPILE([
                #include <linux/ethtool.h>
@@ -381,6 +292,24 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_fec_param])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_fec_param = NULL,
+                       .set_fec_param = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_FEC, 1,
+                         [get/set_fec_param is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if struct net_device has dev_port])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -398,6 +327,23 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if netdev_extended has dev_port])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev = NULL;
+
+               netdev_extended(dev)->dev_port = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_EXTENDED_DEV_PORT, 1,
+                         [ is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
        LB_LINUX_TRY_COMPILE([
                #include <linux/ptp_clock_kernel.h>
@@ -886,6 +832,36 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if netdevice.h has __dev_uc_sync])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               __dev_uc_sync(NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE___DEV_UC_SYNC, 1,
+                         [__dev_uc_sync is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has __dev_mc_sync])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               __dev_mc_sync(NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE___DEV_MC_SYNC, 1,
+                         [__dev_mc_sync is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -1436,6 +1412,21 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if struct net_device_ops_extended exist])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_extended ops_extended;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DEVICE_OPS_EXTENDED, 1,
+                         [struct net_device_ops_extended is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -2160,6 +2151,20 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if idr.h has idr_is_empty])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               bool x = idr_is_empty(NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDR_IS_EMPTY, 1,
+                         [idr_is_empty is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if completion.h has reinit_completion])
        LB_LINUX_TRY_COMPILE([
                #include <linux/completion.h>
@@ -2257,6 +2262,23 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        ])
 
        # timecounter_adjtime can be in timecounter.h or clocksource.h
+       AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/timecounter.h>
+       ],[
+               struct timecounter x;
+               s64 y = 0;
+               timecounter_adjtime(&x, y);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
+                         [timecounter_adjtime is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
        LB_LINUX_TRY_COMPILE([
                #include <linux/clocksource.h>
@@ -2373,6 +2395,22 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        ],[
                AC_MSG_RESULT(no)
        ])
+       
+       AC_MSG_CHECKING([if linux/dma-mapping.h has dma_map_page_attrs])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/dma-mapping.h>
+       ],[
+               dma_addr_t addr;
+               addr = dma_map_page_attrs(NULL, NULL, 0, 0, 0, 0);
+               return addr;
+
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DMA_MAP_PAGE_ATTRS, 1,
+                         [dma_map_page_attrs is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
 
        AC_MSG_CHECKING([if pci.h has pcie_get_minimum_link])
        LB_LINUX_TRY_COMPILE([
@@ -2455,21 +2493,6 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
-       AC_MSG_CHECKING([if mm.h get_user_pages has 6 params])
-       LB_LINUX_TRY_COMPILE([
-               #include <linux/mm.h>
-       ],[
-               get_user_pages(0, 0, 0, 0, NULL, NULL);
-
-               return 0;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_GET_USER_PAGES_6_PARAMS, 1,
-                         [get_user_pages has 6 params])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
        AC_MSG_CHECKING([if mm.h get_user_pages_remote])
        LB_LINUX_TRY_COMPILE([
                #include <linux/mm.h>
@@ -2713,6 +2736,23 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops x = {
+                       .ndo_setup_tc = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
+                         [ndo_setup_tc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if ndo_setup_tc takes 4 parameters])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -3010,6 +3050,12 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       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 netdevice.h has netdev_rss_key_fill])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -3046,6 +3092,23 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if struct ifla_vf_stats has rx_dropped])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_link.h>
+       ],[
+               struct ifla_vf_stats stat = {
+                       .rx_dropped = 0,
+                       };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IFLA_VF_STATS_RX_DROPPED, 1,
+                         [struct ifla_vf_stats has rx_dropped])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if struct net_device_ops has ndo_set_vf_guid])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -3112,11 +3175,28 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
-       AC_MSG_CHECKING([if firmware.h has request_firmware_direct])
+       AC_MSG_CHECKING([if struct xdp_buff has rxq])
        LB_LINUX_TRY_COMPILE([
-               #include <linux/firmware.h>
+               #include <linux/filter.h>
        ],[
-               (void)request_firmware_direct(NULL, NULL, NULL);
+               struct xdp_buff x = {
+                       .rxq = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_XDP_BUFF_RXQ, 1,
+                         [struct xdp_buff has rxq])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if firmware.h has request_firmware_direct])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/firmware.h>
+       ],[
+               (void)request_firmware_direct(NULL, NULL, NULL);
 
                return 0;
        ],[
@@ -3251,21 +3331,6 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
-       AC_MSG_CHECKING([if net/pkt_cls.h has hardware flower offload support])
-       LB_LINUX_TRY_COMPILE([
-               #include <net/pkt_cls.h>
-       ],[
-               struct tc_cls_flower_offload offload = {0};
-
-               return &offload;
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_HW_FLOWER_OFFLOAD_SUPPORT, 1,
-                         [firmware.h has hardware flower offload support])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-
        AC_MSG_CHECKING([if linux/netdev_features.h has tc offload feature])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
@@ -3396,6 +3461,23 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if if_link.h has IFLA_VF_IB_NODE_PORT_GUID])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_link.h>
+       ],[
+               int type = IFLA_VF_IB_NODE_GUID;
+
+               type = IFLA_VF_IB_PORT_GUID;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IFLA_VF_IB_NODE_PORT_GUID, 1,
+                         [trust is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if skbuff.h skb_shared_info has UNION tx_flags])
        LB_LINUX_TRY_COMPILE([
                #include <linux/skbuff.h>
@@ -3415,6 +3497,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        AC_MSG_CHECKING([if nelems is atomic_t in struct rhashtable])
        LB_LINUX_TRY_COMPILE([
                #include <linux/atomic.h>
+               #include <linux/poison.h>
                #include <linux/rhashtable.h>
        ],[
                struct rhashtable *ht;
@@ -3435,6 +3518,12 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                        [pat_enabled is exported by the kernel])],
        [])
 
+       LB_CHECK_SYMBOL_EXPORT([xprt_put],
+               [net/sunrpc/xprt.c],
+               [AC_DEFINE(HAVE_XPRT_PUT_EXPORTED, 1,
+                       [xprt_put is exported by the kernel])],
+       [])
+
        AC_MSG_CHECKING([if configfs.h default_groups is list_head])
        LB_LINUX_TRY_COMPILE([
                #include <linux/configfs.h>
@@ -3452,6 +3541,6125 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if ethtool.h enum ethtool_link_mode_bit_indices has ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT])
+       LB_LINUX_TRY_COMPILE([
+               #include <uapi/linux/ethtool.h>
+       ],[
+               enum ethtool_link_mode_bit_indices x = ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT, 1,
+                         [ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ethtool.h enum ethtool_link_mode_bit_indices has ETHTOOL_LINK_MODE_10000baseSR_Full_BIT])
+       LB_LINUX_TRY_COMPILE([
+               #include <uapi/linux/ethtool.h>
+       ],[
+               enum ethtool_link_mode_bit_indices x = ETHTOOL_LINK_MODE_10000baseSR_Full_BIT;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ETHTOOL_LINK_MODE_10000baseSR_Full_BIT, 1,
+                         [ETHTOOL_LINK_MODE_10000baseSR_Full_BIT is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/net/flow_dissector.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/flow_dissector.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_FLOW_DISSECTOR_H, 1,
+                         [include/net/flow_dissector.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/linux/dcache.h has d_inode])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/dcache.h>
+       ],[
+               struct inode *inode = d_inode(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_D_INODE, 1,
+                       [d_inode is defined in dcache.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/pkt_cls.h has tcf_exts_to_list])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               tcf_exts_to_list(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_EXTS_TO_LIST, 1,
+                         [tcf_exts_to_list is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/act_api.h has tcf_action_stats_update])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/act_api.h>
+       ],[
+               tcf_action_stats_update(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_ACTION_STATS_UPDATE, 1,
+                         [tcf_action_stats_update is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_mirred.h has is_tcf_mirred_redirect])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_mirred.h>
+       ],[
+               is_tcf_mirred_redirect(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IS_TCF_MIRRED_REDIRECT, 1,
+                         [is_tcf_mirred_redirect is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_mirred.h has tcf_mirred_dev])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_mirred.h>
+       ],[
+               tcf_mirred_dev(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_MIRRED_DEV, 1,
+                         [tcf_mirred_dev is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if enum tc_fl_command has TC_CLSFLOWER_STATS])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               enum tc_fl_command x = TC_CLSFLOWER_STATS;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_CLSFLOWER_STATS, 1,
+                         [TC_CLSFLOWER_STATS is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if time64.h has ns_to_timespec64])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/clocksource.h>
+               #include <linux/time64.h>
+       ],[
+               ns_to_timespec64(0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NS_TO_TIMESPACE64, 1,
+                         [ns_to_timespec64 is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ptp_clock_info exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ptp_clock_kernel.h>
+       ],[
+               struct ptp_clock_info info;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PTP_CLOCK_INFO, 1,
+                         [ptp_clock_info is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ptp_clock_info has gettime])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ptp_clock_kernel.h>
+       ],[
+               struct ptp_clock_info info = {
+                       .gettime = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PTP_CLOCK_INFO_GETTIME_32BIT, 1,
+                         [gettime 32bit is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ethtool.h has get_module_eeprom])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               struct ethtool_ops x = {
+                       .get_module_eeprom = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_MODULE_EEPROM, 1,
+                         [HAVE_GET_MODULE_EEPROM is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ethtool.h has get_module_eeprom])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               struct ethtool_ops_ext x = {
+                       .get_module_eeprom = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_MODULE_EEPROM_EXT, 1,
+                       [HAVE_GET_MODULE_EEPROM_EXT is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has napi_complete_done])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               napi_complete_done(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NAPI_COMPLETE_DONE, 1,
+                         [napi_complete_done is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ethtool_ext has set_phys_id])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops_ext en_ethtool_ops_ext = {
+                       .set_phys_id = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SET_PHYS_ID_EXT, 1,
+                         [set_phys_id is defined in ethtool_ops_ext])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct tc_cls_flower_offload exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               struct tc_cls_flower_offload x;
+               x = x;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_FLOWER_OFFLOAD, 1,
+                         [struct tc_cls_flower_offload is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct tc_cls_common_offload exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               struct tc_cls_common_offload common;
+               common = common;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_CLS_COMMON_OFFLOAD, 1,
+                         [tc_cls_common_offload is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if if_vlan.h has vlan_features_check])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_vlan.h>
+       ],[
+               vlan_features_check(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VLAN_FEATURES_CHECK, 1,
+                         [vlan_features_check is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_iflink])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops x = {
+                       .ndo_get_iflink = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_GET_IFLINK, 1,
+                         [ndo_get_iflink is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if if_vlan.h has __vlan_get_protocol])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_vlan.h>
+       ],[
+               __vlan_get_protocol(NULL, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VLAN_GET_PROTOCOL, 1,
+                         [__vlan_get_protocol defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if if_vlan.h has skb_vlan_tagged])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_vlan.h>
+       ],[
+               skb_vlan_tagged(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SKB_VLAN_TAGGED, 1,
+                         [skb_vlan_tagged defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netdev_notifier_changeupper_info])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct netdev_notifier_changeupper_info info;
+
+               info.master = 1;
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_NOTIFIER_CHANGEUPPER_INFO, 1,
+                         [netdev_notifier_changeupper_info is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blk-mq.h has blk_mq_unique_tag])
+       LB_LINUX_TRY_COMPILE([
+               #include <blk-mq.h>
+       ],[
+               blk_mq_unique_tag(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_UNIQUE_TAG, 1,
+                               [blk_mq_unique_tag exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blk_queue_virt_boundary exist])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_queue_virt_boundary(NULL, 0);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_VIRT_BOUNDARY, 1,
+                               [blk_queue_virt_boundary exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h has scsi_change_queue_depth])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+       ],[
+               scsi_change_queue_depth(NULL, 0);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSCI_CHANGE_QUEUE_DEPTH, 1,
+                       [scsi_change_queue_depth exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_host.h struct Scsi_Host has member nr_hw_queues])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_host.h>
+       ],[
+               struct Scsi_Host sh = {
+                       .nr_hw_queues = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_NR_HW_QUEUES, 1,
+                               [Scsi_Host has members nr_hw_queues])
+       ],[
+               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>
+       ],[
+               struct scsi_host_template sh = {
+                       .track_queue_depth = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_TEMPLATE_TRACK_QUEUE_DEPTH, 1,
+                       [scsi_host_template has members track_queue_depth])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h has SCSI_SCAN_INITIAL])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+       ],[
+               int x = SCSI_SCAN_INITIAL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_SCAN_INITIAL, 1,
+                         [SCSI_SCAN_INITIAL is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi.h has SG_MAX_SEGMENTS])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi.h>
+       ],[
+               int x = SG_MAX_SEGMENTS;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SG_MAX_SEGMENTS, 1,
+                         [SG_MAX_SEGMENTS is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct file_operations has write_iter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               const struct file_operations fo = {
+                       .write_iter = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_FILE_OPS_WRITE_ITER, 1,
+                       [write_iter is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/fs.h has inode_lock])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               inode_lock(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_INODE_LOCK, 1,
+                       [inode_lock is defined in fs.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/dcache.h has simple_positive])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/dcache.h>
+       ],[
+               int i = simple_positive(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SIMPLE_POSITIVE, 1,
+                       [simple_positive is defined in dcache.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if __GFP_RECLAIM is defined])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/gfp.h>
+       ],[
+               gfp_t rc = __GFP_RECLAIM;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GFP_RECLAIM, 1,
+                       [__GFP_RECLAIM is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has napi_schedule_irqoff])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               napi_schedule_irqoff(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NAPI_SCHEDULE_IRQOFF, 1,
+                         [napi_schedule_irqoff is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if skbuff.h has dev_alloc_pages])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+               dev_alloc_pages(0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEV_ALLOC_PAGES, 1,
+                         [dev_alloc_pages is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if skbuff.h has napi_alloc_skb])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+               napi_alloc_skb(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NAPI_ALLOC_SKB, 1,
+                         [napi_alloc_skb is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+    AC_MSG_CHECKING([if netlink.h has netlink_capable])
+    LB_LINUX_TRY_COMPILE([
+            #include <linux/netlink.h>
+    ],[
+            bool b = netlink_capable(NULL, 0);
+
+            return 0;
+    ],[
+            AC_MSG_RESULT(yes)
+            AC_DEFINE(HAVE_NETLINK_CAPABLE, 1,
+                      [netlink_capable is defined])
+    ],[
+            AC_MSG_RESULT(no)
+    ])
+
+       AC_MSG_CHECKING([if netlink.h netlink_skb_parms has sk])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netlink.h>
+       ],[
+               struct netlink_skb_parms nsp = {
+                       .sk = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETLINK_SKB_PARMS_SK, 1,
+                         [netlink_skb_params has sk])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/etherdevice.h>
+       ],[
+               ether_addr_copy(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
+                         [ether_addr_copy is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has get/set ets and dcbnl defined])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+               #include <net/dcbnl.h>
+       ],[
+               const struct dcbnl_rtnl_ops en_dcbnl_ops = {
+                       .ieee_getets = NULL,
+                       .ieee_setets = NULL,
+               };
+
+               struct net_device dev = {
+                       .dcbnl_ops = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IEEE_DCBNL_ETS, 1,
+                         [ieee_getets/ieee_setets is defined and dcbnl defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if kernel.h has reciprocal_scale])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/kernel.h>
+       ],[
+               reciprocal_scale(0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RECIPROCAL_SCALE, 1,
+                         [reciprocal_scale is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if libiscsi.h struct iscsi_session has member discovery_sess])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/libiscsi.h>
+       ],[
+               struct iscsi_session iscsi_sess = {
+                       .discovery_sess = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DISCOVERY_SESSION, 1,
+                         [discovery_sess is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if iscsi_proto.h has structure iscsi_cmd])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/iscsi_proto.h>
+       ],[
+               struct iscsi_cmd hdr;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ISCSI_CMD, 1,
+                         [iscsi_proto.h has structure iscsi_cmd])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h struct scsi_device has u64 lun])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+       ],[
+               struct scsi_device sdev = {
+                       .lun = 0,
+               };
+
+               pr_err("lun %llu", sdev.lun);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_DEVICE_U64_LUN, 1,
+                         [scsi_device.h struct scsi_device has u64 lun])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_transport_iscsi.h struct iscsi_transport has member check_protection])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_transport_iscsi.h>
+       ],[
+               struct iscsi_transport iscsi_iser_transport = {
+                       .check_protection = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ISCSI_TRANSPORT_CHECK_PROTECTION, 1,
+                         [check_protection is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+    AC_MSG_CHECKING([if iscsi_transport.h struct iscsit_transport has member iscsit_get_sup_prot_ops])
+       LB_LINUX_TRY_COMPILE([
+               #include <target/iscsi/iscsi_transport.h>
+
+               enum target_prot_op get_sup_prot_ops(struct iscsi_conn *conn)
+               {
+                       return 0;
+               }
+
+       ],[
+               struct iscsit_transport it = {
+                       .iscsit_get_sup_prot_ops = get_sup_prot_ops,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ISCSIT_TRANSPORT_HAS_GET_SUP_PROT_OPS, 1,
+                       [iscsit_transport has member iscsit_get_sup_prot_ops])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if highmem.h has kmap_atomic function with km_type])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/highmem.h>
+       ],[
+               kmap_atomic(NULL, KM_USER0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KM_TYPE, 1,
+                         [highmem.h has kmap_atomic function with km_type])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has flag QUEUE_FLAG_SG_GAPS])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               int flag = QUEUE_FLAG_SG_GAPS;
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_QUEUE_FLAG_SG_GAPS, 1,
+                       [blkdev.h has flag QUEUE_FLAG_SG_GAPS])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h has scsi_change_queue_depth])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+       ],[
+               scsi_change_queue_depth(NULL, 0);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_CHANGE_QUEUE_DEPTH, 1,
+                       [scsi_change_queue_depth exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_cmnd.h struct scsi_cmnd  has member prot_flags])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_cmnd.h>
+       ],[
+               struct scsi_cmnd sc = {
+                       .prot_flags = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_CMND_PROT_FLAGS, 1,
+                       [scsi_cmnd has members prot_flags])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_host.h struct scsi_host_template has member change_queue_type])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_host.h>
+       ],[
+               struct scsi_host_template sh = {
+                       .change_queue_type = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_TEMPLATE_CHANGE_QUEUE_TYPE, 1,
+                       [scsi_host_template has members change_queue_type])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_host.h struct scsi_host_template has member use_blk_tags])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_host.h>
+       ],[
+               struct scsi_host_template sh = {
+                       .use_blk_tags = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_TEMPLATE_USE_BLK_TAGS, 1,
+                       [scsi_host_template has members use_blk_tags])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_host.h struct scsi_host_template has member use_host_wide_tags])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_host.h>
+       ],[
+               struct scsi_host_template sh = {
+                       .use_host_wide_tags = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_TEMPLATE_USE_HOST_WIDE_TAGS, 1,
+                       [scsi_host_template has members use_host_wide_tags])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_host.h struct Scsi_Host has member use_blk_mq])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_host.h>
+       ],[
+               struct Scsi_Host sh = {
+                       .use_blk_mq = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_HOST_USE_BLK_MQ, 1,
+                               [Scsi_Host has members use_blk_mq])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_tcq.h has function scsi_change_queue_type])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_tcq.h>
+       ],[
+               scsi_change_queue_type(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_TCQ_SCSI_CHANGE_QUEUE_TYPE, 1,
+                       [scsi_tcq.h has function scsi_change_queue_type])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_tcq.h has function scsi_init_shared_tag_map])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_tcq.h>
+       ],[
+               scsi_init_shared_tag_map(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_TCQ_SCSI_INIT_SHARED_TAG_MAP, 1,
+                       [scsi_tcq.h has function scsi_init_shared_tag_map])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_transfer_length is defind])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_cmnd.h>
+       ],[
+               scsi_transfer_length(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_TRANSFER_LENGTH, 1,
+                         [scsi_transfer_length is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if MIN_NICE is defined in prio.h])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/prio.h>
+       ],[
+               long nice = MIN_NICE;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MIN_NICE, 1,
+                       [MIN_NICE is defined in prio.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if has netdev_notifier_info_to_dev])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/netdevice.h>
+       ],[
+               return netdev_notifier_info_to_dev(NULL) ? 1 : 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_NOTIFIER_INFO_TO_DEV, 1,
+                       [netdev_notifier_info_to_dev is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has struct netdev_notifier_info])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct netdev_notifier_info x = {
+                       .dev = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_NOTIFIER_INFO, 1,
+                         [struct netdev_notifier_info is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has register_netdevice_notifier_rh])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/netdevice.h>
+       ],[
+               return register_netdevice_notifier_rh(NULL);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REGISTER_NETDEVICE_NOTIFIER_RH, 1,
+                       [register_netdevice_notifier_rh is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if has pci_is_bridge])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/pci.h>
+       ],[
+               return pci_is_bridge(NULL);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_IS_BRIDGE, 1,
+                       [pci_is_bridge is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ifla_vf_info has vlan_proto])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_link.h>
+       ],[
+               struct ifla_vf_info *ivf;
+
+               ivf->vlan_proto = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VF_VLAN_PROTO, 1,
+                         [vlan_proto is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if alloc_etherdev_mq is defined])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/etherdevice.h>
+       ],[
+               alloc_etherdev_mq(0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ALLOC_ETHERDEV_MQ, 1,
+                         [alloc_etherdev_mq is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops has ndo_get_phys_port_name])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops ndops = {
+                       .ndo_get_phys_port_name = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_GET_PHYS_PORT_NAME, 1,
+                         [ndo_get_phys_port_name is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops has ndo_set_vf_vlan])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops netdev_ops = {
+                       .ndo_set_vf_vlan = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SET_VF_VLAN, 1,
+                         [ndo_set_vf_vlan is defined in net_device_ops])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops has ndo_change_mtu_rh74])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops netdev_ops = {
+                       .ndo_change_mtu_rh74 = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_CHANGE_MTU_RH74, 1,
+                         [ndo_change_mtu_rh74 is defined in net_device_ops])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has ndo_set_vf_vlan])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_extended netdev_ops_extended = {
+                       .ndo_set_vf_vlan = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SET_VF_VLAN_EXTENDED, 1,
+                         [ndo_set_vf_vlan is defined in net_device_ops_extended])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_features])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_ext netdev_ops_ext;
+
+               netdev_ops_ext.ndo_set_features = NULL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_FEATURES, 1,
+                         [ndo_set_features is defined in net_device_ops_ext])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_device_ops_ext has ndo_fix_features])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_ext netdev_ops_ext;
+
+               netdev_ops_ext.ndo_fix_features = NULL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_FIX_FEATURES, 1,
+                         [ndo_fix_features is defined in net_device_ops_ext])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netif_set_real_num_tx_queues])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device dev;
+               netif_set_real_num_tx_queues(&dev, 2);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETIF_SET_REAL_NUM_TX_QUEUES, 1,
+                         [netif_set_real_num_tx_queues is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h get_user_pages has 8 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               get_user_pages(NULL, NULL, 0, 0, 0, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_8_PARAMS, 1,
+                       [get_user_pages has 8 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if get_user_pages uses gup flags])
+       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(start, nr_pages, gup_flags, page_list,
+                                       vmas);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_GUP_FLAGS, 1,
+                       [get_user_pages uses gup_flags])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm has get_user_pages_remote with 7 parameters])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/mm.h>
+       ],[
+               get_user_pages_remote(NULL, NULL, 0, 0, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_REMOTE_7_PARAMS, 1,
+                       [get_user_pages_remote is defined with 7 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm has get_user_pages_remote with 8 parameters])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/mm.h>
+       ],[
+               get_user_pages_remote(NULL, NULL, 0, 0, 0, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_REMOTE_8_PARAMS, 1,
+                       [get_user_pages_remote is defined with 8 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm has get_user_pages_remote with 8 parameters with locked])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/mm.h>
+       ],[
+               get_user_pages_remote(NULL, NULL, 0, 0, 0, NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_REMOTE_8_PARAMS_W_LOCKED, 1,
+                       [get_user_pages_remote is defined with 8 parameters with locked])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_device_ops has *ndo_get_stats64 that returns void])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               void get_stats_64(struct net_device *dev,
+                                                 struct rtnl_link_stats64 *storage)
+               {
+                       return;
+               }
+       ],[
+               struct net_device_ops netdev_ops;
+
+               netdev_ops.ndo_get_stats64 = get_stats_64;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_GET_STATS64_RET_VOID, 1,
+                         [ndo_get_stats64 is defined and returns void])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h has function scsi_internal_device_block])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+       ],[
+               scsi_internal_device_block(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_DEVICE_SCSI_INTERNAL_DEVICE_BLOCK, 1,
+                       [scsi_device.h has function scsi_internal_device_block])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device has max_mtu])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev = NULL;
+
+               dev->max_mtu = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DEVICE_MAX_MTU, 1,
+                         [max_mtu is in struct net_device])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/sched/task.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/task.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_SCHED_TASK_H, 1,
+                         [linux/sched/task.h is exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h has struct netlink_ext_ack])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netlink.h>
+       ],[
+               struct netlink_ext_ack x;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETLINK_EXT_ACK, 1,
+                         [struct netlink_ext_ack is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if device.h struct device has dma_ops])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/device.h>
+       ],[
+               struct device devx = {
+                       .dma_ops = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVICE_DMA_OPS, 1,
+                         [struct device has dma_ops])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if rtnetlink.h has net_rwsem])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/rtnetlink.h>
+               #include <linux/rwsem.h>
+       ],[
+               down_read(&net_rwsem);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_RWSEM, 1,
+                       [ net_rwsem is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netlink.h nla_parse takes 6 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/netlink.h>
+       ],[
+               nla_parse(NULL, 0, NULL, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NLA_PARSE_6_PARAMS, 1,
+                         [nla_parse takes 6 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/netlink.h has nla_put_u64_64bit])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/netlink.h>
+       ],[
+               nla_put_u64_64bit(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NLA_PUT_U64_64BIT, 1,
+                         [nla_put_u64_64bit is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/sched/task.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/task.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCHED_TASK_H, 1,
+                         [linux/sched/task.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/mm.h has get_user_pages_longterm])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               get_user_pages_longterm(0, 0, 0, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_USER_PAGES_LONGTERM, 1,
+                       [get_user_pages_longterm is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if rt6_lookup has 6 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/ip6_route.h>
+       ],[
+               rt6_lookup(NULL, NULL, NULL, 0, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RT6_LOOKUP_6_PARAMS, 1,
+                         [rt6_lookup has 6 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has *ndo_chane_mtu_extended])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_extended x = {
+                       .ndo_change_mtu = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_CHANGE_MTU_EXTENDED, 1,
+                         [extended ndo_change_mtu is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/dst.h>
+       ],[
+               struct neighbour *neigh = dst_get_neighbour(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
+                         [dst_get_neighbour is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dst.h has skb_dst_update_pmtu])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/dst.h>
+       ],[
+               struct sk_buff x;
+               skb_dst_update_pmtu(&x, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SKB_DST_UPDATE_PMTU, 1,
+                         [skb_dst_update_pmtu is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dst.h has dst_neigh_lookup])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/dst.h>
+       ],[
+               struct neighbour *neigh = dst_neigh_lookup(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DST_NEIGH_LOOKUP, 1,
+                         [dst_neigh_lookup is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dst_ops.h update_pmtu has 4 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+               #include <net/dst_ops.h>
+
+               static void mtu_up (struct dst_entry *dst, struct sock *sk,
+                                   struct sk_buff *skb, u32 mtu)
+               {
+                       return;
+               }
+       ],[
+               struct dst_ops x = {
+                       .update_pmtu = mtu_up,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_UPDATE_PMTU_4_PARAMS, 1,
+                         [update_pmtu has 4 paramters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if rtnetlink.h rtnl_link_ops newlink has 4 paramters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+               #include <net/rtnetlink.h>
+
+               static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
+                                               struct nlattr *tb[], struct nlattr *data[])
+               {
+                       return 0;
+               }
+       ],[
+               struct rtnl_link_ops x = {
+                       .newlink = ipoib_new_child_link,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RTNL_LINK_OPS_NEWLINK_4_PARAMS, 1,
+                         [newlink has 4 paramters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if rtnetlink.h rtnl_link_ops newlink has 5 paramters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+               #include <net/rtnetlink.h>
+
+               static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
+                                                                               struct nlattr *tb[], struct nlattr *data[],
+                                                                               struct netlink_ext_ack *extack)
+               {
+                       return 0;
+               }
+       ],[
+               struct rtnl_link_ops x = {
+                       .newlink = ipoib_new_child_link,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RTNL_LINK_OPS_NEWLINK_5_PARAMS, 1,
+                         [newlink has 5 paramters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if rtnetlink.h rtnl_link_ops dellink newlink has 2 paramters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+               #include <net/rtnetlink.h>
+
+               static void ipoib_unregister_child_dev(struct net_device *dev, struct list_head *head)
+               {
+                       return;
+               }
+       ],[
+               struct rtnl_link_ops x = {
+                       .dellink = ipoib_unregister_child_dev,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RTNL_LINK_OPS_DELLINK_2_PARAMS, 1,
+                         [dellink has 2 paramters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if argument 3 of config_group_init_type_name should const])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/configfs.h>
+
+               static const struct config_item_type cma_port_group_type = {
+                       .ct_attrs       = cma_configfs_attributes,
+               };
+
+       ],[
+               config_group_init_type_name(NULL,
+                                           NULL,
+                                           &cma_port_group_type);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(CONFIG_GROUP_INIT_TYPE_NAME_PARAM_3_IS_CONST, 1,
+                       [argument 3 of config_group_init_type_name should const])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if timer.h has timer_setup])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/timer.h>
+
+               static void activate_timeout_handler_task(struct timer_list *t)
+               {
+                       return;
+               }
+       ],[
+               struct timer_list tmr;
+               timer_setup(&tmr, activate_timeout_handler_task, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TIMER_SETUP, 1,
+                       [timer_setup is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/pci.h has pcie_get_minimum_link])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pcie_print_link_status(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCIE_PRINT_LINK_STATUS, 1,
+                         [pcie_print_link_status is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if idr.h has ida_is_empty])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               struct ida ida;
+               ida_is_empty(&ida);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDA_IS_EMPTY, 1,
+                         [ida_is_empty is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if idr.h has idr_is_empty])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/idr.h>
+       ],[
+               struct ida ida;
+               idr_is_empty(&ida.idr);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IDR_IS_EMPTY, 1,
+                         [idr_is_empty is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/xdp.h exist])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/xdp.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_XDP_H, 1,
+                         [net/xdp.h exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_dim.h exist])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/net_dim.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DIM_H, 1,
+                         [linux/net_dim.h exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has TC_SETUP_QDISC_MQPRIO])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               enum tc_setup_type x = TC_SETUP_QDISC_MQPRIO;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_SETUP_QDISC_MQPRIO, 1,
+                         [TC_SETUP_QDISC_MQPRIO is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has TC_SETUP_BLOCK])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               enum tc_setup_type x = TC_SETUP_BLOCK;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_SETUP_BLOCK, 1,
+                         [TC_SETUP_BLOCK is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct netdev_xdp exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct netdev_xdp xdp;
+               xdp = xdp;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_XDP, 1,
+                         [struct netdev_xdp is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct xdp_rxq_info exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/xdp.h>
+       ],[
+               struct xdp_rxq_info xdp_rxq_inf;
+               xdp_rxq_inf = xdp_rxq_inf;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_XDP_RXQ_INFO, 1,
+                         [struct xdp_rxq_info is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device has min/max])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev = NULL;
+
+               dev->min_mtu = 0;
+               dev->max_mtu = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DEVICE_MIN_MAX_MTU, 1,
+                         [net_device min/max is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_extended has min/max_mtu])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_extended x = {
+                       .min_mtu = 0,
+                       .max_mtu = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NET_DEVICE_MIN_MAX_MTU_EXTENDED, 1,
+                         [extended min/max_mtu is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct netdev_bpf exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct netdev_bpf nbpf;
+               nbpf = nbpf;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_BPF, 1,
+                         [struct netdev_bpf is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if vxlan have ndo_add_vxlan_port])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               #if IS_ENABLED(CONFIG_VXLAN)
+               void add_vxlan_port(struct net_device *dev, sa_family_t sa_family, __be16 port)
+               {
+                       return;
+               }
+               #endif
+       ],[
+               struct net_device_ops netdev_ops;
+               netdev_ops.ndo_add_vxlan_port = add_vxlan_port;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_ADD_VXLAN_PORT, 1,
+                       [ndo_add_vxlan_port is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if function pcie_bandwidth_available exist])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pcie_bandwidth_available(NULL, NULL, NULL, NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCIE_BANDWIDTH_AVAILABLE, 1,
+                         [function pcie_bandwidth_available is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/bpf.h bpf_prog_aux has feild id])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bpf.h>
+       ],[
+               struct bpf_prog_aux x = {
+                       .id = 0,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BPF_PROG_AUX_FEILD_ID, 1,
+                         [bpf_prog_aux has feild id])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ethtool.h has set_dump])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               struct ethtool_ops x = {
+                       .set_dump = NULL,
+                       .get_dump_data = NULL,
+                       .get_dump_flag = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_DUMP, 1,
+                       [HAVE_GET_SET_DUMP is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_flags])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_flags = NULL,
+                       .set_flags = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_FLAGS, 1,
+                         [get/set_flags is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_link_ksettings])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_link_ksettings = NULL,
+                       .set_link_ksettings = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_LINK_KSETTINGS, 1,
+                         [get/set_link_ksettings is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_msglevel])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_msglevel = NULL,
+                       .set_msglevel = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_MSGLEVEL, 1,
+                         [get/set_msglevel is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_rx_csum])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_rx_csum = NULL,
+                       .set_rx_csum = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_RX_CSUM, 1,
+                         [get/set_rx_csum is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_sg])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_sg = NULL,
+                       .set_sg = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_SG, 1,
+                         [get/set_sg is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_tso])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_tso = NULL,
+                       .set_tso = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_TSO, 1,
+                         [get/set_tso is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct ethtool_ops has get/set_tx_csum])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/ethtool.h>
+       ],[
+               const struct ethtool_ops en_ethtool_ops = {
+                       .get_tx_csum = NULL,
+                       .set_tx_csum = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GET_SET_TX_CSUM, 1,
+                         [get/set_tx_csum is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if kthread.h has kthread_queue_work])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/kthread.h>
+       ],[
+               kthread_queue_work(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KTHREAD_QUEUE_WORK, 1,
+                         [kthread_queue_work is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ndo_get_offload_stats defined])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int mlx5e_get_offload_stats(int attr_id, const struct net_device *dev,
+                                                                       void *sp)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops ndops = {
+                       .ndo_get_offload_stats = mlx5e_get_offload_stats,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_GET_OFFLOAD_STATS, 1,
+                         [ndo_get_offload_stats is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has ndo_get_offload_stats])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int mlx5e_get_offload_stats(int attr_id, const struct net_device *dev,
+                                                                       void *sp)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops_extended ndops = {
+                       .ndo_get_offload_stats = mlx5e_get_offload_stats,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_GET_OFFLOAD_STATS_EXTENDED, 1,
+                         [extended ndo_get_offload_stats is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_device_ops_extended has ndo_has_offload_stats])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               bool mlx5e_has_offload_stats(const struct net_device *dev, int attr_id)
+               {
+                       return true;
+               }
+       ],[
+               struct net_device_ops_extended ndops = {
+                       .ndo_has_offload_stats = mlx5e_has_offload_stats,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_HAS_OFFLOAD_STATS_EXTENDED, 1,
+                         [ndo_has_offload_stats gets net_device])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has *ndo_set_tx_maxrate])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_extended x = {
+                       .ndo_set_tx_maxrate = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SET_TX_MAXRATE_EXTENDED, 1,
+                         [extended ndo_set_tx_maxrate is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has  has *ndo_setup_tc_rh])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_extended x = {
+                       .ndo_setup_tc_rh = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SETUP_TC_RH_EXTENDED, 1,
+                         [ndo_setup_tc_rh is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ndo_setup_tc takes chain_index])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int mlx_en_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
+                                                       __be16 protocol, struct tc_to_netdev *tc)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops x = {
+                       .ndo_setup_tc = mlx_en_setup_tc,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SETUP_TC_TAKES_CHAIN_INDEX, 1,
+                         [ndo_setup_tc takes chain_index])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ndo_setup_tc takes tc_setup_type])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int mlx_en_setup_tc(struct net_device *dev, enum tc_setup_type type,
+                                   void *type_data)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops x = {
+                       .ndo_setup_tc = mlx_en_setup_tc,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_SETUP_TC_TAKES_TC_SETUP_TYPE, 1,
+                         [ndo_setup_tc takes tc_setup_type])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has ndo_udp_tunnel_add])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               #if IS_ENABLED(CONFIG_VXLAN)
+               void add_vxlan_port(struct net_device *dev, struct udp_tunnel_info *ti)
+               {
+                       return;
+               }
+               #endif
+
+       ],[
+               struct net_device_ops_extended x = {
+                       .ndo_udp_tunnel_add = add_vxlan_port,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_UDP_TUNNEL_ADD_EXTENDED, 1,
+                       [extended ndo_add_vxlan_port is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_device_ops_extended has ndo_set_vf_trust])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int set_vf_trust(struct net_device *dev, int vf, bool setting)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops_extended netdev_ops;
+
+               netdev_ops.ndo_set_vf_trust = set_vf_trust;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_TRUST_EXTENDED, 1,
+                         [extended ndo_set_vf_trust is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netif_is_rxfh_configured])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               netif_is_rxfh_configured(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETIF_IS_RXFH_CONFIGURED, 1,
+                         [netif_is_rxfh_configured is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pat.h has pat_enabled as a function])
+       LB_LINUX_TRY_COMPILE([
+               #include <asm/pat.h>
+       ],[
+               bool px = pat_enabled();
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PAT_ENABLED_AS_FUNCTION, 1,
+                         [pat.h has pat_enabled as a function])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct tc_block_offload exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               struct tc_block_offload x;
+               x = x;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_BLOCK_OFFLOAD, 1,
+                         [struct tc_block_offload is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if act_apt.h tc_setup_cb_egdev_register])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/act_api.h>
+       ],[
+               tc_setup_cb_egdev_register(NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_SETUP_CB_EGDEV_REGISTER, 1,
+                         [tc_setup_cb_egdev_register is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops has ndo_set_vf_tx_rate])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops ndops = {
+                       .ndo_set_vf_tx_rate = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VF_TX_RATE, 1,
+                         [ndo_set_vf_tx_rate is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if route.h has ip4_dst_hoplimit])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/route.h>
+       ],[
+               ip4_dst_hoplimit(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IP4_DST_HOPLIMIT, 1,
+               [ip4_dst_hoplimit is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([irq_to_desc],
+               [kernel/irq/irqdesc.c],
+               [AC_DEFINE(HAVE_IRQ_TO_DESC_EXPORTED, 1,
+                       [irq_to_desc is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if struct net_device_ops_extended has ndo_xdp])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device_ops_extended netdev_ops_extended = {
+                       .ndo_xdp = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_XDP_EXTENDED, 1,
+                         [extended ndo_xdp is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdev_features.h has NETIF_F_RXALL])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdev_features.h>
+       ],[
+               netdev_features_t rxfcs = NETIF_F_RXALL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETIF_F_RXALL, 1,
+                       [NETIF_F_RXALL is defined in netdev_features.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdev_features.h has NETIF_F_RXFCS])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdev_features.h>
+       ],[
+               netdev_features_t rxfcs = NETIF_F_RXFCS;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETIF_F_RXFCS, 1,
+                       [NETIF_F_RXFCS is defined in netdev_features.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if vxlan.h has vxlan_features_check])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/vxlan.h>
+       ],[
+               vxlan_features_check(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_VXLAN_FEATURES_CHECK, 1,
+                         [vxlan_features_check is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tcp.h tcp_parse_options has 5 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tcp.h>
+       ],[
+               tcp_parse_options(NULL, NULL, NULL, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCP_PARSE_OPTIONS_5_PARAMETERS, 1,
+                         [tcp_parse_options_5_parameters is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/pkt_cls.h has tc_cls_can_offload_and_chain0])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               tc_cls_can_offload_and_chain0(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_CLS_CAN_OFFLOAD_AND_CHAIN0, 1,
+                         [tc_cls_can_offload_and_chain0 is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/rhashtable.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/rhashtable.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_RHASHTABLE_H, 1,
+                         [linux/rhashtable.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_mirred.h has tcf_mirred_dev])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_mirred.h>
+       ],[
+               tcf_mirred_dev(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_MIRRED_DEV, 1,
+                         [tcf_mirred_dev is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_gact.h has is_tcf_gact_ok])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_gact.h>
+       ],[
+               is_tcf_gact_ok(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IS_TCF_GACT_OK, 1,
+                         [is_tcf_gact_ok is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if skbuff.h has build_skb])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+                build_skb(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BUILD_SKB, 1,
+                         [build_skb is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/net/devlink.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_H, 1,
+                         [include/net/devlink.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net_device_ops_extended has ndo_get_phys_port_id])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int get_phys_port_name(struct net_device *dev,
+                                      char *name, size_t len)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops_extended netdev_ops;
+
+               netdev_ops.ndo_get_phys_port_name = get_phys_port_name;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_GET_PHYS_PORT_NAME_EXTENDED, 1,
+                         [ is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 2 parameters and returns int])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               int vlan_rx_add_vid(struct net_device *dev, u16 vid)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops netdev_ops = {
+                       .ndo_vlan_rx_add_vid = vlan_rx_add_vid,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_2_PARAMS_RET_INT, 1,
+                         [ndo_vlan_rx_add_vid has 2 parameters and returns int])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdev_extended has wanted_features])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev = NULL;
+
+               netdev_extended(dev)->wanted_features = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_EXTENDED_WANTED_FEATURES, 1,
+                         [ is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has IFF_UNICAST_FLT])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               int x = IFF_UNICAST_FLT;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_IFF_UNICAST_FLT, 1,
+                         [IFF_UNICAST_FLT is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct net_device has wanted_features])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device dev;
+               dev.wanted_features = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_WANTED_FEATURES, 1,
+                         [wanted_features is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dcbnl.h has struct ieee_pfc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+               #include <net/dcbnl.h>
+       ],[
+               struct ieee_pfc x;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_STRUCT_IEEE_PFC, 1,
+                         [ieee_pfc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct tc_to_netdev has egress_dev])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct tc_to_netdev x = {
+                       .egress_dev = false,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_TO_NETDEV_EGRESS_DEV, 1,
+                         [struct tc_to_netdev has egress_dev])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct tc_to_netdev has tc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct tc_to_netdev x;
+               x.tc = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TC_TO_NETDEV_TC, 1,
+                         [struct tc_to_netdev has tc])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/bpf_trace has trace_xdp_exception])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bpf_trace.h>
+       ],[
+               trace_xdp_exception(NULL, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TRACE_XDP_EXCEPTION, 1,
+                         [trace_xdp_exception is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if filter.h has struct xdp_buff])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/filter.h>
+       ],[
+               struct xdp_buff d = {
+                       .data = NULL,
+                       .data_end = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_XDP_BUFF, 1,
+                         [xdp is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if filter.h struct xdp_buff has data_hard_start])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/filter.h>
+       ],[
+               struct xdp_buff d = {
+                       .data_hard_start = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_XDP_BUFF_DATA_HARD_START, 1,
+                         [xdp_buff data_hard_start is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if filter.h has xdp_set_data_meta_invalid])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/filter.h>
+       ],[
+               struct xdp_buff d;
+               xdp_set_data_meta_invalid(&d);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_XDP_SET_DATA_META_INVALID, 1,
+                         [xdp_set_data_meta_invalid is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/bpf.h has bpf_prog_sub])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bpf.h>
+       ],[
+               bpf_prog_sub(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BPF_PROG_SUB, 1,
+                         [bpf_prog_sub is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has enum netdev_lag_tx_type])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               enum netdev_lag_tx_type x;
+               x = 0;
+
+               return x;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LAG_TX_TYPE, 1,
+                         [enum netdev_lag_tx_type is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netdev_reg_state])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               netdev_reg_state(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_REG_STATE, 1,
+                         [netdev_reg_state is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([bpf_prog_inc],
+               [kernel/bpf/syscall.c],
+               [AC_DEFINE(HAVE_BPF_PROG_INC_EXPORTED, 1,
+                       [bpf_prog_inc is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if linux/inet.h inet_pton_with_scope])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/inet.h>
+       ],[
+               inet_pton_with_scope(NULL, 0, NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_INET_PTON_WITH_SCOPE, 1,
+                       [inet_pton_with_scope is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h has blist_flags_t])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+    ],[
+               blist_flags_t x = 0;
+
+               return 0;
+    ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLIST_FLAGS_T, 1,
+                       [blist_flags_t is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h struct scsi_device has member state_mutex])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mutex.h>
+               #include <scsi/scsi_device.h>
+       ],[
+               struct scsi_device sdev;
+               mutex_init(&sdev.state_mutex);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_DEVICE_STATE_MUTEX, 1,
+                         [scsi_device.h struct scsi_device has member state_mutex])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi_device.h has enum scsi_scan_mode])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi_device.h>
+       ],[
+               enum scsi_scan_mode xx = SCSI_SCAN_INITIAL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ENUM_SCSI_SCAN_MODE, 1,
+                         [enum scsi_scan_mode is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([kobj_ns_drop],
+               [lib/kobject.c],
+               [AC_DEFINE(HAVE_KOBJ_NS_DROP_EXPORTED, 1,
+                       [kobj_ns_drop is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if linux/hashtable.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/hashtable.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_HASHTABLE_H, 1,
+                         [linux/hashtable.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if list.h hlist_for_each_entry has 3 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/list.h>
+
+               struct test_node {
+                       struct hlist_node hlist;
+               };
+       ],[
+               struct test_node *hn;
+               struct hlist_head *hash;
+               hlist_for_each_entry(hn, hash, hlist);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_HLIST_FOR_EACH_ENTRY_3_PARAMS, 1,
+                         [hlist_for_each_entry has 3 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       # this checker will test if the function exist AND gets const
+       # otherwise it will fail.
+       AC_MSG_CHECKING([if if_vlan.h has is_vlan_dev get const])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+               #include <linux/if_vlan.h>
+       ],[
+               const struct net_device *dev;
+               is_vlan_dev(dev);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IS_VLAN_DEV_CONST, 1,
+                         [is_vlan_dev get const])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/security.h has register_lsm_notifier])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/security.h>
+       ],[
+               register_lsm_notifier(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REGISTER_LSM_NOTIFIER, 1,
+                         [linux/security.h has register_lsm_notifier])
+       ],[
+               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>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REFCOUNT, 1,
+                         [refcount.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if slab.h has kcalloc_node])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/slab.h>
+       ],[
+               kcalloc_node(0, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KCALLOC_NODE, 1,
+                         [kcalloc_node is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has kvzalloc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               kvzalloc(0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KVZALLOC, 1,
+                       [kvzalloc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has kvmalloc_array])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               kvmalloc_array(0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_KVMALLOC_ARRAY, 1,
+                       [kvmalloc_array is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has kvmalloc_node])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               kvmalloc_node(0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KVMALLOC_NODE, 1,
+                       [kvmalloc_node is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if mm.h has kvzalloc_node])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/mm.h>
+       ],[
+               kvzalloc_node(0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KVZALLOC_NODE, 1,
+                       [kvzalloc_node is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/cdev.h has cdev_set_parent])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/cdev.h>
+       ],[
+               cdev_set_parent(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_CDEV_SET_PARENT, 1,
+                         [linux/cdev.h has cdev_set_parent])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/sched/signal.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/signal.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCHED_SIGNAL_H, 1,
+                         [linux/sched/signal.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/sched/mm.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sched/mm.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCHED_MM_H, 1,
+                         [linux/sched/mm.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/bpf_trace exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bpf.h>
+               #include <linux/bpf_trace.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_BPF_TRACE_H, 1,
+                         [linux/bpf_trace exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/net_tstamp.h has HWTSTAMP_FILTER_NTP_ALL])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/net_tstamp.h>
+       ],[
+               int x = HWTSTAMP_FILTER_NTP_ALL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_HWTSTAMP_FILTER_NTP_ALL, 1,
+                         [HWTSTAMP_FILTER_NTP_ALL is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/pci.h has pci_irq_vector, pci_free_irq_vectors, pci_alloc_irq_vectors])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_irq_vector(NULL, 0);
+               pci_free_irq_vectors(NULL);
+               pci_alloc_irq_vectors(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_IRQ_API, 1,
+                       [linux/pci.h has pci_irq_vector, pci_free_irq_vectors, pci_alloc_irq_vectors])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct devlink_ops has eswitch_encap_mode_set/get])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               struct devlink_ops dlops = {
+                       .eswitch_encap_mode_set = NULL,
+                       .eswitch_encap_mode_get = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_HAS_ESWITCH_ENCAP_MODE_SET, 1,
+                         [eswitch_encap_mode_set/get is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct devlink_ops has eswitch_inline_mode_get/set])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               struct devlink_ops dlops = {
+                       .eswitch_inline_mode_get = NULL,
+                       .eswitch_inline_mode_set = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_HAS_ESWITCH_INLINE_MODE_GET_SET, 1,
+                         [eswitch_inline_mode_get/set is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct devlink_ops has eswitch_mode_get/set])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               struct devlink_ops dlops = {
+                       .eswitch_mode_get = NULL,
+                       .eswitch_mode_set = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_HAS_ESWITCH_MODE_GET_SET, 1,
+                         [eswitch_mode_get/set is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if napi_complete_done returns value])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+       ],[
+               if (napi_complete_done(NULL, 0))
+                       return;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NAPI_COMPLETE_DONE_RET_VALUE, 1,
+                         [napi_complete_done returns value])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if skbuff.h has skb_put_zero])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+               skb_put_zero(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SKB_PUT_ZERO, 1,
+                         [skb_put_zero is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if skbuff.h has skb_put_data])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/skbuff.h>
+       ],[
+               skb_put_data(NULL, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SKB_PUT_DATA, 1,
+                         [skb_put_data is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if flow_dissector.h enum flow_dissector_key_keyid has FLOW_DISSECTOR_KEY_TCP])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/flow_dissector.h>
+       ],[
+               enum flow_dissector_key_id keyid = FLOW_DISSECTOR_KEY_TCP;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_FLOW_DISSECTOR_KEY_TCP, 1,
+                         [FLOW_DISSECTOR_KEY_TCP is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_pedit.h has tcf_pedit_nkeys])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_pedit.h>
+       ],[
+               const struct tc_action xx;
+               tcf_pedit_nkeys(&xx);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_PEDIT_NKEYS, 1,
+                         [tcf_pedit_nkeys is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_pedit.h struct tcf_pedit has member tcfp_keys_ex])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_pedit.h>
+       ],[
+               struct tcf_pedit x = {
+                       .tcfp_keys_ex = NULL,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_PEDIT_TCFP_KEYS_EX, 1,
+                         [struct tcf_pedit has member tcfp_keys_ex])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if tc_vlan.h has tcf_vlan_push_prio])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_vlan.h>
+       ],[
+               tcf_vlan_push_prio(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_VLAN_PUSH_PRIO, 1,
+                         [tcf_vlan_push_prio is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_csum.h has TCA_CSUM_UPDATE_FLAG_IPV4HDR])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_csum.h>
+       ],[
+               int x = TCA_CSUM_UPDATE_FLAG_IPV4HDR;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCA_CSUM_UPDATE_FLAG_IPV4HDR, 1,
+                         [TCA_CSUM_UPDATE_FLAG_IPV4HDR is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/pkt_cls.h has tcf_exts_has_actions])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               struct tcf_exts exts;
+               tcf_exts_has_actions(&exts);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_EXTS_HAS_ACTIONS, 1,
+                         [tcf_exts_has_actions is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/tc_act/tc_tunnel_key.h has tcf_tunnel_info])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/tc_act/tc_tunnel_key.h>
+       ],[
+               const struct tc_action xx;
+               tcf_tunnel_info(&xx);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_TUNNEL_INFO, 1,
+                         [tcf_tunnel_info is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       AC_MSG_CHECKING([if flow_dissector.h enum flow_dissector_key_keyid has FLOW_DISSECTOR_KEY_IP])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/flow_dissector.h>
+       ],[
+               enum flow_dissector_key_id keyid = FLOW_DISSECTOR_KEY_IP;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_FLOW_DISSECTOR_KEY_IP, 1,
+                         [FLOW_DISSECTOR_KEY_IP is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if flow_dissector.h enum flow_dissector_key_keyid has FLOW_DISSECTOR_KEY_VLAN])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/flow_dissector.h>
+       ],[
+               enum flow_dissector_key_id keyid = FLOW_DISSECTOR_KEY_VLAN;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_FLOW_DISSECTOR_KEY_VLAN, 1,
+                         [FLOW_DISSECTOR_KEY_VLAN is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if net/pkt_cls.h has tcf_exts_stats_update])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/pkt_cls.h>
+       ],[
+               tcf_exts_stats_update(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_TCF_EXTS_STATS_UPDATE, 1,
+                         [tcf_exts_stats_update is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netdev_walk_all_upper_dev_rcu])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               struct upper_list {
+                       struct list_head list;
+                       struct net_device *upper;
+               };
+
+               static int netdev_upper_walk(struct net_device *upper, void *data) {
+                       return 0;
+               }
+       ],[
+               struct net_device *ndev;
+               struct list_head upper_list;
+
+               netdev_walk_all_upper_dev_rcu(ndev, netdev_upper_walk, &upper_list);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_WALK_ALL_UPPER_DEV_RCU, 1,
+                         [netdev_walk_all_upper_dev_rcu is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has netdev_has_upper_dev_all_rcu])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               struct net_device *dev;
+               struct net_device *upper;
+
+               netdev_has_upper_dev_all_rcu(dev, upper);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_HAS_UPPER_DEV_ALL_RCU, 1,
+                         [netdev_has_upper_dev_all_rcu is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if page_ref.h has page_ref_count/add/sub/inc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/page_ref.h>
+       ],[
+               page_ref_count(NULL);
+               page_ref_add(NULL, 0);
+               page_ref_sub(NULL, 0);
+               page_ref_inc(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PAGE_REF_COUNT_ADD_SUB_INC, 1,
+                         [page_ref_count/add/sub/inc defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct netdev_features.h has NETIF_F_GSO_PARTIAL])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdev_features.h>
+       ],[
+               int x = NETIF_F_GSO_PARTIAL;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETIF_F_GSO_PARTIAL, 1,
+                         [NETIF_F_GSO_PARTIAL is defined in netdev_features.h])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if  struct rhltable exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/rhashtable.h>
+       ],[
+               struct rhltable x;
+               x = x;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_RHLTABLE, 1,
+                         [struct rhltable is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if libiscsi.h has iscsi_eh_cmd_timed_out])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+               #include <scsi/libiscsi.h>
+       ],[
+               iscsi_eh_cmd_timed_out(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ISCSI_EH_CMD_TIMED_OUT, 1,
+                       [iscsi_eh_cmd_timed_out is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       AC_MSG_CHECKING([if struct bio has member bi_disk])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               struct bio b = {
+                       .bi_disk = NULL,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BIO_BI_DISK, 1,
+                       [struct bio has member bi_disk])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if bio.h struct bio_integrity_payload has member bip_iter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bio.h>
+               #include <linux/bvec.h>
+       ],[
+               struct bvec_iter bip_it = {0};
+               struct bio_integrity_payload bip = {
+                       .bip_iter = bip_it,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BIO_INTEGRITY_PYLD_BIP_ITER, 1,
+                       [bio_integrity_payload has members bip_iter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h blk_add_request_payload has 4 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_add_request_payload(NULL, NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_ADD_REQUEST_PAYLOAD_HAS_4_PARAMS, 1,
+                       [blkdev.h blk_add_request_payload has 4 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has REQ_TYPE_DRV_PRIV])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               enum rq_cmd_type_bits rctb = REQ_TYPE_DRV_PRIV;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLKDEV_REQ_TYPE_DRV_PRIV, 1,
+                       [REQ_TYPE_DRV_PRIV is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_freeze_queue_start])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_freeze_queue_start(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_FREEZE_QUEUE_START, 1,
+                         [blk_freeze_queue_start is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has BLK_INTEGRITY_DEVICE_CAPABLE])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               enum  blk_integrity_flags bif = BLK_INTEGRITY_DEVICE_CAPABLE;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_INTEGRITY_DEVICE_CAPABLE, 1,
+                       [BLK_INTEGRITY_DEVICE_CAPABLE is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has BLK_MAX_WRITE_HINTS])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               int x = BLK_MAX_WRITE_HINTS;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MAX_WRITE_HINTS, 1,
+                       [BLK_MAX_WRITE_HINTS is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h blk_mq_alloc_request has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_alloc_request(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_ALLOC_REQUEST_HAS_3_PARAMS, 1,
+                         [linux/blk-mq.h blk_mq_alloc_request has 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h blk_mq_complete_request has 2 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_complete_request(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_COMPLETE_REQUEST_HAS_2_PARAMS, 1,
+                         [linux/blk-mq.h blk_mq_complete_request has 2 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blk_mq_end_request accepts blk_status_t as second parameter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+               #include <linux/blk_types.h>
+       ],[
+               blk_status_t error = BLK_STS_OK;
+
+               blk_mq_end_request(NULL, error);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_END_REQUEST_TAKES_BLK_STATUS_T, 1,
+                         [blk_mq_end_request accepts blk_status_t as second parameter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+
+       AC_MSG_CHECKING([if blkdev.h has blk_mq_quiesce_queue])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_quiesce_queue(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_QUIESCE_QUEUE, 1,
+                               [blk_mq_quiesce_queue exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h blk_mq_reinit_tagset takes 2 params])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_reinit_tagset(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_REINIT_TAGSET_2_PARAM, 1,
+                         [blk_mq_reinit_tagset takes 2 params])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blk-mq.h blk_mq_requeue_request has 2 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_requeue_request(NULL, false);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_REQUEUE_REQUEST_2_PARAMS, 1,
+                         [blk-mq.h blk_mq_requeue_request has 2 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_tagset_iter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_tagset_iter(NULL, NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_TAGSET_ITER, 1,
+                         [blk_mq_tagset_iter is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_unquiesce_queue])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_unquiesce_queue(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_UNQUIESCE_QUEUE, 1,
+                         [blk_mq_unquiesce_queue is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blkdev.h has blk_queue_max_write_zeroes_sectors])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_queue_max_write_zeroes_sectors(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_MAX_WRITE_ZEROES_SECTORS, 1,
+                         [blk_queue_max_write_zeroes_sectors is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has blk_rq_nr_discard_segments])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_rq_nr_discard_segments(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_RQ_NR_DISCARD_SEGMENTS, 1,
+                       [blk_rq_nr_discard_segments is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has REQ_INTEGRITY])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               int x = REQ_INTEGRITY;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_TYPES_REQ_INTEGRITY, 1,
+                       [REQ_INTEGRITY is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has REQ_OP_DISCARD])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               int x = REQ_OP_DISCARD;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_TYPES_REQ_OP_DISCARD, 1,
+                       [REQ_OP_DISCARD is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has REQ_OP_DRV_OUT])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               enum req_opf xx = REQ_OP_DRV_OUT;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_TYPES_REQ_OP_DRV_OUT, 1,
+                         [REQ_OP_DRV_OUT is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has REQ_OP_FLUSH])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               int x = REQ_OP_FLUSH;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_TYPES_REQ_OP_FLUSH, 1,
+                       [REQ_OP_FLUSH is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if cleanup_srcu_struct_quiesced exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/srcu.h>
+       ],[
+               cleanup_srcu_struct_quiesced(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_CLEANUP_SRCU_STRUCT_QUIESCED, 1,
+                         [linux/srcu.h cleanup_srcu_struct_quiesced is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if genhd.h has device_add_disk])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/genhd.h>
+       ],[
+               device_add_disk(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVICE_ADD_DISK, 1,
+                       [genhd.h has device_add_disk])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if device.h has device_remove_file_self])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/device.h>
+       ],[
+               device_remove_file_self(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVICE_REMOVE_FILE_SELF, 1,
+                       [device.h has device_remove_file_self])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pm.h struct dev_pm_info has member set_latency_tolerance])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pm.h>
+               #include <asm/device.h>
+               #include <linux/types.h>
+
+               static void nvme_set_latency_tolerance(struct device *dev, s32 val)
+               {
+                       return;
+               }
+       ],[
+               struct dev_pm_info dpinfo = {
+                       .set_latency_tolerance = nvme_set_latency_tolerance,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEV_PM_INFO_SET_LATENCY_TOLERANCE, 1,
+                       [set_latency_tolerance is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/lightnvm.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/lightnvm.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LIGHTNVM_H, 1,
+                       [linux/lightnvm.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if lightnvm.h struct nvm_dev has member dev])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/lightnvm.h>
+       ],[
+               struct device devx = {0};
+               struct nvm_dev d = {
+                       .dev = devx,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LIGHTNVM_NVM_DEV, 1,
+                         [nvm_dev dev is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/sed-opal.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sed-opal.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_SED_OPAL_H, 1,
+                       [linux/sed-opal.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if uapi/linux/lightnvm.h has struct nvm_user_vio])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/genhd.h>
+               #include <uapi/linux/lightnvm.h>
+       ],[
+               struct nvm_user_vio vio;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NVM_USER_VIO, 1,
+                         [struct nvm_user_vio is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/pr.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+               #include <linux/pr.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PR_H, 1,
+                       [linux/pr.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h struct request has rq_flags])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request rq = { .rq_flags = 0 };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REQUEST_RQ_FLAGS, 1,
+                       [blkdev.h struct request has rq_flags])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/t10-pi.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/t10-pi.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_T10_PI_H, 1,
+                       [linux/t10-pi.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/uuid.h has uuid_is_null])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/uuid.h>
+       ],[
+               uuid_t uuid;
+               uuid_is_null(&uuid);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_UUID_IS_NULL, 1,
+                       [uuid_is_null is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_all_tag_busy_iter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+
+               static void
+               nvme_cancel_request(struct request *req, void *data, bool reserved) {
+                       return;
+               }
+       ],[
+               blk_mq_all_tag_busy_iter(NULL, nvme_cancel_request, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_ALL_TAG_BUSY_ITER, 1,
+                         [blk_mq_all_tag_busy_iter is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_freeze_queue_wait_timeout])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_freeze_queue_wait_timeout(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_FREEZE_QUEUE_WAIT_TIMEOUT, 1,
+                         [blk_mq_freeze_queue_wait_timeout is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_freeze_queue_wait_timeout])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_freeze_queue_wait_timeout(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_FREEZE_QUEUE_WAIT_TIMEOUT, 1,
+                         [blk_mq_freeze_queue_wait_timeout is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct blk_mq_ops has map_queues])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               struct blk_mq_ops ops = {
+                       .map_queues = NULL,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_OPS_MAP_QUEUES, 1,
+                         [struct blk_mq_ops has map_queues])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/linux/blk-mq-pci.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq-pci.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_PCI_H, 1,
+                         [include/linux/blk-mq-pci.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/linux/blk-mq-pci.h has blk_mq_pci_map_queues])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq-pci.h>
+       ],[
+               blk_mq_pci_map_queues(NULL, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_PCI_MAP_QUEUES_3_ARGS, 1,
+                       [blk_mq_pci_map_queues is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has blk_mq_req_flags_t])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               blk_mq_req_flags_t x = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_REQ_FLAGS_T, 1,
+                         [blk_mq_req_flags_t is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_tagset_busy_iter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+
+               static void
+               nvme_cancel_request(struct request *req, void *data, bool reserved) {
+                       return;
+               }
+       ],[
+               blk_mq_tagset_busy_iter(NULL, nvme_cancel_request, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_TAGSET_BUSY_ITER, 1,
+                         [blk_mq_tagset_busy_iter is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has blk_path_error])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/errno.h>
+               #include <linux/blkdev.h>
+               #include <linux/blk_types.h>
+       ],[
+               blk_path_error(0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_PATH_ERROR, 1,
+                         [blk_path_error is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blkdev.h has blk_queue_flag_set])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_queue_flag_set(0, NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_FLAG_SET, 1,
+                               [blk_queue_flag_set is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has blk_queue_write_cache])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_queue_write_cache(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE, 1,
+                       [blkdev.h has blk_queue_write_cache])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blkdev.h has blk_rq_is_passthrough])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_rq_is_passthrough(NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_RQ_IS_PASSTHROUGH, 1,
+                               [blk_rq_is_passthrough is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk_types.h has blk_status_t])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               blk_status_t xx;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_STATUS_T, 1,
+                       [blk_status_t is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has QUEUE_FLAG_WC_FUA])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               int x = QUEUE_FLAG_WC;
+               int y = QUEUE_FLAG_FUA;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_QUEUE_FLAG_WC_FUA, 1,
+                       [QUEUE_FLAG_WC_FUA is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct request_queue has q_usage_counter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct percpu_ref counter = {0};
+               struct request_queue rq = {
+                       .q_usage_counter = counter,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REQUEST_QUEUE_Q_USAGE_COUNTER, 1,
+                         [struct request_queue has q_usage_counter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_freeze_queue_wait_timeout])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_freeze_queue_wait_timeout(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_FREEZE_QUEUE_WAIT_TIMEOUT, 1,
+                         [blk_mq_freeze_queue_wait_timeout is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_freeze_queue_wait])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_freeze_queue_wait(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_FREEZE_QUEUE_WAIT, 1,
+                         [blk_mq_freeze_queue_wait is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/io-64-nonatomic-lo-hi.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/io-64-nonatomic-lo-hi.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IO_64_NONATOMIC_LO_HI_H, 1,
+                       [linux/io-64-nonatomic-lo-hi.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if slab.h has kmalloc_array])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/slab.h>
+       ],[
+               kmalloc_array(0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KMALLOC_ARRAY, 1,
+                         [kmalloc_array is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if slab.h has kmalloc_array_node])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/slab.h>
+       ],[
+               kmalloc_array_node(0, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KMALLOC_ARRAY_NODE, 1,
+                         [kmalloc_array_node is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/linux/once.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/once.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_ONCE_H, 1,
+                         [include/linux/once.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blk-mq.h has BLK_MQ_F_NO_SCHED])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               int x = BLK_MQ_F_NO_SCHED;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_F_NO_SCHED, 1,
+                               [BLK_MQ_F_NO_SCHED is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h blk_mq_ops init_request has 4 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+
+               int init_request(struct blk_mq_tag_set *set, struct request * req,
+                                unsigned int i, unsigned int k) {
+                       return 0;
+               }
+       ],[
+               struct blk_mq_ops ops = {
+                       .init_request = init_request,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_OPS_INIT_REQUEST_HAS_4_PARAMS, 1,
+                         [linux/blk-mq.h blk_mq_ops init_request has 4 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has blk_mq_poll])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_mq_poll(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_POLL, 1,
+                       [blk_mq_poll exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h blk_mq_tag_set member ops is const])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+               static const struct blk_mq_ops xmq = {0};
+
+       ],[
+               struct blk_mq_tag_set x = {
+                       .ops = &xmq,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_TAG_SET_HAS_CONST_POS, 1,
+                         [ blk_mq_tag_set member ops is const])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_update_nr_hw_queues])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_update_nr_hw_queues(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_UPDATE_NR_HW_QUEUES, 1,
+                         [blk_mq_update_nr_hw_queues is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has blk_rq_payload_bytes])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_rq_payload_bytes(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_RQ_NR_PAYLOAD_BYTES, 1,
+                       [blk_rq_payload_bytes exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has blk_rq_nr_phys_segments])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_rq_nr_phys_segments(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_RQ_NR_PHYS_SEGMENTS, 1,
+                       [blk_rq_nr_phys_segments exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dma-mapping.h has DMA_ATTR_NO_WARN])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/dma-mapping.h>
+       ],[
+               int x = DMA_ATTR_NO_WARN;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DMA_ATTR_NO_WARN, 1,
+                         [DMA_ATTR_NO_WARN is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if dma-mapping.h has dma_alloc_attrs takes unsigned long attrs])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/dma-mapping.h>
+       ],[
+               dma_alloc_attrs(NULL, 0, NULL, GFP_KERNEL, DMA_ATTR_NO_KERNEL_MAPPING);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DMA_SET_ATTR_TAKES_UNSIGNED_LONG_ATTRS, 1,
+                         [dma_alloc_attrs takes unsigned long attrs])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if interrupt.h has irq_calc_affinity_vectors with 3 args])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/interrupt.h>
+       ],[
+               int x = irq_calc_affinity_vectors(0, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IRQ_CALC_AFFINITY_VECTORS_3_ARGS, 1,
+                         [irq_calc_affinity_vectors is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       AC_MSG_CHECKING([if pci.h pci_bus_addr_t])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_bus_addr_t x = 0;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_BUS_ADDR_T, 1,
+                         [pci_bus_addr_t is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h struct pci_error_handlers has reset_done])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+
+               void reset_done(struct pci_dev *dev) {
+                       return;
+               }
+       ],[
+               struct pci_error_handlers x = {
+                       .reset_done = reset_done,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_ERROR_HANDLERS_RESET_DONE, 1,
+               [pci.h struct pci_error_handlers has reset_done])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h struct pci_error_handlers has reset_notify])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+
+               void reset(struct pci_dev *dev, bool prepare) {
+                       return;
+               }
+       ],[
+               struct pci_error_handlers x = {
+                       .reset_notify = reset,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_ERROR_HANDLERS_RESET_NOTIFY, 1,
+                         [pci.h struct pci_error_handlers has reset_notify])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h struct pci_error_handlers has reset_prepare])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+
+               void reset_prepare(struct pci_dev *dev) {
+                       return;
+               }
+       ],[
+               struct pci_error_handlers x = {
+                       .reset_prepare = reset_prepare,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_ERROR_HANDLERS_RESET_PREPARE, 1,
+                       [pci.h struct pci_error_handlers has reset_prepare])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/pci.h has pci_free_irq])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_free_irq(NULL, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_FREE_IRQ, 1,
+                         [linux/pci.h has pci_free_irq])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has req_op])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               struct request *req;
+               req_op(req);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REQ_OP, 1,
+                       [req_op exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_alloc_request_hctx])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_alloc_request_hctx(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_ALLOC_REQUEST_HCTX, 1,
+                         [linux/blk-mq.h has blk_mq_alloc_request_hctx])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h has blk_mq_map_queues])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+       ],[
+               blk_mq_map_queues(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_MAP_QUEUES, 1,
+                         [blk_mq_map_queues is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h blk_mq_ops exit_request has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+
+               void exit_request(struct blk_mq_tag_set *set, struct request * req,
+                                 unsigned int i) {
+                       return;
+               }
+       ],[
+               struct blk_mq_ops ops = {
+                       .exit_request = exit_request,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_OPS_EXIT_REQUEST_HAS_3_PARAMS, 1,
+                         [linux/blk-mq.h blk_mq_ops exit_request has 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if scsi.h has SCSI_MAX_SG_SEGMENTS])
+       LB_LINUX_TRY_COMPILE([
+               #include <scsi/scsi.h>
+       ],[
+               int x = SCSI_MAX_SG_SEGMENTS;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SCSI_MAX_SG_SEGMENTS, 1,
+                         [SCSI_MAX_SG_SEGMENTS is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/scatterlist.h sg_alloc_table_chained has 4 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/scatterlist.h>
+       ],[
+               gfp_t gfp_mask;
+               sg_alloc_table_chained(NULL, 0, gfp_mask, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SG_ALLOC_TABLE_CHAINED_4_PARAMS, 1,
+                       [sg_alloc_table_chained has 4 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/blk-mq.h struct blk_mq_ops has field reinit_request])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk-mq.h>
+
+               static int
+               nvme_fc_reinit_request(void *data, struct request *rq)
+               {
+                       return 0;
+               }
+       ],[
+               static struct blk_mq_ops nvme_fc_mq_ops = {
+                       .reinit_request = nvme_fc_reinit_request,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_MQ_OPS_REINIT_REQUEST, 1,
+                       [struct blk_mq_ops has field reinit_request])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/nvme-fc-driver.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/scatterlist.h>
+               #include <uapi/scsi/fc/fc_fs.h>
+               #include <linux/nvme-fc-driver.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_LINUX_NVME_FC_DRIVER_H, 1,
+                       [linux/nvme-fc-driver.h exists])
+       ],[
+               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])],
+       [])
+
+       AC_MSG_CHECKING([if pci.h has pci_irq_get_node])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_irq_get_node(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_IRQ_GET_NODE, 1,
+                         [pci_irq_get_node is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h has pci_num_vf])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               struct pci_dev x;
+               pci_num_vf(&x);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_NUM_VF, 1,
+                         [pci_num_vf is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h pci_physfn])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               struct pci_dev x;
+               pci_physfn(&x);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_PHYSFN, 1,
+                         [pci_physfn is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h has pci_release_mem_regions])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_release_mem_regions(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_RELEASE_MEM_REGIONS, 1,
+                       [pci_release_mem_regions is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h has pci_request_mem_regions])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pci_request_mem_regions(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_REQUEST_MEM_REGIONS, 1,
+                       [pci_request_mem_regions is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h pci_sriov_get_totalvfs])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               int x = pci_sriov_get_totalvfs(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_SRIOV_GET_TOTALVFS, 1,
+                       [pci_sriov_get_totalvfs is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               struct pci_dev pdev;
+               pci_vfs_assigned(&pdev);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_VFS_ASSIGNED, 1,
+                         [pci_vfs_assigned is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if include/linux/sizes.h exists])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/sizes.h>
+       ],[
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SIZES_H, 1,
+                         [include/linux/sizes.h exists])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/uuid.h has uuid_be_to_bin])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/uuid.h>
+       ],[
+               uuid_be_to_bin(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_UUID_BE_TO_BIN, 1,
+                       [uuid_be_to_bin is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/uuid.h has uuid_equal])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/uuid.h>
+       ],[
+               uuid_equal(NULL, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_UUID_EQUAL, 1,
+                       [uuid_equal is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/uuid.h has uuid_gen])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/uuid.h>
+       ],[
+               uuid_t id;
+               uuid_gen(&id);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_UUID_GEN, 1,
+                       [uuid_gen is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pm_qos.h has DEV_PM_QOS_LATENCY_TOLERANCE])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pm_qos.h>
+       ],[
+               enum dev_pm_qos_req_type type = DEV_PM_QOS_LATENCY_TOLERANCE;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEV_PM_QOS_LATENCY_TOLERANCE, 1,
+                         [DEV_PM_QOS_LATENCY_TOLERANCE is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pm_qos.h has DEV_PM_QOS_RESUME_LATENCY])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pm_qos.h>
+       ],[
+               enum dev_pm_qos_req_type type = DEV_PM_QOS_RESUME_LATENCY;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEV_PM_QOS_RESUME_LATENCY, 1,
+                         [DEV_PM_QOS_RESUME_LATENCY is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if pm_qos.h has PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pm_qos.h>
+       ],[
+               int x = PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT, 1,
+                         [PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if route.h has ip4_dst_hoplimit])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/route.h>
+       ],[
+               ip4_dst_hoplimit(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_IP4_DST_HOPLIMIT, 1,
+               [ip4_dst_hoplimit is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/kref.h has kref_read])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/kref.h>
+       ],[
+               kref_read(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KREF_READ, 1,
+                         [kref_read is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/pci.h has pcie_relaxed_ordering_enabled])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               pcie_relaxed_ordering_enabled(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCIE_RELAXED_ORDERING_ENABLED, 1,
+                       [pcie_relaxed_ordering_enabled is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       LB_CHECK_SYMBOL_EXPORT([irq_to_desc],
+               [kernel/irq/irqdesc.c],
+               [AC_DEFINE(HAVE_IRQ_TO_DESC_EXPORTED, 1,
+                       [irq_to_desc is exported by the kernel])],
+       [])
+
+       LB_CHECK_SYMBOL_EXPORT([dev_pm_qos_update_user_latency_tolerance],
+               [drivers/base/power/qos.c],
+               [AC_DEFINE(HAVE_PM_QOS_UPDATE_USER_LATENCY_TOLERANCE_EXPORTED, 1,
+                       [dev_pm_qos_update_user_latency_tolerance is exported by the kernel])],
+       [])
+
+       AC_MSG_CHECKING([if linux/bio.h bio_endio has 1 parameter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bio.h>
+       ],[
+               bio_endio(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BIO_ENDIO_1_PARAM, 1,
+                       [linux/bio.h bio_endio has 1 parameter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if bio.h bio_init has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bio.h>
+       ],[
+               bio_init(NULL, NULL, false);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BIO_INIT_3_PARAMS, 1,
+                         [bio.h bio_init has 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has __blkdev_issue_discard])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               __blkdev_issue_discard(NULL, 0, 0, 0, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE___BLKDEV_ISSUE_DISCARD, 1,
+                       [__blkdev_issue_discard is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has __blkdev_issue_zeroout])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               __blkdev_issue_zeroout(NULL, 0, 0, 0, NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLKDEV_ISSUE_ZEROOUT, 1,
+                       [__blkdev_issue_zeroout exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blkdev.h has blk_poll])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blkdev.h>
+       ],[
+               blk_poll(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BLK_POLL, 1,
+                       [blk_poll exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/inet.h has inet_addr_is_any])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/inet.h>
+       ],[
+               inet_addr_is_any(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_INET_ADDR_IS_ANY, 1,
+                       [inet_addr_is_any is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if string.h has memchr_inv])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/string.h>
+       ],[
+               memchr_inv(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MEMCHR_INV, 1,
+               [memchr_inv is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if string.h has memcpy_and_pad])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/string.h>
+       ],
+       [
+               memcpy_and_pad(NULL, 0, NULL, 0, ' ');
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MEMCPY_AND_PAD, 1,
+               [memcpy_and_pad is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if string.h has memdup_user_nul])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/string.h>
+       ],[
+               memdup_user_nul(NULL, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MEMDUP_USER_NUL, 1,
+               [memdup_user_nul is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if blk_types.h has REQ_IDLE])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               int flags = REQ_IDLE;
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_REQ_IDLE, 1,
+                       [blk_types.h has REQ_IDLE])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/scatterlist.h sg_alloc_table_chained has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/scatterlist.h>
+       ],[
+               sg_alloc_table_chained(NULL, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SG_ALLOC_TABLE_CHAINED_3_PARAMS, 1,
+                       [sg_alloc_table_chained has 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/scatterlist.h has sgl_alloc])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/scatterlist.h>
+       ],[
+               sgl_alloc(0, 0, NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SGL_ALLOC, 1,
+                       [sgl_alloc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/scatterlist.h has sgl_free])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/scatterlist.h>
+       ],[
+               sgl_free(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SGL_FREE, 1,
+                       [sgl_free is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/scatterlist.h has sg_zero_buffer])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/scatterlist.h>
+       ],[
+               sg_zero_buffer(NULL, 0, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SG_ZERO_BUFFER, 1,
+                       [sg_zero_buffer is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if string.h has strnicmp])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/string.h>
+       ],[
+               char a[10] = "aaa";
+               char b[10] = "bbb";
+               strnicmp(a, b, sizeof(a));
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_STRNICMP, 1,
+                         [strnicmp is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct bio has member bi_error])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               struct bio b = {
+                       .bi_error = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_STRUCT_BIO_BI_ERROR, 1,
+                       [struct bio has member bi_error])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct bio has member bi_iter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               struct bio b = {
+                       .bi_iter = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_STRUCT_BIO_BI_ITER, 1,
+                       [struct bio has member bi_iter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct bio has member bi_opf])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/blk_types.h>
+       ],[
+               struct bio b = {
+                       .bi_opf = 0,
+               };
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_STRUCT_BIO_BI_OPF, 1,
+                       [struct bio has member bi_opf])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if linux/bio.h submit_bio has 1 parameter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bio.h>
+               #include <linux/fs.h>
+       ],[
+               submit_bio(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SUBMIT_BIO_1_PARAM, 1,
+                       [linux/bio.h submit_bio has 1 parameter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+
+       AC_MSG_CHECKING([if moduleparam.h has kernel_param_ops])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/moduleparam.h>
+       ],[
+               static struct kernel_param_ops ops = {0};
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_MODULEPARAM_KERNEL_PARAM_OPS, 1,
+                       [moduleparam.h has kernel_param_ops])
+       ],[
+               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