diff --git a/qca-nss-drv/Makefile b/qca-nss-drv/Makefile index e2311e3..b9da961 100644 --- a/qca-nss-drv/Makefile +++ b/qca-nss-drv/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=15 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-04-06 -PKG_SOURCE_VERSION:=53a0dc1 -PKG_MIRROR_HASH:=9b7774407f950f4ae8390e77e67ecdbeb0af5575191645666a0b5caa6e3bd413 +PKG_SOURCE_DATE:=2024-11-13 +PKG_SOURCE_VERSION:=d5ee67b +PKG_MIRROR_HASH:=1b1caab382e257728b00638231301af712c3ac351e449ea30f9bb1a89f961580 QSDK_VERSION:=12.5 PKG_VERSION:=$(QSDK_VERSION).$(subst -,.,$(PKG_SOURCE_DATE))~$(PKG_SOURCE_VERSION) diff --git a/qca-nss-drv/patches/0001-nss-drv-replace-ioremap_nocache-with-ioremap.patch b/qca-nss-drv/patches/0001-nss-drv-replace-ioremap_nocache-with-ioremap.patch index edbd104..d5f0bc7 100644 --- a/qca-nss-drv/patches/0001-nss-drv-replace-ioremap_nocache-with-ioremap.patch +++ b/qca-nss-drv/patches/0001-nss-drv-replace-ioremap_nocache-with-ioremap.patch @@ -26,7 +26,7 @@ Signed-off-by: Robert Marko npd->vphys = res_vphys.start; - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); -+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys)); ++ npd->nmap = nss_ioremap(npd->nphys, resource_size(&res_nphys)); if (!npd->nmap) { nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); goto out; @@ -37,14 +37,14 @@ Signed-off-by: Robert Marko npd->qgic_phys = res_qgic_phys.start; - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); -+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys)); ++ npd->nmap = nss_ioremap(npd->nphys, resource_size(&res_nphys)); if (!npd->nmap) { nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); goto out; } - npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); -+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); ++ npd->qgic_map = nss_ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); if (!npd->qgic_map) { nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); goto out; @@ -53,7 +53,7 @@ Signed-off-by: Robert Marko of_node_put(cmn); - nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); -+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); ++ nss_misc_reset = nss_ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); if (!nss_misc_reset) { pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); return -EFAULT; @@ -64,14 +64,14 @@ Signed-off-by: Robert Marko npd->qgic_phys = res_qgic_phys.start; - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); -+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys)); ++ npd->nmap = nss_ioremap(npd->nphys, resource_size(&res_nphys)); if (!npd->nmap) { nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); goto out; } - npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); -+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); ++ npd->qgic_map = nss_ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); if (!npd->qgic_map) { nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); goto out; @@ -80,14 +80,14 @@ Signed-off-by: Robert Marko of_node_put(cmn); - nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); -+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); ++ nss_misc_reset = nss_ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); if (!nss_misc_reset) { pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); return -EFAULT; } - nss_misc_reset_flag = ioremap_nocache(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag)); -+ nss_misc_reset_flag = ioremap(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag)); ++ nss_misc_reset_flag = nss_ioremap(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag)); if (!nss_misc_reset_flag) { pr_err("%px: ioremap fail for nss_misc_reset_flag\n", nss_dev); return -EFAULT; @@ -98,7 +98,7 @@ Signed-off-by: Robert Marko npd->vphys = res_vphys.start; - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); -+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys)); ++ npd->nmap = nss_ioremap(npd->nphys, resource_size(&res_nphys)); if (!npd->nmap) { nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); goto out; @@ -107,7 +107,7 @@ Signed-off-by: Robert Marko of_node_put(cmn); - fpb_base = ioremap_nocache(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base)); -+ fpb_base = ioremap(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base)); ++ fpb_base = nss_ioremap(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base)); if (!fpb_base) { pr_err("%px: ioremap fail for nss_fpb_base\n", nss_dev); return -EFAULT; @@ -118,7 +118,7 @@ Signed-off-by: Robert Marko npd->qgic_phys = res_qgic_phys.start; - npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); -+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys)); ++ npd->nmap = nss_ioremap(npd->nphys, resource_size(&res_nphys)); if (!npd->nmap) { nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); goto out; @@ -127,7 +127,7 @@ Signed-off-by: Robert Marko } - npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); -+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); ++ npd->qgic_map = nss_ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); if (!npd->qgic_map) { nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); goto out; @@ -136,64 +136,10 @@ Signed-off-by: Robert Marko of_node_put(cmn); - nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); -+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); ++ nss_misc_reset = nss_ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); if (!nss_misc_reset) { pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); return -EFAULT; ---- a/nss_hal/ipq95xx/nss_hal_pvt.c -+++ b/nss_hal/ipq95xx/nss_hal_pvt.c -@@ -291,7 +291,7 @@ static struct nss_platform_data *__nss_h - npd->vphys = res_vphys.start; - npd->qgic_phys = res_qgic_phys.start; - -- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys)); -+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys)); - if (!npd->nmap) { - nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id); - goto out; -@@ -303,7 +303,7 @@ static struct nss_platform_data *__nss_h - goto out; - } - -- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys)); -+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys)); - if (!npd->qgic_map) { - nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id); - goto out; -@@ -608,7 +608,7 @@ static int __nss_hal_common_reset(struct - - of_node_put(cmn); - -- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); -+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset)); - if (!nss_misc_reset) { - pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev); - return -EFAULT; ---- a/nss_hal/nss_hal.c -+++ b/nss_hal/nss_hal.c -@@ -81,9 +81,9 @@ int nss_hal_firmware_load(struct nss_ctx - } - - -- load_mem = ioremap_nocache(npd->load_addr, nss_fw->size); -+ load_mem = ioremap(npd->load_addr, nss_fw->size); - if (!load_mem) { -- nss_info_always("%px: ioremap_nocache failed: %x", nss_ctx, npd->load_addr); -+ nss_info_always("%px: ioremap failed: %x", nss_ctx, npd->load_addr); - release_firmware(nss_fw); - return rc; - } ---- a/nss_meminfo.c -+++ b/nss_meminfo.c -@@ -736,7 +736,7 @@ bool nss_meminfo_init(struct nss_ctx_ins - /* - * meminfo_start is the label where the start address of meminfo map is stored. - */ -- meminfo_start = (uint32_t *)ioremap_nocache(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET, -+ meminfo_start = (uint32_t *)ioremap(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET, - NSS_MEMINFO_RESERVE_AREA_SIZE); - if (!meminfo_start) { - nss_info_always("%px: cannot remap meminfo start\n", nss_ctx); --- a/nss_ppe.c +++ b/nss_ppe.c @@ -357,7 +357,7 @@ void nss_ppe_init(void) @@ -201,7 +147,7 @@ Signed-off-by: Robert Marko * Get the PPE base address */ - ppe_pvt.ppe_base = ioremap_nocache(PPE_BASE_ADDR, PPE_REG_SIZE); -+ ppe_pvt.ppe_base = ioremap(PPE_BASE_ADDR, PPE_REG_SIZE); ++ ppe_pvt.ppe_base = nss_ioremap(PPE_BASE_ADDR, PPE_REG_SIZE); if (!ppe_pvt.ppe_base) { nss_warning("DRV can't get PPE base address\n"); return; diff --git a/qca-nss-drv/patches/0002-nss-drv-add-support-for-kernel-5.15.patch b/qca-nss-drv/patches/0002-nss-drv-add-support-for-kernel-5.15.patch index 1d51382..c462cd1 100644 --- a/qca-nss-drv/patches/0002-nss-drv-add-support-for-kernel-5.15.patch +++ b/qca-nss-drv/patches/0002-nss-drv-add-support-for-kernel-5.15.patch @@ -14,42 +14,6 @@ Signed-off-by: Ansuel Smith nss_hal/nss_hal.c | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) ---- a/nss_core.c -+++ b/nss_core.c -@@ -61,7 +61,9 @@ - (((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)))) || \ - (((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, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)))) || \ -+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))) || \ -+(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)))))) - #error "Check skb recycle code in this file to match Linux version" - #endif - -@@ -2658,7 +2660,7 @@ static inline bool nss_core_skb_can_reus - 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))) ---- a/nss_coredump.c -+++ b/nss_coredump.c -@@ -25,7 +25,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" - --- a/nss_hal/nss_hal.c +++ b/nss_hal/nss_hal.c @@ -27,6 +27,7 @@ @@ -60,7 +24,7 @@ Signed-off-by: Ansuel Smith #include "nss_hal.h" #include "nss_arch.h" -@@ -64,9 +65,9 @@ int nss_hal_firmware_load(struct nss_ctx +@@ -58,9 +59,9 @@ int nss_hal_firmware_load(struct nss_ctx int rc; if (nss_ctx->id == 0) { diff --git a/qca-nss-drv/patches/0003-DMA-Fix-NULL-pointer-exceptions.patch b/qca-nss-drv/patches/0003-DMA-Fix-NULL-pointer-exceptions.patch index 4577b8a..09d1039 100644 --- a/qca-nss-drv/patches/0003-DMA-Fix-NULL-pointer-exceptions.patch +++ b/qca-nss-drv/patches/0003-DMA-Fix-NULL-pointer-exceptions.patch @@ -17,7 +17,7 @@ Signed-off-by: Robert Marko --- a/nss_core.c +++ b/nss_core.c -@@ -1660,7 +1660,7 @@ static int32_t nss_core_handle_cause_que +@@ -1664,7 +1664,7 @@ static int32_t nss_core_handle_cause_que * */ if (unlikely((buffer_type == N2H_BUFFER_CRYPTO_RESP))) { diff --git a/qca-nss-drv/patches/0004-nss-drv-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch b/qca-nss-drv/patches/0004-nss-drv-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch index 793da70..a884384 100644 --- a/qca-nss-drv/patches/0004-nss-drv-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch +++ b/qca-nss-drv/patches/0004-nss-drv-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch @@ -27,7 +27,7 @@ Signed-off-by: Christian Marangi --- a/nss_core.c +++ b/nss_core.c -@@ -1472,6 +1472,8 @@ static inline void nss_core_handle_empty +@@ -1476,6 +1476,8 @@ static inline void nss_core_handle_empty uint32_t count, uint32_t hlos_index, uint16_t mask) { @@ -36,7 +36,7 @@ Signed-off-by: Christian Marangi while (count) { /* * Since we only return the primary skb, we have no way to unmap -@@ -1525,7 +1527,9 @@ next: +@@ -1529,7 +1531,9 @@ next: n2h_desc_ring->hlos_index = hlos_index; if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE] = hlos_index; @@ -47,7 +47,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); } -@@ -1547,6 +1551,7 @@ static int32_t nss_core_handle_cause_que +@@ -1551,6 +1555,7 @@ static int32_t nss_core_handle_cause_que struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx; struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx; struct nss_if_mem_map *if_map = mem_ctx->if_map; @@ -55,7 +55,7 @@ Signed-off-by: Christian Marangi qid = nss_core_cause_to_queue(cause); -@@ -1558,7 +1563,8 @@ static int32_t nss_core_handle_cause_que +@@ -1562,7 +1567,8 @@ static int32_t nss_core_handle_cause_que n2h_desc_ring = &nss_ctx->n2h_desc_ring[qid]; desc_if = &n2h_desc_ring->desc_ring; desc_ring = desc_if->desc; @@ -65,7 +65,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); nss_index = if_map->n2h_nss_index[qid]; -@@ -1587,13 +1593,23 @@ static int32_t nss_core_handle_cause_que +@@ -1591,13 +1597,23 @@ static int32_t nss_core_handle_cause_que start = hlos_index; end = (hlos_index + count) & mask; if (end > start) { @@ -92,7 +92,7 @@ Signed-off-by: Christian Marangi } /* -@@ -1722,7 +1738,8 @@ next: +@@ -1726,7 +1742,8 @@ next: n2h_desc_ring->hlos_index = hlos_index; if_map->n2h_hlos_index[qid] = hlos_index; @@ -102,7 +102,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); return count; -@@ -1734,11 +1751,12 @@ next: +@@ -1738,11 +1755,12 @@ next: */ static void nss_core_init_nss(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map) { @@ -116,7 +116,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); /* -@@ -1835,6 +1853,7 @@ static void nss_core_alloc_paged_buffers +@@ -1839,6 +1857,7 @@ static void nss_core_alloc_paged_buffers uint16_t count, int16_t mask, int32_t hlos_index, uint32_t alloc_fail_count, uint32_t buffer_type, uint32_t buffer_queue, uint32_t stats_index) { @@ -124,7 +124,7 @@ Signed-off-by: Christian Marangi struct sk_buff *nbuf; struct page *npage; struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[buffer_queue]; -@@ -1904,7 +1923,9 @@ static void nss_core_alloc_paged_buffers +@@ -1908,7 +1927,9 @@ static void nss_core_alloc_paged_buffers /* * Flush the descriptor */ @@ -135,7 +135,7 @@ Signed-off-by: Christian Marangi hlos_index = (hlos_index + 1) & (mask); count--; -@@ -1918,7 +1939,8 @@ static void nss_core_alloc_paged_buffers +@@ -1922,7 +1943,8 @@ static void nss_core_alloc_paged_buffers h2n_desc_ring->hlos_index = hlos_index; if_map->h2n_hlos_index[buffer_queue] = hlos_index; @@ -145,7 +145,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); NSS_PKT_STATS_INC(&nss_top->stats_drv[stats_index]); -@@ -1931,7 +1953,7 @@ static void nss_core_alloc_paged_buffers +@@ -1935,7 +1957,7 @@ static void nss_core_alloc_paged_buffers static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, int jumbo_mru, uint16_t count, int16_t mask, int32_t hlos_index) { @@ -154,7 +154,7 @@ Signed-off-by: Christian Marangi struct sk_buff *nbuf; struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring; -@@ -1978,7 +2000,9 @@ static void nss_core_alloc_jumbo_mru_buf +@@ -1982,7 +2004,9 @@ static void nss_core_alloc_jumbo_mru_buf /* * Flush the descriptor */ @@ -165,7 +165,7 @@ Signed-off-by: Christian Marangi hlos_index = (hlos_index + 1) & (mask); count--; -@@ -1992,7 +2016,8 @@ static void nss_core_alloc_jumbo_mru_buf +@@ -1996,7 +2020,8 @@ static void nss_core_alloc_jumbo_mru_buf h2n_desc_ring->hlos_index = hlos_index; if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index; @@ -175,7 +175,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]); -@@ -2005,6 +2030,7 @@ static void nss_core_alloc_jumbo_mru_buf +@@ -2009,6 +2034,7 @@ static void nss_core_alloc_jumbo_mru_buf static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, uint16_t max_buf_size, uint16_t count, int16_t mask, int32_t hlos_index) { @@ -183,7 +183,7 @@ Signed-off-by: Christian Marangi struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring; struct h2n_descriptor *desc_ring = desc_if->desc; -@@ -2012,6 +2038,7 @@ static void nss_core_alloc_max_avail_siz +@@ -2016,6 +2042,7 @@ static void nss_core_alloc_max_avail_siz uint16_t payload_len = max_buf_size + NET_SKB_PAD; uint16_t start = hlos_index; uint16_t prev_hlos_index; @@ -191,7 +191,7 @@ Signed-off-by: Christian Marangi while (count) { dma_addr_t buffer; -@@ -2064,13 +2091,26 @@ static void nss_core_alloc_max_avail_siz +@@ -2068,13 +2095,26 @@ static void nss_core_alloc_max_avail_siz * Flush the descriptors, including the descriptor at prev_hlos_index. */ if (prev_hlos_index > start) { @@ -221,7 +221,7 @@ Signed-off-by: Christian Marangi } /* -@@ -2081,7 +2121,8 @@ static void nss_core_alloc_max_avail_siz +@@ -2085,7 +2125,8 @@ static void nss_core_alloc_max_avail_siz h2n_desc_ring->hlos_index = hlos_index; if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index; @@ -231,7 +231,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]); -@@ -2094,6 +2135,7 @@ static void nss_core_alloc_max_avail_siz +@@ -2098,6 +2139,7 @@ static void nss_core_alloc_max_avail_siz static inline void nss_core_handle_empty_buffer_sos(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, uint16_t max_buf_size) { @@ -239,7 +239,7 @@ Signed-off-by: Christian Marangi uint16_t count, size, mask; int32_t nss_index, hlos_index; struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; -@@ -2104,7 +2146,8 @@ static inline void nss_core_handle_empty +@@ -2108,7 +2150,8 @@ static inline void nss_core_handle_empty /* * Check how many empty buffers could be filled in queue */ @@ -249,7 +249,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE]; -@@ -2149,6 +2192,7 @@ static inline void nss_core_handle_empty +@@ -2153,6 +2196,7 @@ static inline void nss_core_handle_empty static inline void nss_core_handle_paged_empty_buffer_sos(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map, uint16_t max_buf_size) { @@ -257,7 +257,7 @@ Signed-off-by: Christian Marangi uint16_t count, size, mask; int32_t nss_index, hlos_index; struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE]; -@@ -2156,7 +2200,8 @@ static inline void nss_core_handle_paged +@@ -2160,7 +2204,8 @@ static inline void nss_core_handle_paged /* * Check how many empty buffers could be filled in queue */ @@ -267,7 +267,7 @@ Signed-off-by: Christian Marangi NSS_CORE_DSB(); nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE]; -@@ -2733,9 +2778,11 @@ void nss_skb_reuse(struct sk_buff *nbuf) +@@ -2751,9 +2796,11 @@ void nss_skb_reuse(struct sk_buff *nbuf) * Sends one skb to NSS FW */ static inline int32_t nss_core_send_buffer_simple_skb(struct nss_ctx_instance *nss_ctx, @@ -281,7 +281,7 @@ Signed-off-by: Christian Marangi struct h2n_descriptor *desc_ring = desc_if->desc; struct h2n_descriptor *desc; uint16_t bit_flags; -@@ -2789,7 +2836,8 @@ static inline int32_t nss_core_send_buff +@@ -2807,7 +2854,8 @@ static inline int32_t nss_core_send_buff (nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len, sz, (uint32_t)nbuf->priority, mss, bit_flags); @@ -291,7 +291,7 @@ Signed-off-by: Christian Marangi /* * We are done using the skb fields and can reuse it now -@@ -2813,7 +2861,8 @@ no_reuse: +@@ -2831,7 +2879,8 @@ no_reuse: (nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len, (uint16_t)skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags); @@ -301,7 +301,7 @@ Signed-off-by: Christian Marangi NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_SIMPLE]); return 1; -@@ -2827,9 +2876,11 @@ no_reuse: +@@ -2845,9 +2894,11 @@ no_reuse: * Used to differentiate from FRAGLIST */ static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss_ctx, @@ -315,7 +315,7 @@ Signed-off-by: Christian Marangi struct h2n_descriptor *desc_ring = desc_if->desc; struct h2n_descriptor *desc; const skb_frag_t *frag; -@@ -2869,7 +2920,8 @@ static inline int32_t nss_core_send_buff +@@ -2887,7 +2938,8 @@ static inline int32_t nss_core_send_buff (nss_ptr_t)NULL, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len, skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT); @@ -325,7 +325,7 @@ Signed-off-by: Christian Marangi /* * Now handle rest of the fragments. -@@ -2893,7 +2945,8 @@ static inline int32_t nss_core_send_buff +@@ -2911,7 +2963,8 @@ static inline int32_t nss_core_send_buff (nss_ptr_t)NULL, 0, skb_frag_size(frag), skb_frag_size(frag), nbuf->priority, mss, bit_flags); @@ -335,7 +335,7 @@ Signed-off-by: Christian Marangi } /* -@@ -2909,7 +2962,8 @@ static inline int32_t nss_core_send_buff +@@ -2927,7 +2980,8 @@ static inline int32_t nss_core_send_buff desc->bit_flags &= ~(H2N_BIT_FLAG_DISCARD); desc->opaque = (nss_ptr_t)nbuf; @@ -345,7 +345,7 @@ Signed-off-by: Christian Marangi NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_NR_FRAGS]); return i+1; -@@ -2923,9 +2977,11 @@ static inline int32_t nss_core_send_buff +@@ -2941,9 +2995,11 @@ static inline int32_t nss_core_send_buff * Used to differentiate from FRAGS */ static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss_ctx, @@ -359,7 +359,7 @@ Signed-off-by: Christian Marangi struct h2n_descriptor *desc_ring = desc_if->desc; struct h2n_descriptor *desc; dma_addr_t buffer; -@@ -2964,7 +3020,8 @@ static inline int32_t nss_core_send_buff +@@ -2982,7 +3038,8 @@ static inline int32_t nss_core_send_buff (nss_ptr_t)nbuf, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len, skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT); @@ -369,7 +369,7 @@ Signed-off-by: Christian Marangi /* * Walk the frag_list in nbuf -@@ -3017,7 +3074,8 @@ static inline int32_t nss_core_send_buff +@@ -3035,7 +3092,8 @@ static inline int32_t nss_core_send_buff (nss_ptr_t)iter, iter->data - iter->head, iter->len - iter->data_len, skb_end_offset(iter), iter->priority, mss, bit_flags); @@ -379,7 +379,7 @@ Signed-off-by: Christian Marangi i++; } -@@ -3036,7 +3094,8 @@ static inline int32_t nss_core_send_buff +@@ -3054,7 +3112,8 @@ static inline int32_t nss_core_send_buff * Update bit flag for last descriptor. */ desc->bit_flags |= H2N_BIT_FLAG_LAST_SEGMENT; @@ -389,7 +389,7 @@ Signed-off-by: Christian Marangi NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_FRAGLIST]); return i+1; -@@ -3115,8 +3174,10 @@ int32_t nss_core_send_buffer(struct nss_ +@@ -3133,8 +3192,10 @@ int32_t nss_core_send_buffer(struct nss_ * We need to work out if there's sufficent space in our transmit descriptor * ring to place all the segments of a nbuf. */ @@ -401,7 +401,7 @@ Signed-off-by: Christian Marangi nss_index = if_map->h2n_nss_index[qid]; h2n_desc_ring->nss_index_local = nss_index; count = ((nss_index - hlos_index - 1) + size) & (mask); -@@ -3181,13 +3242,13 @@ int32_t nss_core_send_buffer(struct nss_ +@@ -3199,13 +3260,13 @@ int32_t nss_core_send_buffer(struct nss_ count = 0; if (likely((segments == 0) || is_bounce)) { count = nss_core_send_buffer_simple_skb(nss_ctx, desc_if, if_num, @@ -418,7 +418,7 @@ Signed-off-by: Christian Marangi } if (unlikely(count <= 0)) { -@@ -3211,7 +3272,8 @@ int32_t nss_core_send_buffer(struct nss_ +@@ -3229,7 +3290,8 @@ int32_t nss_core_send_buffer(struct nss_ h2n_desc_ring->hlos_index = hlos_index; if_map->h2n_hlos_index[qid] = hlos_index; @@ -430,15 +430,14 @@ Signed-off-by: Christian Marangi #ifdef CONFIG_DEBUG_KMEMLEAK --- a/nss_core.h +++ b/nss_core.h -@@ -105,31 +105,30 @@ - #endif +@@ -108,9 +108,22 @@ /* -- * Cache operation -+ * DMA Offset helper - */ + * Cache operation +- */ -#define NSS_CORE_DSB() dsb(sy) -#define NSS_CORE_DMA_CACHE_MAINT(start, size, dir) nss_core_dma_cache_maint(start, size, dir) ++*/ +#define n2h_desc_index_offset(_index) sizeof(struct n2h_descriptor) * (_index) +#define h2n_desc_index_offset(_index) sizeof(struct h2n_descriptor) * (_index) + @@ -455,11 +454,15 @@ Signed-off-by: Christian Marangi +#define h2n_hlos_index_to_dma(_if_map_addr, _index) (_if_map_addr) + h2n_hlos_index_offset + (sizeof(uint32_t) * (_index)) +#define n2h_hlos_index_to_dma(_if_map_addr, _index) (_if_map_addr) + n2h_hlos_index_offset + (sizeof(uint32_t) * (_index)) + #if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)) + #define nss_ioremap ioremap_nocache +@@ -119,26 +132,11 @@ + #endif + /* - * nss_core_dma_cache_maint() - * Perform the appropriate cache op based on direction -+ * Cache operation - */ +- */ -static inline void nss_core_dma_cache_maint(void *start, uint32_t size, int direction) -{ - switch (direction) { @@ -476,12 +479,15 @@ Signed-off-by: Christian Marangi - BUG(); - } -} +- ++ * Cache operation ++*/ +#define NSS_CORE_DSB() dsb(sy) +#define NSS_CORE_DMA_CACHE_MAINT(dev, start, size, dir) BUILD_BUG_ON_MSG(1, \ + "NSS_CORE_DMA_CACHE_MAINT is deprecated. Fix the code to use correct dma_sync_* API") - #define NSS_DEVICE_IF_START NSS_PHYSICAL_IF_START + #define NSS_IS_IF_TYPE(type, if_num) ((if_num >= NSS_##type##_IF_START) && (if_num < (NSS_##type##_IF_START + NSS_MAX_##type##_INTERFACES))) --- a/nss_hal/ipq806x/nss_hal_pvt.c +++ b/nss_hal/ipq806x/nss_hal_pvt.c @@ -477,10 +477,9 @@ static struct nss_platform_data *__nss_h diff --git a/qca-nss-drv/patches/0005-nss-drv-rework-getting-the-reserved-memory-size.patch b/qca-nss-drv/patches/0005-nss-drv-rework-getting-the-reserved-memory-size.patch index 7bb8549..b8e63a6 100644 --- a/qca-nss-drv/patches/0005-nss-drv-rework-getting-the-reserved-memory-size.patch +++ b/qca-nss-drv/patches/0005-nss-drv-rework-getting-the-reserved-memory-size.patch @@ -30,7 +30,7 @@ Signed-off-by: Robert Marko #include #include #ifdef CONFIG_BRIDGE_NETFILTER -@@ -492,50 +494,38 @@ static void nss_core_handle_crypto_pkt(s +@@ -491,50 +493,38 @@ static void nss_core_handle_crypto_pkt(s */ static uint32_t nss_soc_mem_info(void) { diff --git a/qca-nss-drv/patches/0006-nss-drv-Fix-nss_clmap_stats-enum-int-compilation-error-GCC-13.patch b/qca-nss-drv/patches/0006-nss-drv-Fix-nss_clmap_stats-enum-int-compilation-error-GCC-13.patch index 7cdb012..17d5cb6 100644 --- a/qca-nss-drv/patches/0006-nss-drv-Fix-nss_clmap_stats-enum-int-compilation-error-GCC-13.patch +++ b/qca-nss-drv/patches/0006-nss-drv-Fix-nss_clmap_stats-enum-int-compilation-error-GCC-13.patch @@ -1,8 +1,8 @@ --- a/nss_clmap_stats.c +++ b/nss_clmap_stats.c -@@ -63,7 +63,7 @@ void nss_clmap_stats_session_unregister( +@@ -66,7 +66,7 @@ void nss_clmap_stats_session_unregister( * nss_clmap_stats_session_register - * Register debug statistic for clmap session. + * Register debug statistic for clmap session. */ -bool nss_clmap_stats_session_register(uint32_t if_num, uint32_t if_type, struct net_device *netdev) +bool nss_clmap_stats_session_register(uint32_t if_num, enum nss_clmap_interface_type if_type, struct net_device *netdev) diff --git a/qca-nss-drv/patches/0007-nss-drv-Fix-nss_wifili_if-compilation-error-GCC-13.patch b/qca-nss-drv/patches/0007-nss-drv-Fix-nss_wifili_if-compilation-error-GCC-13.patch index d2ff523..cc4e38d 100644 --- a/qca-nss-drv/patches/0007-nss-drv-Fix-nss_wifili_if-compilation-error-GCC-13.patch +++ b/qca-nss-drv/patches/0007-nss-drv-Fix-nss_wifili_if-compilation-error-GCC-13.patch @@ -1,6 +1,6 @@ --- a/exports/nss_wifili_if.h +++ b/exports/nss_wifili_if.h -@@ -2211,7 +2211,7 @@ void nss_wifili_release_external_if(nss_ +@@ -2263,7 +2263,7 @@ void nss_wifili_release_external_if(nss_ */ uint8_t nss_wifili_thread_scheme_alloc(struct nss_ctx_instance *nss_ctx, int32_t radio_ifnum, diff --git a/qca-nss-drv/patches/0008-Add-kernel-6.1-support.patch b/qca-nss-drv/patches/0008-Add-kernel-6.1-support.patch index 9446de9..47fca01 100644 --- a/qca-nss-drv/patches/0008-Add-kernel-6.1-support.patch +++ b/qca-nss-drv/patches/0008-Add-kernel-6.1-support.patch @@ -181,14 +181,3 @@ err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx); } ---- a/nss_hal/ipq95xx/nss_hal_pvt.c -+++ b/nss_hal/ipq95xx/nss_hal_pvt.c -@@ -889,7 +889,7 @@ static int __nss_hal_request_irq(struct - return err; - } - -- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt); -+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt); - int_ctx->cause = cause; - err = request_irq(irq, nss_hal_handle_irq, 0, irq_name, int_ctx); - if (err) { diff --git a/qca-nss-drv/patches/0010-nss-drv-dynamic-interface-desc.patch b/qca-nss-drv/patches/0010-nss-drv-dynamic-interface-desc.patch index 6d3434b..bafd3f1 100644 --- a/qca-nss-drv/patches/0010-nss-drv-dynamic-interface-desc.patch +++ b/qca-nss-drv/patches/0010-nss-drv-dynamic-interface-desc.patch @@ -1,6 +1,6 @@ --- a/nss_dynamic_interface_stats.c +++ b/nss_dynamic_interface_stats.c -@@ -87,8 +87,15 @@ const char *nss_dynamic_interface_type_n +@@ -88,8 +88,15 @@ const char *nss_dynamic_interface_type_n "NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N", "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0", "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1", diff --git a/qca-nss-drv/patches/0011-nss-drv-move-only-for-ipq806x.patch b/qca-nss-drv/patches/0011-nss-drv-move-only-for-ipq806x.patch index 27e4979..4bae1f5 100644 --- a/qca-nss-drv/patches/0011-nss-drv-move-only-for-ipq806x.patch +++ b/qca-nss-drv/patches/0011-nss-drv-move-only-for-ipq806x.patch @@ -1,6 +1,6 @@ --- a/nss_stats.c +++ b/nss_stats.c -@@ -400,9 +400,9 @@ void nss_stats_create_dentry(char *name, +@@ -407,9 +407,9 @@ void nss_stats_create_dentry(char *name, /* * gmac_stats_ops */ @@ -13,7 +13,7 @@ /* * wt_stats_ops -@@ -457,9 +457,9 @@ void nss_stats_init(void) +@@ -464,9 +464,9 @@ void nss_stats_init(void) /* * gmac_stats */ diff --git a/qca-nss-drv/patches/0012-nss-drv-quiet-messages.patch b/qca-nss-drv/patches/0012-nss-drv-quiet-messages.patch index 6d3b124..b897d22 100644 --- a/qca-nss-drv/patches/0012-nss-drv-quiet-messages.patch +++ b/qca-nss-drv/patches/0012-nss-drv-quiet-messages.patch @@ -1,6 +1,6 @@ --- a/nss_core.c +++ b/nss_core.c -@@ -518,7 +518,7 @@ static uint32_t nss_soc_mem_info(void) +@@ -517,7 +517,7 @@ static uint32_t nss_soc_mem_info(void) goto err_use_default_memsize; } diff --git a/qca-nss-drv/patches/0013-nss-drv-remove-legacy-wifi.patch b/qca-nss-drv/patches/0013-nss-drv-remove-legacy-wifi.patch index 3d43b4f..2f5d7f3 100644 --- a/qca-nss-drv/patches/0013-nss-drv-remove-legacy-wifi.patch +++ b/qca-nss-drv/patches/0013-nss-drv-remove-legacy-wifi.patch @@ -21,7 +21,7 @@ nss_wifili_log.o \ --- a/nss_hal/nss_hal.c +++ b/nss_hal/nss_hal.c -@@ -593,7 +593,9 @@ int nss_hal_probe(struct platform_device +@@ -587,7 +587,9 @@ int nss_hal_probe(struct platform_device if (npd->wifioffload_enabled == NSS_FEATURE_ENABLED) { nss_top->wifi_handler_id = nss_dev->id; nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id; diff --git a/qca-nss-drv/patches/0014-nss-drv-avoid-recreating-virt_if.patch b/qca-nss-drv/patches/0014-nss-drv-avoid-recreating-virt_if.patch index 3de48d4..6ad5aa1 100644 --- a/qca-nss-drv/patches/0014-nss-drv-avoid-recreating-virt_if.patch +++ b/qca-nss-drv/patches/0014-nss-drv-avoid-recreating-virt_if.patch @@ -1,6 +1,6 @@ --- a/nss_stats.c +++ b/nss_stats.c -@@ -388,8 +388,9 @@ size_t nss_stats_print(char *node, char +@@ -395,8 +395,9 @@ size_t nss_stats_print(char *node, char */ void nss_stats_create_dentry(char *name, const struct file_operations *ops) { diff --git a/qca-nss-drv/patches/0016-nss-drv-add-support-for-kernel-6.6.patch b/qca-nss-drv/patches/0016-nss-drv-add-support-for-kernel-6.6.patch index 53b0314..68b9594 100644 --- a/qca-nss-drv/patches/0016-nss-drv-add-support-for-kernel-6.6.patch +++ b/qca-nss-drv/patches/0016-nss-drv-add-support-for-kernel-6.6.patch @@ -1,233 +1,3 @@ ---- a/nss_core.c -+++ b/nss_core.c -@@ -65,7 +65,7 @@ - (((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, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))) || \ --(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)))))) -+(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)))))) - #error "Check skb recycle code in this file to match Linux version" - #endif - ---- a/nss_dynamic_interface.c -+++ b/nss_dynamic_interface.c -@@ -226,7 +226,7 @@ int nss_dynamic_interface_alloc_node(enu - core_id = nss_top_main.dynamic_interface_table[type]; - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id]; - di_data.if_num = -1; -- di_data.response = false; -+ di_data.response = -1; - init_completion(&di_data.complete); - - nss_dynamic_interface_msg_init(&ndim, NSS_DYNAMIC_INTERFACE, NSS_DYNAMIC_INTERFACE_ALLOC_NODE, -@@ -285,7 +285,7 @@ nss_tx_status_t nss_dynamic_interface_de - - core_id = nss_top_main.dynamic_interface_table[type]; - nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[core_id]; -- di_data.response = false; -+ di_data.response = -1; - init_completion(&di_data.complete); - - if (nss_is_dynamic_interface(if_num) == false) { ---- a/nss_init.c -+++ b/nss_init.c -@@ -592,48 +592,12 @@ static struct ctl_table nss_general_tabl - { } - }; - --static struct ctl_table nss_init_dir[] = { --#if (NSS_FREQ_SCALE_SUPPORT == 1) -- { -- .procname = "clock", -- .mode = 0555, -- .child = nss_freq_table, -- }, --#endif -- { -- .procname = "general", -- .mode = 0555, -- .child = nss_general_table, -- }, --#if (NSS_SKB_REUSE_SUPPORT == 1) -- { -- .procname = "skb_reuse", -- .mode = 0555, -- .child = nss_skb_reuse_table, -- }, --#endif -- { } --}; -- --static struct ctl_table nss_root_dir[] = { -- { -- .procname = "nss", -- .mode = 0555, -- .child = nss_init_dir, -- }, -- { } --}; -- --static struct ctl_table nss_root[] = { -- { -- .procname = "dev", -- .mode = 0555, -- .child = nss_root_dir, -- }, -- { } --}; -- --static struct ctl_table_header *nss_dev_header; -+static struct ctl_table_header *nss_clock_header; -+static struct ctl_table_header *nss_skb_header; -+static struct ctl_table_header *nss_general_header; -+static struct ctl_table *nss_clock_table; -+static struct ctl_table *nss_skb_reuse_tabl; -+static struct ctl_table *nss_general_tabl; - - /* - * nss_init() -@@ -785,7 +749,16 @@ nss_info("Init NSS driver"); - /* - * Register sysctl table. - */ -- nss_dev_header = register_sysctl_table(nss_root); -+ // to avoid multiple calls to `register_sysctl_table` -+ nss_general_header = register_sysctl("dev/nss/general", nss_general_table); -+ -+#if (NSS_SKB_REUSE_SUPPORT == 1) -+ nss_skb_header = register_sysctl("dev/nss/skb_reuse", nss_skb_reuse_table); -+#endif -+ -+#if (NSS_FREQ_SCALE_SUPPORT == 1) -+ nss_clock_header = register_sysctl("dev/nss/clock", nss_freq_table); -+#endif - - /* - * Registering sysctl for ipv4/6 specific config. -@@ -948,8 +921,18 @@ static void __exit nss_cleanup(void) - { - nss_info("Exit NSS driver"); - -- if (nss_dev_header) -- unregister_sysctl_table(nss_dev_header); -+ if (nss_general_header) -+ unregister_sysctl_table(nss_general_header); -+ -+#if (NSS_SKB_REUSE_SUPPORT == 1) -+ if (nss_skb_header) -+ unregister_sysctl_table(nss_skb_header); -+#endif -+ -+#if (NSS_FREQ_SCALE_SUPPORT == 1) -+ if (nss_clock_header) -+ unregister_sysctl_table(nss_clock_header); -+#endif - - /* - * Unregister n2h specific sysctl ---- a/nss_project.c -+++ b/nss_project.c -@@ -333,33 +333,6 @@ static struct ctl_table nss_project_tabl - { } - }; - --static struct ctl_table nss_project_dir[] = { -- { -- .procname = "project", -- .mode = 0555, -- .child = nss_project_table, -- }, -- { } --}; -- --static struct ctl_table nss_project_root_dir[] = { -- { -- .procname = "nss", -- .mode = 0555, -- .child = nss_project_dir, -- }, -- { } --}; -- --static struct ctl_table nss_project_root[] = { -- { -- .procname = "dev", -- .mode = 0555, -- .child = nss_project_root_dir, -- }, -- { } --}; -- - static struct ctl_table_header *nss_project_header; - - /* -@@ -368,7 +341,7 @@ static struct ctl_table_header *nss_proj - */ - void nss_project_register_sysctl(void) - { -- nss_project_header = register_sysctl_table(nss_project_root); -+ nss_project_header = register_sysctl("dev/nss/project", nss_project_table); - } - - /* ---- a/nss_n2h.c -+++ b/nss_n2h.c -@@ -1904,36 +1904,6 @@ static struct ctl_table nss_n2h_table_mu - { } - }; - --/* -- * This table will be overwritten during single-core registration -- */ --static struct ctl_table nss_n2h_dir[] = { -- { -- .procname = "n2hcfg", -- .mode = 0555, -- .child = nss_n2h_table_multi_core, -- }, -- { } --}; -- --static struct ctl_table nss_n2h_root_dir[] = { -- { -- .procname = "nss", -- .mode = 0555, -- .child = nss_n2h_dir, -- }, -- { } --}; -- --static struct ctl_table nss_n2h_root[] = { -- { -- .procname = "dev", -- .mode = 0555, -- .child = nss_n2h_root_dir, -- }, -- { } --}; -- - static struct ctl_table_header *nss_n2h_header; - - /* -@@ -2282,8 +2252,7 @@ void nss_n2h_single_core_register_sysctl - /* - * Register sysctl table. - */ -- nss_n2h_dir[0].child = nss_n2h_table_single_core; -- nss_n2h_header = register_sysctl_table(nss_n2h_root); -+ nss_n2h_header = register_sysctl("dev/nss/n2hcfg", nss_n2h_table_single_core); - } - - /* -@@ -2381,7 +2350,7 @@ void nss_n2h_multi_core_register_sysctl( - /* - * Register sysctl table. - */ -- nss_n2h_header = register_sysctl_table(nss_n2h_root); -+ nss_n2h_header = register_sysctl("dev/nss/n2hcfg", nss_n2h_table_multi_core); - } - - /* --- a/nss_ppe_vp.c +++ b/nss_ppe_vp.c @@ -783,24 +783,6 @@ static struct ctl_table nss_ppe_vp_table @@ -308,95 +78,6 @@ + nss_pppoe_header = register_sysctl("dev/nss/pppoe", nss_pppoe_table); } - /* ---- a/nss_rps.c -+++ b/nss_rps.c -@@ -577,33 +577,6 @@ static struct ctl_table nss_rps_table[] - { } - }; - --static struct ctl_table nss_rps_dir[] = { -- { -- .procname = "rps", -- .mode = 0555, -- .child = nss_rps_table, -- }, -- { } --}; -- --static struct ctl_table nss_rps_root_dir[] = { -- { -- .procname = "nss", -- .mode = 0555, -- .child = nss_rps_dir, -- }, -- { } --}; -- --static struct ctl_table nss_rps_root[] = { -- { -- .procname = "dev", -- .mode = 0555, -- .child = nss_rps_root_dir, -- }, -- { } --}; -- - static struct ctl_table_header *nss_rps_header; - - /* -@@ -640,7 +613,7 @@ void nss_rps_register_sysctl(void) - /* - * Register sysctl table. - */ -- nss_rps_header = register_sysctl_table(nss_rps_root); -+ nss_rps_header = register_sysctl("dev/nss/rps", nss_rps_table); - } - - /* ---- a/nss_stats.c -+++ b/nss_stats.c -@@ -88,32 +88,6 @@ static struct ctl_table nss_stats_table[ - { } - }; - --static struct ctl_table nss_stats_dir[] = { -- { -- .procname = "stats", -- .mode = 0555, -- .child = nss_stats_table, -- }, -- { } --}; -- --static struct ctl_table nss_stats_root_dir[] = { -- { -- .procname = "nss", -- .mode = 0555, -- .child = nss_stats_dir, -- }, -- { } --}; -- --static struct ctl_table nss_stats_root[] = { -- { -- .procname = "dev", -- .mode = 0555, -- .child = nss_stats_root_dir, -- }, -- { } --}; - static struct ctl_table_header *nss_stats_header; - - /* -@@ -125,7 +99,7 @@ void nss_stats_register_sysctl(void) - /* - * Register sysctl table. - */ -- nss_stats_header = register_sysctl_table(nss_stats_root); -+ nss_stats_header = register_sysctl("dev/nss/stats", nss_stats_table); - } - /* --- a/nss_c2c_tx.c +++ b/nss_c2c_tx.c @@ -442,51 +123,6 @@ + nss_c2c_tx_header = register_sysctl("dev/nss/c2c_tx", nss_c2c_tx_table); } - /* ---- a/nss_dma.c -+++ b/nss_dma.c -@@ -378,33 +378,6 @@ static struct ctl_table nss_dma_table[] - { } - }; - --static struct ctl_table nss_dma_dir[] = { -- { -- .procname = "dma", -- .mode = 0555, -- .child = nss_dma_table, -- }, -- { } --}; -- --static struct ctl_table nss_dma_root_dir[] = { -- { -- .procname = "nss", -- .mode = 0555, -- .child = nss_dma_dir, -- }, -- { } --}; -- --static struct ctl_table nss_dma_root[] = { -- { -- .procname = "dev", -- .mode = 0555, -- .child = nss_dma_root_dir, -- }, -- { } --}; -- - static struct ctl_table_header *nss_dma_header; - - /* -@@ -422,7 +395,7 @@ void nss_dma_register_sysctl(void) - /* - * Register sysctl table. - */ -- nss_dma_header = register_sysctl_table(nss_dma_root); -+ nss_dma_header = register_sysctl("dev/nss/dma", nss_dma_table); - } - /* --- a/nss_ipv4.c +++ b/nss_ipv4.c @@ -597,7 +233,7 @@ /* --- a/nss_pm.c +++ b/nss_pm.c -@@ -323,6 +323,7 @@ error: +@@ -326,6 +326,7 @@ error: nss_pm_interface_status_t nss_pm_set_perf_level(void *handle, nss_pm_perf_level_t lvl) { #if ((NSS_DT_SUPPORT == 1) && (NSS_FREQ_SCALE_SUPPORT == 1)) @@ -605,12 +241,8 @@ nss_freq_scales_t index; switch (lvl) { -@@ -335,10 +336,9 @@ nss_pm_interface_status_t nss_pm_set_per - break; - - default: -- index = NSS_PM_PERF_LEVEL_IDLE; -+ index = (nss_freq_scales_t)NSS_PM_PERF_LEVEL_IDLE; +@@ -341,7 +342,6 @@ nss_pm_interface_status_t nss_pm_set_per + index = NSS_FREQ_MID_SCALE; } -#if !defined(NSS_HAL_IPQ807x_SUPPORT) diff --git a/qca-nss-drv/patches/0017-nss-drv-wifili-add-exported-symbols.patch b/qca-nss-drv/patches/0017-nss-drv-wifili-add-exported-symbols.patch index 50102d5..917c844 100644 --- a/qca-nss-drv/patches/0017-nss-drv-wifili-add-exported-symbols.patch +++ b/qca-nss-drv/patches/0017-nss-drv-wifili-add-exported-symbols.patch @@ -1,6 +1,6 @@ --- a/exports/nss_wifili_if.h +++ b/exports/nss_wifili_if.h -@@ -699,6 +699,15 @@ struct nss_wifili_stats_notification { +@@ -751,6 +751,15 @@ struct nss_wifili_stats_notification { struct nss_wifili_stats stats; /**< Wifili statistics. */ }; diff --git a/qca-nss-drv/patches/0018-nss-drv-more-uniform-kernel-msg.patch b/qca-nss-drv/patches/0018-nss-drv-more-uniform-kernel-msg.patch index 6756d50..4f530ee 100644 --- a/qca-nss-drv/patches/0018-nss-drv-more-uniform-kernel-msg.patch +++ b/qca-nss-drv/patches/0018-nss-drv-more-uniform-kernel-msg.patch @@ -66,7 +66,7 @@ --- a/nss_core.c +++ b/nss_core.c -@@ -2279,7 +2279,7 @@ static void nss_core_handle_cause_nonque +@@ -2283,7 +2283,7 @@ static void nss_core_handle_cause_nonque nss_core_init_nss(nss_ctx, if_map); nss_send_ddr_info(nss_ctx); @@ -77,7 +77,7 @@ #ifdef NSS_DRV_C2C_ENABLE --- a/nss_hal/nss_hal.c +++ b/nss_hal/nss_hal.c -@@ -89,7 +89,7 @@ int nss_hal_firmware_load(struct nss_ctx +@@ -83,7 +83,7 @@ int nss_hal_firmware_load(struct nss_ctx return rc; } diff --git a/qca-nss-drv/patches/0020-nss-drv-display-fw-version.patch b/qca-nss-drv/patches/0020-nss-drv-display-fw-version.patch index f8a0010..1ee7824 100644 --- a/qca-nss-drv/patches/0020-nss-drv-display-fw-version.patch +++ b/qca-nss-drv/patches/0020-nss-drv-display-fw-version.patch @@ -8,18 +8,12 @@ #include "nss_core.h" #include "nss_tx_rx_common.h" #ifdef NSS_DATA_PLANE_GENERIC_SUPPORT -@@ -51,6 +50,7 @@ +@@ -51,6 +50,57 @@ */ #define NSS_AP0_IMAGE "qca-nss0.bin" #define NSS_AP1_IMAGE "qca-nss1.bin" +#define BUFFER_SIZE 8192 - - /* - * File local/Static variables/functions -@@ -58,6 +58,56 @@ - static const struct net_device_ops nss_netdev_ops; - static const struct ethtool_ops nss_ethtool_ops; - ++ +// Function to search for the byte sequence in the buffer +static unsigned char *search_sequence(const unsigned char *buffer, + size_t buffer_size, @@ -69,19 +63,10 @@ + + return 0; +} -+ + int nss_hal_firmware_load(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd) { - const struct firmware *nss_fw; -@@ -81,7 +131,6 @@ int nss_hal_firmware_load(struct nss_ctx - return rc; - } - -- - load_mem = ioremap(npd->load_addr, nss_fw->size); - if (!load_mem) { - nss_info_always("%px: ioremap failed: %x", nss_ctx, npd->load_addr); -@@ -89,6 +138,10 @@ int nss_hal_firmware_load(struct nss_ctx +@@ -83,6 +133,10 @@ int nss_hal_firmware_load(struct nss_ctx return rc; } diff --git a/qca-nss-drv/patches/0022-nss-drv-limit-fw-12.2.patch b/qca-nss-drv/patches/0022-nss-drv-limit-fw-12.2.patch index a624689..8aff8b4 100644 --- a/qca-nss-drv/patches/0022-nss-drv-limit-fw-12.2.patch +++ b/qca-nss-drv/patches/0022-nss-drv-limit-fw-12.2.patch @@ -95,7 +95,7 @@ --- a/exports/nss_wifili_if.h +++ b/exports/nss_wifili_if.h -@@ -1444,8 +1444,10 @@ struct nss_wifili_rx_ctrl_stats { +@@ -1496,8 +1496,10 @@ struct nss_wifili_rx_ctrl_stats { uint32_t bcast_rcv_bytes; /**< Total number of broadcast bytes received. */ uint32_t defrag_mcast_drop; /**< Total number of defrag multicast dropped packets. */ uint32_t mcast_3addr_drop; /**< Total number of 3 address multicast dropped packets. */ @@ -106,7 +106,7 @@ }; /** -@@ -1457,8 +1459,10 @@ struct nss_wifili_retry_ctrl_stats { +@@ -1509,8 +1511,10 @@ struct nss_wifili_retry_ctrl_stats { uint32_t tx_retry_count; /**< Transmit retry count. */ uint32_t tx_multiple_retry_count; /**< Transmit multiple retry count. */ uint32_t rx_retry_count; /**< Receive retry count. */ diff --git a/qca-nss-drv/patches/0023-add-boot-delay.patch b/qca-nss-drv/patches/0023-add-boot-delay.patch index 3e86b05..95da2b7 100644 --- a/qca-nss-drv/patches/0023-add-boot-delay.patch +++ b/qca-nss-drv/patches/0023-add-boot-delay.patch @@ -1,6 +1,6 @@ --- a/nss_core.c +++ b/nss_core.c -@@ -93,6 +93,8 @@ static int qos_mem_size = 0; +@@ -92,6 +92,8 @@ static int qos_mem_size = 0; module_param(qos_mem_size, int, S_IRUGO); MODULE_PARM_DESC(qos_mem_size, "QoS memory size"); @@ -9,7 +9,7 @@ /* * Atomic variables to control jumbo_mru & paged_mode */ -@@ -2249,6 +2251,19 @@ static inline void nss_core_handle_tx_un +@@ -2253,6 +2255,19 @@ static inline void nss_core_handle_tx_un nss_hal_disable_interrupt(nss_ctx, nss_ctx->int_ctx[0].shift_factor, NSS_N2H_INTR_TX_UNBLOCKED); } @@ -29,7 +29,7 @@ /* * nss_core_handle_cause_nonqueue() * Handle non-queue interrupt causes (e.g. empty buffer SOS, Tx unblocked) -@@ -2317,6 +2332,9 @@ static void nss_core_handle_cause_nonque +@@ -2321,6 +2336,9 @@ static void nss_core_handle_cause_nonque #endif #endif } @@ -41,7 +41,7 @@ /* --- a/nss_hal/nss_hal.c +++ b/nss_hal/nss_hal.c -@@ -855,6 +855,7 @@ int nss_hal_probe(struct platform_device +@@ -850,6 +850,7 @@ int nss_hal_probe(struct platform_device } nss_info("%px: All resources initialized and nss core%d has been brought out of reset", nss_ctx, nss_dev->id); @@ -51,7 +51,7 @@ err_register_irq: --- a/nss_core.h +++ b/nss_core.h -@@ -1067,4 +1067,6 @@ extern nss_tx_status_t nss_n2h_cfg_empty +@@ -1082,4 +1082,6 @@ extern nss_tx_status_t nss_n2h_cfg_empty extern nss_tx_status_t nss_n2h_paged_buf_pool_init(struct nss_ctx_instance *nss_ctx); extern nss_tx_status_t nss_n2h_cfg_qos_mem_size(struct nss_ctx_instance *nss_ctx, uint32_t pool_sz); diff --git a/qca-nss-drv/patches/0023-nss-drv-add-missing-wifili-err-codes.patch b/qca-nss-drv/patches/0023-nss-drv-add-missing-wifili-err-codes.patch deleted file mode 100644 index 194dc12..0000000 --- a/qca-nss-drv/patches/0023-nss-drv-add-missing-wifili-err-codes.patch +++ /dev/null @@ -1,76 +0,0 @@ -commit 1db9e5510558817d138de87f5a4942293a9fcb91 -Author: syed touqeer pasha -AuthorDate: Thu May 16 14:59:48 2024 +0530 -Commit: syed touqeer pasha -CommitDate: Thu May 16 14:59:48 2024 +0530 - -[qca-nss-drv] Add missing error code for wifili pkg. - -Add missing error code between nss fw and nss drv. - -Change-Id: I3f81da10b33fd15b1817a40eb906df9642a10d98 -Signed-off-by: syed touqeer pasha - ---- a/exports/nss_wifili_if.h -+++ b/exports/nss_wifili_if.h -@@ -404,8 +404,60 @@ enum nss_wifili_error_types { - /**< Invalid TLV length. */ - NSS_WIFILI_EMESG_RX_BUF_LEN_INVALID, - /**< Invalid Rx buffer length. */ -+ NSS_WIFILI_EMSG_INVALID_PDEV_ID, -+ /**< Invalid pdev id from host. */ -+ NSS_WIFILI_EMSG_NO_PDEV_PRESENT, -+ /**< Pdev corresponding to this pdev id is not present. */ -+ NSS_WIFILI_EMESG_WDS_UPDATE_FAIL, -+ /**< Wds peer ast update failed. */ -+ NSS_WIFILI_EMSG_VLAN_ID_SET_FAIL, -+ /**< Vlan id set failed. */ -+ NSS_WIFILI_EMSG_PDEV_UPDATE_INVALID_RADIOID_FAIL, -+ /**< Pdev update failed due to invalid radio id. */ -+ NSS_WIFILI_EMSG_PDEV_UPDATE_INVALID_LMACID_FAIL, -+ /**< Pdev update failed due to invalid lmac id. */ -+ NSS_WIFILI_EMSG_PDEV_UPDATE_INVALID_TARGETPDEVID_FAIL, -+ /**< Pdev update failed due to invalid target pdev id. */ -+ NSS_WIFILI_EMESG_PEER_AST_FLOWID_MAP_VAPID_INVALID_FAIL, -+ /**< Peer ast flow map failed due to invalid vdev_id. */ -+ NSS_WIFILI_EMESG_PEER_AST_FLOWID_MAP_VDEV_NULL_FAIL, -+ /**< Peer ast flow map failed due to vdev null. */ -+ NSS_WIFILI_EMESG_PEER_AST_FLOWID_MAP_PEERID_INVALID_FAIL, -+ /**< Peer ast flow map failed due to invalid peer_id. */ -+ NSS_WIFILI_EMSG_PEER_AST_FLOWID_MAP_STA_VAP_FAIL, -+ /**< Peer ast flowid map failed due to sta vap. */ -+ NSS_WIFILI_EMESG_PEER_AST_FLOWID_MAP_PEERID_MISMATCH_FAIL, -+ /**< Peer ast flow map failed due to mismatched peer_id. */ -+ NSS_WIFILI_EMESG_PEER_AST_FLOWID_MAP_PEER_NULL_FAIL, -+ /**< Peer ast flow map failed due to peer null. */ -+ NSS_WIFILI_EMSG_PEER_AST_FLOWID_MAP_AST_MISMATCH_FAIL, -+ /**< Peer ast flow map failed due to mismatched ast index. */ -+ NSS_WIFILI_EMSG_INVALID_V3_STATS_TYPE, -+ /**< Invalid v3 stats type. */ -+ NSS_WIFILI_EMSG_ISOLATION_SET_FAIL, -+ /**< Peer isolation set failed. */ -+ NSS_WIFILI_EMESG_WDS_ALREADY_PRESENT, -+ /**< Wds peer ast add failed. */ -+ NSS_WIFILI_EMSG_STATS_CLR_VDEV_NULL_FAIL, -+ /**< Statistics clear failed due to null vdev. */ -+ NSS_WIFILI_EMSG_INVALID_VDEV_ID, -+ /**< Invalid vdev id from host. */ -+ NSS_WIFILI_EMSG_PDEV_INIT_FAIL_INVALID_THREAD_SCHEME_ID, -+ /**< Incorrect scheme ID sent from host. */ -+ NSS_WIFILI_EMSG_PEER_WDS_4ADDR_EVENT_INV_PEER, -+ /**< Invalid peer ID sent from host. */ -+ NSS_WIFILI_EMSG_PEER_WDS_INVALID_IFNUM, -+ /**< Invalid peer ID sent from host. */ -+ NSS_WIFILI_EMSG_PEER_AUTH_FLAG_UPDATE_FAIL, -+ /**< Peer authentication flag update failed. */ -+ NSS_WIFILI_EMSG_PEER_TEARDOWN_ALLOC_FAIL, -+ /**< Alloc fail in peer tear down path. */ - NSS_WIFILI_EMSG_TX_CAPTURE_MODE_UPDATE_FAIL, - /**< Tx capture mode update failure. */ -+ NSS_WIFILI_EMSG_PEER_MEMORY_INSUFFICIENT_FROM_HOST, -+ /**< Peer memory from host is less than NSS peer struct. */ -+ NSS_WIFILI_EMSG_DUPLICATE_MPASS_ID_SET, -+ /**< Duplicate mpass vlan id set. */ - NSS_WIFILI_EMSG_UNKNOWN - /**< Unknown error message. */ - };