diff --git a/qca/qca-nss-drv/patches/0005-nss-drv-add-support-for-kernel-5.15.patch b/qca/qca-nss-drv/patches/0005-nss-drv-add-support-for-kernel-5.15.patch new file mode 100644 index 0000000..0995e2a --- /dev/null +++ b/qca/qca-nss-drv/patches/0005-nss-drv-add-support-for-kernel-5.15.patch @@ -0,0 +1,70 @@ +From 6e65f6daecb09463688eaea0a234018a728196b8 Mon Sep 17 00:00:00 2001 +From: Ansuel Smith +Date: Tue, 5 Apr 2022 18:10:57 +0200 +Subject: [PATCH 5/8] nss-drv: add support for kernel 5.15 + +- Fix coredump panic notifier include change. +- Fix skb ZEROCOPY flag. +- Add skb reuse support for 5.15 kernel version. + +Signed-off-by: Ansuel Smith +--- + nss_core.c | 5 +++-- + nss_coredump.c | 4 ++++ + nss_hal/nss_hal.c | 1 + + 3 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/nss_core.c b/nss_core.c +index f9e6014..8cd1d4b 100644 +--- a/nss_core.c ++++ b/nss_core.c +@@ -53,7 +53,8 @@ + (((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)))) || \ + (((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)))) || \ + (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)))) || \ +-(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)))))) ++(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)))) || \ ++(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))))) + #error "Check skb recycle code in this file to match Linux version" + #endif + +@@ -2623,7 +2624,7 @@ static inline bool nss_core_skb_can_reuse(struct nss_ctx_instance *nss_ctx, + if (unlikely(irqs_disabled())) + return false; + +- if (unlikely(skb_shinfo(nbuf)->tx_flags & SKBTX_DEV_ZEROCOPY)) ++ if (unlikely(skb_shinfo(nbuf)->flags & SKBFL_ZEROCOPY_ENABLE)) + return false; + + if (unlikely(skb_is_nonlinear(nbuf))) +diff --git a/nss_coredump.c b/nss_coredump.c +index ecad659..3ecef7e 100644 +--- a/nss_coredump.c ++++ b/nss_coredump.c +@@ -23,7 +23,11 @@ + #include "nss_hal.h" + #include "nss_log.h" + #include ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)) + #include /* for panic_notifier_list */ ++#else ++#include ++#endif + #include /* for time */ + #include "nss_tx_rx_common.h" + +diff --git a/nss_hal/nss_hal.c b/nss_hal/nss_hal.c +index 57974c1..d8c703b 100644 +--- a/nss_hal/nss_hal.c ++++ b/nss_hal/nss_hal.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include "nss_hal.h" + #include "nss_arch.h" +-- +2.34.1 +