Accepting request 979159 from home:jirislaby:branches:network

- add kni-fix-build-with-Linux-5.18.patch to fix build with kernel
  5.18

OBS-URL: https://build.opensuse.org/request/show/979159
OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=137
This commit is contained in:
Dirk Mueller 2022-05-29 18:51:55 +00:00 committed by Git OBS Bridge
parent 9d23b59fb8
commit 97828d5830
3 changed files with 56 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed May 25 10:13:44 UTC 2022 - Jiri Slaby <jslaby@suse.cz>
- add kni-fix-build-with-Linux-5.18.patch to fix build with kernel
5.18
-------------------------------------------------------------------
Wed Apr 27 16:08:56 UTC 2022 - Ferdinand Thiessen <rpm@fthiessen.de>

View File

@ -59,6 +59,7 @@ Source1: preamble
# PATCH-FIX-OPENSUSE PATCH-FEATURE-UPSTREAM
Patch0: 0001-build-try-to-get-kernel-version-from-kernel-source.patch
Patch1: 0002-SLE15-SP3-compatibility-patch-for-kni.patch
Patch2: kni-fix-build-with-Linux-5.18.patch
BuildRequires: binutils
BuildRequires: doxygen
BuildRequires: fdupes

View File

@ -0,0 +1,49 @@
From: Jiri Slaby <jslaby@suse.cz>
Date: Wed, 25 May 2022 12:04:10 +0200
Subject: kni: fix build with Linux 5.18
Patch-mainline: Submitted 2022/05/25, 20220525102641.20982-1-jslaby@suse.cz
References: kernel 5.18
Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.
Cc: stable@dpdk.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/linux/kni/compat.h | 4 ++++
kernel/linux/kni/kni_net.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 664785674ff1..a81846a8a895 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -141,3 +141,7 @@
#if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
#define HAVE_TSK_IN_GUP
#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
+#define HAVE_NETIF_RX_NI
+#endif
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 29e5b9e21f9e..a8b092b7567d 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
skb->ip_summed = CHECKSUM_UNNECESSARY;
/* Call netif interface */
+#ifdef HAVE_NETIF_RX_NI
netif_rx_ni(skb);
+#else
+ netif_rx(skb);
+#endif
/* Update statistics */
dev->stats.rx_bytes += len;
--
2.36.1