Skip to contentSkip to conversation

kni: fix compilation on RHEL 8.3

PATCH Applied Olivier Matz 4 participants 4 messages Nov 26, 2020 – Nov 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kni: fix compilation on RHEL 8.3

Like what was done for mainline kernel in commit 38ad54f3bc76 ("kni: fix build with Linux 5.6"), a new parameter 'txqueue' has to be added to 'ndo_tx_timeout' ndo on RHEL 8.3 kernel.

---
 kernel/linux/kni/compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/linux/kni/compat.h +3 -1
index d515b27669..5f65640d5e 100644
@@ -131,7 +131,9 @@
 #define HAVE_IOVA_TO_KVA_MAPPING_SUPPORT
 #endif
 
-#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \
+	(defined(RHEL_RELEASE_CODE) && \
+	 RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE)
 #define HAVE_TX_TIMEOUT_TXQUEUE
 #endif
 
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Olivier Matz

Like what was done for mainline kernel in commit 38ad54f3bc76 ("kni: fix build with Linux 5.6"), a new parameter 'txqueue' has to be added to 'ndo_tx_timeout' ndo on RHEL 8.3 kernel.

Reproduced issue on a RHEL 8.3 with kernel 4.18.0-240.el8.x86_64.
FAILED: kernel/linux/kni/rte_kni.ko
make -j4 -C /lib/modules/4.18.0-240.el8.x86_64/build M=/root/dpdk/build/kernel/linux/kni src=/root/dpdk/kernel/linux/kni 'MODULE_CFLAGS=-include /root/dpdk/config/rte_config.h -I/root/dpdk/lib/librte_eal/include -I/root/dpdk/lib/librte_kni -I/root/dpdk/build -I/root/dpdk/kernel/linux/kni' modules
make: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64'
CC [M] /root/dpdk/build/kernel/linux/kni/kni_net.o
CC [M] /root/dpdk/build/kernel/linux/kni/kni_misc.o
/root/dpdk/kernel/linux/kni/kni_net.c:791:20: error: initialization of ‘void (*)(struct net_device *, unsigned int)’ from incompatible pointer type ‘void (*)(struct net_device *)’ [-Werror=incompatible-pointer-types]
.ndo_tx_timeout = kni_net_tx_timeout,

                    ^~~~~~~~~~~~~~~~~~

/root/dpdk/kernel/linux/kni/kni_net.c:791:20: note: (near initialization for ‘kni_net_netdev_ops.<anonymous>.ndo_tx_timeout’)
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:315:
/root/dpdk/build/kernel/linux/kni/kni_net.o] Error 1
make: *** [Makefile:1544: _module_/root/dpdk/build/kernel/linux/kni] Error 2
make: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64'
ninja: build stopped: subcommand failed.

Quoted 20 lines
---
 kernel/linux/kni/compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/linux/kni/compat.h +3 -2
index d515b27669..5f65640d5e 100644
@@ -131,7 +131,9 @@
 #define HAVE_IOVA_TO_KVA_MAPPING_SUPPORT
 #endif
 
-#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \
+       (defined(RHEL_RELEASE_CODE) && \
+        RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE)
 #define HAVE_TX_TIMEOUT_TXQUEUE
 #endif
 
--
Quoted 2 lines

2.25.1

Thanks.

Signature · 1 line
David Marchand
Acked-by
#2 lore raw
Quoted 57 lines · David Marchand
Quoted 9 lines · Olivier Matz

Like what was done for mainline kernel in commit 38ad54f3bc76 ("kni: fix build with Linux 5.6"), a new parameter 'txqueue' has to be added to 'ndo_tx_timeout' ndo on RHEL 8.3 kernel.

Reproduced issue on a RHEL 8.3 with kernel 4.18.0-240.el8.x86_64.
FAILED: kernel/linux/kni/rte_kni.ko
make -j4 -C /lib/modules/4.18.0-240.el8.x86_64/build M=/root/dpdk/build/kernel/linux/kni src=/root/dpdk/kernel/linux/kni 'MODULE_CFLAGS=-include /root/dpdk/config/rte_config.h

(quoted diff) +0 -2
-I/root/dpdk/lib/librte_eal/include -I/root/dpdk/lib/librte_kni
-I/root/dpdk/build -I/root/dpdk/kernel/linux/kni' modules

make: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64'
CC [M] /root/dpdk/build/kernel/linux/kni/kni_net.o
CC [M] /root/dpdk/build/kernel/linux/kni/kni_misc.o
/root/dpdk/kernel/linux/kni/kni_net.c:791:20: error: initialization of ‘void (*)(struct net_device *, unsigned int)’ from incompatible pointer type ‘void (*)(struct net_device *)’ [-Werror=incompatible-pointer-types]
.ndo_tx_timeout = kni_net_tx_timeout,

                     ^~~~~~~~~~~~~~~~~~

/root/dpdk/kernel/linux/kni/kni_net.c:791:20: note: (near initialization for ‘kni_net_netdev_ops.<anonymous>.ndo_tx_timeout’)
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:315:
/root/dpdk/build/kernel/linux/kni/kni_net.o] Error 1
make: *** [Makefile:1544: _module_/root/dpdk/build/kernel/linux/kni] Error 2
make: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64'
ninja: build stopped: subcommand failed.

Quoted 19 lines
---
  kernel/linux/kni/compat.h | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
kernel/linux/kni/compat.h +3 -1
index d515b27669..5f65640d5e 100644
@@ -131,7 +131,9 @@
  #define HAVE_IOVA_TO_KVA_MAPPING_SUPPORT
  #endif
 
-#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \
+       (defined(RHEL_RELEASE_CODE) && \
+        RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE)
  #define HAVE_TX_TIMEOUT_TXQUEUE
  #endif
 
Quoted 7 lines
Quoted 3 lines

--
2.25.1

Thanks.

Thanks David for testing.

#3 lore raw

26/11/2020 19:08, Ferruh Yigit:

Quoted 12 lines · David Marchand
Quoted 11 lines · Olivier Matz
Quoted 9 lines

Like what was done for mainline kernel in commit 38ad54f3bc76 ("kni: fix build with Linux 5.6"), a new parameter 'txqueue' has to be added to 'ndo_tx_timeout' ndo on RHEL 8.3 kernel.

Quoted 6 lines
Quoted 2 lines

Thanks.

Thanks David for testing.

Applied, thanks