kni: fix build on RHEL8 for arm and Power9
authorDavid Zeng <zengxhsh@cn.ibm.com>
Fri, 21 Dec 2018 16:27:33 +0000 (00:27 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 14 Jan 2019 13:33:04 +0000 (14:33 +0100)
Signed-off-by: David Zeng <zengxhsh@cn.ibm.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
kernel/linux/kni/compat.h
kernel/linux/kni/ethtool/igb/kcompat.h

index bc81d0c..3c575c7 100644 (file)
 #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
 
index 2681be6..430aaba 100644 (file)
@@ -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