From 5d74080339f769a0c1157e9bfa9870a79000e6082ec26d861e056e0331d2e249 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 29 May 2022 18:51:55 +0000 Subject: [PATCH] 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 --- dpdk.changes | 6 ++++ dpdk.spec | 1 + kni-fix-build-with-Linux-5.18.patch | 49 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 kni-fix-build-with-Linux-5.18.patch diff --git a/dpdk.changes b/dpdk.changes index 4acf089..3717ba3 100644 --- a/dpdk.changes +++ b/dpdk.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 25 10:13:44 UTC 2022 - Jiri Slaby + +- 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 diff --git a/dpdk.spec b/dpdk.spec index 798d885..ec3140c 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -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 diff --git a/kni-fix-build-with-Linux-5.18.patch b/kni-fix-build-with-Linux-5.18.patch new file mode 100644 index 0000000..0cfda4b --- /dev/null +++ b/kni-fix-build-with-Linux-5.18.patch @@ -0,0 +1,49 @@ +From: Jiri Slaby +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 +--- + 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 +