ib_core: Added RHEL7.5 support
authorVladimir Sokolovsky <vlad@mellanox.com>
Fri, 4 May 2018 21:20:05 +0000 (16:20 -0500)
committerVladimir Sokolovsky <vlad@mellanox.com>
Fri, 4 May 2018 21:21:23 +0000 (16:21 -0500)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
config/rdma.m4
include/linux/sched/task.h [new file with mode: 0644]
include/linux/uaccess.h [new file with mode: 0644]
include/net/netlink.h [new file with mode: 0644]

index 2e95015..652c107 100644 (file)
@@ -4760,6 +4760,126 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                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)
+       ])
 ])
 #
 # COMPAT_CONFIG_HEADERS
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
new file mode 100644 (file)
index 0000000..c23c25b
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef COMPAT_LINUX_SCHED_TASK_H
+#define COMPAT_LINUX_SCHED_TASK_H
+
+#include "../../../compat/config.h"
+
+#ifdef HAVE_SCHED_TASK_H
+#include_next <linux/sched/task.h>
+#endif
+
+#endif /* COMPAT_LINUX_SCHED_TASK_H */
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
new file mode 100644 (file)
index 0000000..871d6b1
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef COMPAT_UACCESS_H
+#define COMPAT_UACCESS_H
+
+#include "../../compat/config.h"
+
+#include_next <linux/uaccess.h>
+
+#ifndef uaccess_kernel
+#define uaccess_kernel() segment_eq(get_fs(), KERNEL_DS)
+#endif
+
+#endif /* COMPAT_UACCESS_H */
diff --git a/include/net/netlink.h b/include/net/netlink.h
new file mode 100644 (file)
index 0000000..15de64f
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _COMPAT_NET_NETLINK_H
+#define _COMPAT_NET_NETLINK_H 1
+
+#include "../../compat/config.h"
+
+#include_next <net/netlink.h>
+
+#ifndef HAVE_NLA_PARSE_6_PARAMS
+#define nla_parse(p1, p2, p3, p4, p5, p6) nla_parse(p1, p2, p3, p4, p5)
+#define nlmsg_parse(p1, p2, p3, p4, p5, p6) nlmsg_parse(p1, p2, p3, p4, p5)
+#define nlmsg_validate(p1, p2, p3, p4, p5) nlmsg_validate(p1, p2, p3, p4)
+#endif
+
+#ifndef HAVE_NLA_PUT_U64_64BIT
+#define nla_put_u64_64bit(p1, p2, p3, p4) nla_put_u64(p1, p2, p3)
+#endif
+
+#endif /* _COMPAT_NET_NETLINK_H */
+