From 3d5501d568aacbcf71832691278f5656d3a9b649 Mon Sep 17 00:00:00 2001 From: David Zeng Date: Sat, 22 Dec 2018 00:27:33 +0800 Subject: [PATCH] kni: fix build on RHEL8 for arm and Power9 Signed-off-by: David Zeng Acked-by: Ferruh Yigit --- kernel/linux/kni/compat.h | 8 +++++++- kernel/linux/kni/ethtool/igb/kcompat.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index bc81d0c8d9..3c575c70a2 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -102,9 +102,15 @@ #undef NET_NAME_UNKNOWN #endif +/* + * RHEL has two different version with different kernel version: + * 3.10 is for AMD, Intel, IBM POWER7 and POWER8; + * 4.14 is for ARM and IBM POWER9 + */ #if (defined(RHEL_RELEASE_CODE) && \ (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \ - (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0))) + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))) #define ndo_change_mtu ndo_change_mtu_rh74 #endif diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h index 2681be6846..430aabafe3 100644 --- a/kernel/linux/kni/ethtool/igb/kcompat.h +++ b/kernel/linux/kni/ethtool/igb/kcompat.h @@ -3931,7 +3931,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #if (defined(RHEL_RELEASE_CODE) && \ (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \ - (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0))) + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8, 0)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))) #define ndo_change_mtu ndo_change_mtu_rh74 #endif -- 2.20.1