From 1f4da78114aafdf8e7e173ee79c7e3b7e8fafe8e Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Fri, 4 May 2018 16:20:05 -0500 Subject: [PATCH] ib_core: Added RHEL7.5 support Signed-off-by: Vladimir Sokolovsky --- config/rdma.m4 | 120 +++++++++++++++++++++++++++++++++++++ include/linux/sched/task.h | 10 ++++ include/linux/uaccess.h | 12 ++++ include/net/netlink.h | 19 ++++++ 4 files changed, 161 insertions(+) create mode 100644 include/linux/sched/task.h create mode 100644 include/linux/uaccess.h create mode 100644 include/net/netlink.h diff --git a/config/rdma.m4 b/config/rdma.m4 index 2e95015..652c107 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -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 + ],[ + 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 + ],[ + 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 + #include + ],[ + 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 + ],[ + 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 + ],[ + 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 + ],[ + 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 + ],[ + 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 + ],[ + 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 index 0000000..c23c25b --- /dev/null +++ b/include/linux/sched/task.h @@ -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 +#endif + +#endif /* COMPAT_LINUX_SCHED_TASK_H */ diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h new file mode 100644 index 0000000..871d6b1 --- /dev/null +++ b/include/linux/uaccess.h @@ -0,0 +1,12 @@ +#ifndef COMPAT_UACCESS_H +#define COMPAT_UACCESS_H + +#include "../../compat/config.h" + +#include_next + +#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 index 0000000..15de64f --- /dev/null +++ b/include/net/netlink.h @@ -0,0 +1,19 @@ +#ifndef _COMPAT_NET_NETLINK_H +#define _COMPAT_NET_NETLINK_H 1 + +#include "../../compat/config.h" + +#include_next + +#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 */ + -- 2.41.0