From f3318298a74fce68fa99f4981ef6083434ababd8 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Wed, 9 Apr 2025 15:02:15 -0400 Subject: [PATCH] nss-drv: [11.4] sync more kernel 6.6 changes from 12.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mostly cosmetic changes, but also: * Extend kernel version handling so kernels 6.1–6.14 are supported (untested on > 6.6) * Replace various `NSS_SUCCESS`/`NSS_FAILURE` return codes with `NSS_TX_SUCCESS`/`NSS_TX_FAILURE` * Change di_data.response initialization in the dynamic interface to use NSS_CMN_RESPONSE_ACK. Primary affects `0016-nss-drv-add-support-for-kernel-6.6.patch`, while other patches were refreshed. Signed-off-by: Sean Khan --- ...6-nss-drv-add-support-for-kernel-6.6.patch | 231 +++++++++++++++++- ...-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch | 70 +++--- ...0018-nss-drv-more-uniform-kernel-msg.patch | 2 +- .../patches-11.4/0023-add-boot-delay.patch | 4 +- 4 files changed, 256 insertions(+), 51 deletions(-) diff --git a/qca-nss-drv/patches-11.4/0016-nss-drv-add-support-for-kernel-6.6.patch b/qca-nss-drv/patches-11.4/0016-nss-drv-add-support-for-kernel-6.6.patch index a626c90..4138842 100644 --- a/qca-nss-drv/patches-11.4/0016-nss-drv-add-support-for-kernel-6.6.patch +++ b/qca-nss-drv/patches-11.4/0016-nss-drv-add-support-for-kernel-6.6.patch @@ -5,10 +5,48 @@ (((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)))) || \ -(((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)))))) ++(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0)))))) #error "Check skb recycle code in this file to match Linux version" #endif +@@ -1063,13 +1063,18 @@ static inline void nss_core_rx_pbuf(stru + */ + static inline void nss_core_set_skb_classify(struct sk_buff *nbuf) + { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)) + #ifdef CONFIG_NET_CLS_ACT + #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) +- nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); ++ nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd); + #else +- skb_set_tc_classify_offload(nbuf); ++ skb_set_tc_classify_offload(nbuf); + #endif + #endif ++#else ++ nss_warning("%px:API not supported on 6.6\n", nbuf); ++ nss_assert(0); ++#endif + } + + /* +@@ -2609,6 +2614,16 @@ static inline bool nss_core_skb_can_reus + return false; + #endif + ++ /* ++ * TODO: This check is only validated on kernel 6.6 ++ * This needs to be validated on prior linux ++ * kernel versions. ++ */ ++#ifdef CONFIG_SKB_EXTENSIONS ++ if (nbuf->active_extensions) ++ return false; ++#endif ++ + return true; + } + --- a/nss_dynamic_interface.c +++ b/nss_dynamic_interface.c @@ -226,7 +226,7 @@ int nss_dynamic_interface_alloc_node(enu @@ -16,7 +54,7 @@ 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; ++ di_data.response = NSS_CMN_RESPONSE_ACK; init_completion(&di_data.complete); nss_dynamic_interface_msg_init(&ndim, NSS_DYNAMIC_INTERFACE, NSS_DYNAMIC_INTERFACE_ALLOC_NODE, @@ -25,13 +63,13 @@ 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; ++ di_data.response = NSS_CMN_RESPONSE_ACK; init_completion(&di_data.complete); if (nss_is_dynamic_interface(if_num) == false) { --- a/nss_init.c +++ b/nss_init.c -@@ -584,48 +584,12 @@ static struct ctl_table nss_general_tabl +@@ -584,48 +584,9 @@ static struct ctl_table nss_general_tabl { } }; @@ -80,13 +118,10 @@ +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() -@@ -748,7 +712,16 @@ nss_info("Init NSS driver"); +@@ -748,7 +709,16 @@ nss_info("Init NSS driver"); /* * Register sysctl table. */ @@ -104,7 +139,7 @@ /* * Registering sysctl for ipv4/6 specific config. -@@ -911,8 +884,18 @@ static void __exit nss_cleanup(void) +@@ -911,8 +881,18 @@ static void __exit nss_cleanup(void) { nss_info("Exit NSS driver"); @@ -172,7 +207,66 @@ /* --- a/nss_n2h.c +++ b/nss_n2h.c -@@ -1859,36 +1859,6 @@ static struct ctl_table nss_n2h_table_mu +@@ -1155,11 +1155,11 @@ static nss_tx_status_t nss_n2h_mitigatio + } + + up(&nss_n2h_mitigationcp[core_num].sem); +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + + failure: + up(&nss_n2h_mitigationcp[core_num].sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + static inline void nss_n2h_buf_pool_free(struct nss_n2h_buf_pool *buf_pool) +@@ -1240,10 +1240,10 @@ static nss_tx_status_t nss_n2h_buf_pool_ + up(&nss_n2h_bufcp[core_num].sem); + } while(num_pages); + +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + failure: + up(&nss_n2h_bufcp[core_num].sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -1542,7 +1542,7 @@ static nss_tx_status_t nss_n2h_host_bp_c + if (nss_tx_status != NSS_TX_SUCCESS) { + nss_warning("%px: nss_tx error setting back pressure\n", nss_ctx); + up(&nss_n2h_host_bp_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -1552,7 +1552,7 @@ static nss_tx_status_t nss_n2h_host_bp_c + if (ret == 0) { + nss_warning("%px: Waiting for ack timed out\n", nss_ctx); + up(&nss_n2h_host_bp_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -1560,11 +1560,11 @@ static nss_tx_status_t nss_n2h_host_bp_c + */ + if (nss_n2h_host_bp_cfg_pvt.response == NSS_FAILURE) { + up(&nss_n2h_host_bp_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + up(&nss_n2h_host_bp_cfg_pvt.sem); +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + } + + /* +@@ -1859,38 +1859,9 @@ static struct ctl_table nss_n2h_table_mu { } }; @@ -208,8 +302,11 @@ - static struct ctl_table_header *nss_n2h_header; ++ /* -@@ -2130,8 +2100,7 @@ void nss_n2h_single_core_register_sysctl + * nss_n2h_cfg_empty_pool_size() + * Config empty buffer pool +@@ -2130,8 +2101,7 @@ void nss_n2h_single_core_register_sysctl /* * Register sysctl table. */ @@ -219,7 +316,7 @@ } /* -@@ -2229,7 +2198,7 @@ void nss_n2h_multi_core_register_sysctl( +@@ -2229,7 +2199,7 @@ void nss_n2h_multi_core_register_sysctl( /* * Register sysctl table. */ @@ -311,6 +408,98 @@ /* --- a/nss_rps.c +++ b/nss_rps.c +@@ -251,7 +251,7 @@ static nss_tx_status_t nss_rps_cfg(struc + nss_warning("%px: nss_tx error setting rps\n", nss_ctx); + + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -261,7 +261,7 @@ static nss_tx_status_t nss_rps_cfg(struc + if (ret == 0) { + nss_warning("%px: Waiting for ack timed out\n", nss_ctx); + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -271,11 +271,11 @@ static nss_tx_status_t nss_rps_cfg(struc + */ + if (NSS_FAILURE == nss_rps_cfg_pvt.response) { + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + up(&nss_rps_cfg_pvt.sem); +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + } + + #ifdef NSS_DRV_IPV4_ENABLE +@@ -301,11 +301,11 @@ static nss_tx_status_t nss_rps_ipv4_hash + nss_warning("%px: nss_tx error setting rps\n", nss_ctx); + + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + up(&nss_rps_cfg_pvt.sem); +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + } + #endif + +@@ -332,11 +332,11 @@ static nss_tx_status_t nss_rps_ipv6_hash + nss_warning("%px: nss_tx error setting rps\n", nss_ctx); + + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + up(&nss_rps_cfg_pvt.sem); +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + } + #endif + +@@ -372,7 +372,7 @@ static nss_tx_status_t nss_rps_pri_map_c + nss_warning("%px: nss_tx error setting rps\n", nss_ctx); + + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -382,7 +382,7 @@ static nss_tx_status_t nss_rps_pri_map_c + if (ret == 0) { + nss_warning("%px: Waiting for ack timed out\n", nss_ctx); + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + /* +@@ -392,11 +392,11 @@ static nss_tx_status_t nss_rps_pri_map_c + */ + if (NSS_FAILURE == nss_rps_cfg_pvt.response) { + up(&nss_rps_cfg_pvt.sem); +- return NSS_FAILURE; ++ return NSS_TX_FAILURE; + } + + up(&nss_rps_cfg_pvt.sem); +- return NSS_SUCCESS; ++ return NSS_TX_SUCCESS; + } + + /* @@ -574,33 +574,6 @@ static struct ctl_table nss_rps_table[] { } }; @@ -610,10 +799,26 @@ default: - index = NSS_PM_PERF_LEVEL_IDLE; -+ index = (nss_freq_scales_t)NSS_PM_PERF_LEVEL_IDLE; ++ index = NSS_FREQ_MID_SCALE; } -#if !defined(NSS_HAL_IPQ807x_SUPPORT) nss_freq_sched_change(index, false); #endif +--- a/nss_coredump.c ++++ b/nss_coredump.c +@@ -25,10 +25,11 @@ + #include "nss_hal.h" + #include "nss_log.h" + #include +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)) ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)) + #include /* for panic_notifier_list */ + #else +-#include ++#include /* for panic_notifier_list */ + #endif + #include /* for time */ + #include "nss_tx_rx_common.h" diff --git a/qca-nss-drv/patches-11.4/0016-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch b/qca-nss-drv/patches-11.4/0016-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch index 8878150..9e6b912 100644 --- a/qca-nss-drv/patches-11.4/0016-rework-NSS_CORE_DMA_CACHE_MAINT-ops.patch +++ b/qca-nss-drv/patches-11.4/0016-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 -@@ -1421,6 +1421,8 @@ static inline void nss_core_handle_empty +@@ -1426,6 +1426,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 -@@ -1474,7 +1476,9 @@ next: +@@ -1479,7 +1481,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(); } -@@ -1496,6 +1500,7 @@ static int32_t nss_core_handle_cause_que +@@ -1501,6 +1505,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); -@@ -1507,7 +1512,8 @@ static int32_t nss_core_handle_cause_que +@@ -1512,7 +1517,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]; -@@ -1536,13 +1542,23 @@ static int32_t nss_core_handle_cause_que +@@ -1541,13 +1547,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 } /* -@@ -1671,7 +1687,8 @@ next: +@@ -1676,7 +1692,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; -@@ -1683,11 +1700,12 @@ next: +@@ -1688,11 +1705,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(); /* -@@ -1763,6 +1781,7 @@ static void nss_core_alloc_paged_buffers +@@ -1768,6 +1786,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]; -@@ -1832,7 +1851,9 @@ static void nss_core_alloc_paged_buffers +@@ -1837,7 +1856,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--; -@@ -1846,7 +1867,8 @@ static void nss_core_alloc_paged_buffers +@@ -1851,7 +1872,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]); -@@ -1859,7 +1881,7 @@ static void nss_core_alloc_paged_buffers +@@ -1864,7 +1886,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; -@@ -1906,7 +1928,9 @@ static void nss_core_alloc_jumbo_mru_buf +@@ -1911,7 +1933,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--; -@@ -1920,7 +1944,8 @@ static void nss_core_alloc_jumbo_mru_buf +@@ -1925,7 +1949,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]); -@@ -1933,6 +1958,7 @@ static void nss_core_alloc_jumbo_mru_buf +@@ -1938,6 +1963,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; -@@ -1940,6 +1966,7 @@ static void nss_core_alloc_max_avail_siz +@@ -1945,6 +1971,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; -@@ -1992,13 +2019,26 @@ static void nss_core_alloc_max_avail_siz +@@ -1997,13 +2024,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 } /* -@@ -2009,7 +2049,8 @@ static void nss_core_alloc_max_avail_siz +@@ -2014,7 +2054,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]); -@@ -2022,6 +2063,7 @@ static void nss_core_alloc_max_avail_siz +@@ -2027,6 +2068,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]; -@@ -2032,7 +2074,8 @@ static inline void nss_core_handle_empty +@@ -2037,7 +2079,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]; -@@ -2077,6 +2120,7 @@ static inline void nss_core_handle_empty +@@ -2082,6 +2125,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]; -@@ -2084,7 +2128,8 @@ static inline void nss_core_handle_paged +@@ -2089,7 +2133,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]; -@@ -2652,9 +2697,11 @@ void nss_skb_reuse(struct sk_buff *nbuf) +@@ -2667,9 +2712,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; -@@ -2708,7 +2755,8 @@ static inline int32_t nss_core_send_buff +@@ -2723,7 +2770,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 -@@ -2732,7 +2780,8 @@ no_reuse: +@@ -2747,7 +2795,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; -@@ -2746,9 +2795,11 @@ no_reuse: +@@ -2761,9 +2810,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; -@@ -2788,7 +2839,8 @@ static inline int32_t nss_core_send_buff +@@ -2803,7 +2854,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. -@@ -2812,7 +2864,8 @@ static inline int32_t nss_core_send_buff +@@ -2827,7 +2879,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 } /* -@@ -2828,7 +2881,8 @@ static inline int32_t nss_core_send_buff +@@ -2843,7 +2896,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; -@@ -2842,9 +2896,11 @@ static inline int32_t nss_core_send_buff +@@ -2857,9 +2911,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; -@@ -2883,7 +2939,8 @@ static inline int32_t nss_core_send_buff +@@ -2898,7 +2954,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 -@@ -2936,7 +2993,8 @@ static inline int32_t nss_core_send_buff +@@ -2951,7 +3008,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++; } -@@ -2955,7 +3013,8 @@ static inline int32_t nss_core_send_buff +@@ -2970,7 +3028,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; -@@ -3034,8 +3093,10 @@ int32_t nss_core_send_buffer(struct nss_ +@@ -3049,8 +3108,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); -@@ -3100,13 +3161,13 @@ int32_t nss_core_send_buffer(struct nss_ +@@ -3115,13 +3176,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)) { -@@ -3130,7 +3191,8 @@ int32_t nss_core_send_buffer(struct nss_ +@@ -3145,7 +3206,8 @@ int32_t nss_core_send_buffer(struct nss_ h2n_desc_ring->hlos_index = hlos_index; if_map->h2n_hlos_index[qid] = hlos_index; diff --git a/qca-nss-drv/patches-11.4/0018-nss-drv-more-uniform-kernel-msg.patch b/qca-nss-drv/patches-11.4/0018-nss-drv-more-uniform-kernel-msg.patch index 7dbc046..c0d9066 100644 --- a/qca-nss-drv/patches-11.4/0018-nss-drv-more-uniform-kernel-msg.patch +++ b/qca-nss-drv/patches-11.4/0018-nss-drv-more-uniform-kernel-msg.patch @@ -66,7 +66,7 @@ --- a/nss_core.c +++ b/nss_core.c -@@ -2217,7 +2217,7 @@ static void nss_core_handle_cause_nonque +@@ -2222,7 +2222,7 @@ static void nss_core_handle_cause_nonque nss_core_init_nss(nss_ctx, if_map); nss_send_ddr_info(nss_ctx); diff --git a/qca-nss-drv/patches-11.4/0023-add-boot-delay.patch b/qca-nss-drv/patches-11.4/0023-add-boot-delay.patch index 26d2d80..a8ec052 100644 --- a/qca-nss-drv/patches-11.4/0023-add-boot-delay.patch +++ b/qca-nss-drv/patches-11.4/0023-add-boot-delay.patch @@ -9,7 +9,7 @@ /* * nss_core_update_max_ipv4_conn() * Update the maximum number of configured IPv4 connections -@@ -2187,6 +2189,19 @@ static inline void nss_core_handle_tx_un +@@ -2192,6 +2194,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) -@@ -2255,6 +2270,9 @@ static void nss_core_handle_cause_nonque +@@ -2260,6 +2275,9 @@ static void nss_core_handle_cause_nonque #endif #endif }