kni: increase kernel version requirement for VA
[dpdk.git] / kernel / linux / kni / compat.h
index 6a6968d..83ecac2 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Minimal wrappers to allow compiling kni on older kernels.
  */
 #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
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+#define HAVE_MAX_MTU_PARAM
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
 #define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER
 #endif
+
+/*
+ * iova to kva mapping support can be provided since 4.6.0, but required
+ * kernel version increased to > 4.9.0 because of the updates in
+ * get_user_pages_remote() kernel API
+ */
+#if KERNEL_VERSION(4, 9, 0) < LINUX_VERSION_CODE
+#define HAVE_IOVA_TO_KVA_MAPPING_SUPPORT
+#endif