kni: fix build on RHEL8 and RHEL7.6-ALT

Message ID 1545409653-72601-2-git-send-email-zengxhsh@cn.ibm.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series kni: fix build on RHEL8 and RHEL7.6-ALT |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

David Zeng Dec. 21, 2018, 4:27 p.m. UTC
  Signed-off-by: David Zeng <zengxhsh@cn.ibm.com>
---
 kernel/linux/kni/compat.h              | 9 ++++++++-
 kernel/linux/kni/ethtool/igb/kcompat.h | 4 +++-
 2 files changed, 11 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Dec. 21, 2018, 5:02 p.m. UTC | #1
On 12/21/2018 4:27 PM, David Zeng wrote:
> Signed-off-by: David Zeng <zengxhsh@cn.ibm.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon Jan. 14, 2019, 1:34 p.m. UTC | #2
21/12/2018 18:02, Ferruh Yigit:
> On 12/21/2018 4:27 PM, David Zeng wrote:
> > Signed-off-by: David Zeng <zengxhsh@cn.ibm.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied on top of another fix:
	http://git.dpdk.org/dpdk/commit/?id=4c820b22
and renamed:
	kni: fix build on RHEL8 for arm and Power9

Thanks
  

Patch

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 5aadebb..3c575c7 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -102,8 +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(7, 5)) && \
+	(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 ae1b530..430aaba 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -3930,7 +3930,9 @@  static inline struct sk_buff *__kc__vlan_hwaccel_put_tag(struct sk_buff *skb,
 #endif
 
 #if (defined(RHEL_RELEASE_CODE) && \
-	(RHEL_RELEASE_VERSION(7, 5) <= RHEL_RELEASE_CODE))
+	(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 5)) && \
+	(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