From 78b748065c83a7f8d0a66a0e0cd4379d296bd939 Mon Sep 17 00:00:00 2001 From: Pawel Schulfer Date: Tue, 17 Jan 2017 06:36:27 -0800 Subject: [PATCH] Support rdmavt on RHEL7.2 and SLES12 in OFED-4.8 Changes included in this patch: 1) Check for MIN_NICE in prio.h Signed-off-by: Pawel Schulfer --- config/rdma.m4 | 15 +++++++++++++++ include/linux/compat-3.11.h | 1 + include/linux/compat-3.13.h | 2 ++ include/linux/sched/prio.h | 14 ++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 include/linux/sched/prio.h diff --git a/config/rdma.m4 b/config/rdma.m4 index a1db9ba..5c3e365 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -4051,6 +4051,21 @@ AC_DEFUN([LINUX_CONFIG_COMPAT], AC_MSG_RESULT(no) ]) + AC_MSG_CHECKING([if MIN_NICE is defined in prio.h]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + 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) + ]) + ]) # # COMPAT_CONFIG_HEADERS diff --git a/include/linux/compat-3.11.h b/include/linux/compat-3.11.h index 193fa3e..7dec516 100644 --- a/include/linux/compat-3.11.h +++ b/include/linux/compat-3.11.h @@ -5,6 +5,7 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)) #include +#include #ifndef AF_IB #define AF_IB 27 /* Native InfiniBand address */ diff --git a/include/linux/compat-3.13.h b/include/linux/compat-3.13.h index 88ad581..8eecb37 100644 --- a/include/linux/compat-3.13.h +++ b/include/linux/compat-3.13.h @@ -6,6 +6,8 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)) +#include + #ifndef HAVE_REINIT_COMPLETION #define HAVE_REINIT_COMPLETION diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h new file mode 100644 index 0000000..96ff8fa --- /dev/null +++ b/include/linux/sched/prio.h @@ -0,0 +1,14 @@ +#ifndef _COMPAT_LINUX_PRIO_H +#define _COMPAT_LINUX_PRIO_H 1 + +#include "../../compat/config.h" + +#ifdef HAVE_MIN_NICE +#include_next +#else +#define MAX_NICE 19 +#define MIN_NICE -20 +#define NICE_WIDTH (MAX_NICE - MIN_NICE + 1) +#endif /* HAVE_MIN_NICE */ +#endif /* _COMPAT_LINUX_PRIO_H */ + -- 2.41.0