Added support for mlx4_en on RHEL7.6
[compat-rdma/compat.git] / config / rdma.m4
index f917ad0..ff5148d 100644 (file)
@@ -4307,7 +4307,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        AC_MSG_CHECKING([if iscsi_transport.h has iscsit_set_unsolicited_dataout])
        LB_LINUX_TRY_COMPILE([
                #include <target/iscsi/iscsi_transport.h>
-
+       ],[
                iscsit_set_unsolicited_dataout(NULL);
 
                return 0;
@@ -9691,6 +9691,223 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if bitmap.h has bitmap_free])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bitmap.h>
+               #include <linux/slab.h>
+       ],[
+               unsigned long *bmap;
+
+               bmap = kcalloc(BITS_TO_LONGS(1), sizeof(unsigned long), 0);
+               bitmap_free(bmap);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BITMAP_FREE, 1,
+               [bitmap_free is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if bitmap.h has bitmap_from_arr32])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/bitmap.h>
+               #include <linux/slab.h>
+       ],[
+               unsigned long *bmap;
+               u32 *word;
+
+               bmap = kcalloc(BITS_TO_LONGS(1), sizeof(unsigned long), 0);
+               bitmap_from_arr32(bmap, word, 1);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BITMAP_FROM_ARR32, 1,
+               [bitmap_from_arr32 is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if bitmap.h has bitmap_kzalloc])
+       LB_LINUX_TRY_COMPILE([
+       #include <linux/bitmap.h>
+       ],[
+               unsigned long *bmap;
+
+               bmap = bitmap_zalloc(1, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_BITMAP_KZALLOC, 1,
+               [bitmap_kzalloc is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if cpumask.h has cpumask_available])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/cpumask.h>
+       ],[
+                cpumask_available(NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_CPUMASK_AVAILABLE, 1,
+                         [cpumask_available is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if gfp.h has __GFP_DIRECT_RECLAIM])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/gfp.h>
+       ],[
+               gfp_t gfp_mask = __GFP_DIRECT_RECLAIM;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_GFP_DIRECT_RECLAIM, 1,
+                         [__GFP_DIRECT_RECLAIM is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if devlink has devlink_param_driverinit_value_get])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               devlink_param_driverinit_value_get(NULL, 0, NULL);
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_DRIVERINIT_VAL, 1,
+                         [devlink_param_driverinit_value_get exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if struct devlink_param exist in net/devlink.h])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               struct devlink_param soso;
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_PARAM, 1,
+                         [struct devlink_param exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if devlink enum has DEVLINK_PARAM_GENERIC_ID_REGION_SNAPSHOT])
+       LB_LINUX_TRY_COMPILE([
+               #include <net/devlink.h>
+       ],[
+               int i = DEVLINK_PARAM_GENERIC_ID_REGION_SNAPSHOT;
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_DEVLINK_PARAM_GENERIC_ID_REGION_SNAPSHOT, 1,
+                         [struct devlink_param exist])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if netdevice.h has __netdev_tx_sent_queue])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               __netdev_tx_sent_queue(NULL, 0, 0);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_NETDEV_TX_SEND_QUEUE, 1,
+                         [__netdev_tx_sent_queue is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       AC_MSG_CHECKING([if select_queue_fallback_t has third parameter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+       ],[
+               extern select_queue_fallback_t fallback;
+                fallback(NULL, NULL, NULL);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T_3_PARAMS, 1,
+                         [select_queue_fallback_t has third parameter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ndo_select_queue has 3 parameters])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               u16 select_queue(struct net_device *dev, struct sk_buff *skb,
+                                struct net_device *sb_dev)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops ndops = {
+                       .ndo_select_queue = select_queue,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_3_PARAMS_FOR_NDO_SELECT_QUEUE, 1,
+                         [.ndo_select_queue has 3 parameters])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if ndo_select_queue has a second net_device parameter])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/netdevice.h>
+
+               static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
+                                       struct net_device *sb_dev,
+                                       select_queue_fallback_t fallback)
+               {
+                       return 0;
+               }
+       ],[
+               struct net_device_ops ndops = {
+                       .ndo_select_queue = select_queue,
+               };
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_SELECT_QUEUE_NET_DEVICE, 1,
+                         [ndo_select_queue has a second net_device parameter])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
+       AC_MSG_CHECKING([if if_vlan.h has __vlan_hwaccel_clear_tag])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/if_vlan.h>
+       ],[
+               __vlan_hwaccel_clear_tag(NULL);
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE__VLAN_HWACCEL_CLEAR_TAG, 1,
+                         [__vlan_hwaccel_clear_tag defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
 ])
 #
 # COMPAT_CONFIG_HEADERS