[dpdk-stable] [PATCH 18.11 2/2] kni: fix ethtool pointer type build error

Kevin Traynor ktraynor at redhat.com
Fri Jun 5 20:11:29 CEST 2020


Build error about incompatbile-pointer-types similar to
commit 219bfcc05796 ("kni: fix build with Linux 5.1")
seen when building with RHEL 8.2 and ethtool enabled.

kernel/linux/kni/ethtool/igb/igb_main.c:2358:18:
error: initialization of ‘int (*)...
[-Werror=incompatible-pointer-types]
  .ndo_fdb_add  = igb_ndo_fdb_add,
                  ^~~~~~~~~~~~~~~

This is because Linux kernel
commit 87b0984ebfab ("net: Add extack argument to ndo_fdb_add()")
is backported to RHEL/CentOS since 8.1.

Extend the fix in
commit 219bfcc05796 ("kni: fix build with Linux 5.1")
to cover RHEL/CentOS 8.1 onwards.

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
---
 kernel/linux/kni/ethtool/igb/kcompat.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/linux/kni/ethtool/igb/kcompat.h b/kernel/linux/kni/ethtool/igb/kcompat.h
index adab05aa8a..611a5b7c49 100644
--- a/kernel/linux/kni/ethtool/igb/kcompat.h
+++ b/kernel/linux/kni/ethtool/igb/kcompat.h
@@ -3955,7 +3955,9 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 #endif /* >= 5.0.0 or >= RHEL/CentOS 8.1 */
 
-#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) )
+#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)) \
+	|| (defined(RHEL_RELEASE_CODE) \
+	   && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 1))))
 #define HAVE_NDO_FDB_ADD_EXTACK
-#endif /* >= 5.1.0 */
+#endif /* >= 5.1.0 or >= RHEL/CentOS 8.1 */
 
 #if defined(timer_setup) && defined(from_timer)
-- 
2.21.3



More information about the stable mailing list