qca-nss-drv: update for 6.12 compatibility

This commit is contained in:
coolsnowwolf 2025-05-26 18:15:31 +08:00
parent 39c1fd38bb
commit b51f82d212
28 changed files with 2256 additions and 600 deletions

View File

@ -4,10 +4,10 @@ PKG_NAME:=qca-nss-drv
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2023-08-06
PKG_SOURCE_DATE:=2024-11-13
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
PKG_SOURCE_VERSION:=1ab184034529539f61093184a67d4454cb3eb352
PKG_MIRROR_HASH:=6aa081c0853d3e3b6d78eee588a0967e540b2317d15aef3c3f6f7129925653f7
PKG_SOURCE_VERSION:=d5ee67bd84d1ee7ed81eb6758e62a6db5a0cf4c7
PKG_MIRROR_HASH:=72ebdbce21b5cc24131100f8e45dfcb8188a5963c5864ee497129278f022b740
PKG_BUILD_PARALLEL:=1
PKG_FLAGS:=nonshared

View File

@ -26,7 +26,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
}
- 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 <robimarko@gmail.com>
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 <robimarko@gmail.com>
* 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;

View File

@ -14,42 +14,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
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 <linux/kernel.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
#include <linux/notifier.h> /* for panic_notifier_list */
+#else
+#include <linux/panic_notifier.h>
+#endif
#include <linux/jiffies.h> /* 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,3 +24,26 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
#include "nss_hal.h"
#include "nss_arch.h"
@@ -58,9 +59,9 @@ int nss_hal_firmware_load(struct nss_ctx
int rc;
if (nss_ctx->id == 0) {
- rc = request_firmware(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev));
+ rc = firmware_request_nowarn(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev));
} else if (nss_ctx->id == 1) {
- rc = request_firmware(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev));
+ rc = firmware_request_nowarn(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev));
} else {
nss_warning("%px: Invalid nss dev: %d\n", nss_ctx, nss_ctx->id);
return -EINVAL;
--- a/nss_data_plane/nss_data_plane_gmac.c
+++ b/nss_data_plane/nss_data_plane_gmac.c
@@ -20,7 +20,7 @@
#include "nss_tx_rx_common.h"
#include <nss_gmac_api_if.h>
-#define NSS_DP_GMAC_SUPPORTED_FEATURES (NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_FRAGLIST | (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO))
+#define NSS_DP_GMAC_SUPPORTED_FEATURES (NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_FRAGLIST | (NETIF_F_TSO | NETIF_F_TSO6))
#define NSS_DATA_PLANE_GMAC_MAX_INTERFACES 4
static DEFINE_SPINLOCK(nss_data_plane_gmac_stats_lock);

View File

@ -17,7 +17,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
--- 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))) {

View File

@ -27,7 +27,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- 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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
}
/*
@@ -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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
}
/*
@@ -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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
/*
* 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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
/*
* 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 <ansuelsmth@gmail.com>
}
/*
@@ -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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
/*
* 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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
}
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 <ansuelsmth@gmail.com>
#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 <ansuelsmth@gmail.com>
+#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 <ansuelsmth@gmail.com>
- 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

View File

@ -30,7 +30,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
#include <nss_hal.h>
#include <net/dst.h>
#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)
{

View File

@ -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)

View File

@ -1,6 +1,6 @@
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -2207,7 +2207,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,

View File

@ -1,78 +1,54 @@
--- a/nss_hal/fsm9010/nss_hal_pvt.c
+++ b/nss_hal/fsm9010/nss_hal_pvt.c
@@ -291,7 +291,11 @@ static int __nss_hal_request_irq(struct
@@ -291,7 +291,7 @@ static int __nss_hal_request_irq(struct
}
int_ctx->irq = npd->irq[irq_num];
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
+#endif
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
return 0;
}
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
@@ -599,7 +599,11 @@ static int __nss_hal_request_irq(struct
@@ -599,7 +599,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);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
+#endif
+ 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) {
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
@@ -615,62 +615,102 @@ static int __nss_hal_request_irq(struct
@@ -615,62 +615,62 @@ static int __nss_hal_request_irq(struct
irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS) {
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
+#endif
int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS;
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_sos", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE) {
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
+#endif
int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE;
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_queue", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED) {
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
+#endif
int_ctx->cause = NSS_N2H_INTR_TX_UNBLOCKED;
err = request_irq(irq, nss_hal_handle_irq, 0, "nss-tx-unblock", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0) {
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#endif
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_0;
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue0", int_ctx);
}
@ -80,54 +56,34 @@
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1) {
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_1;
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#endif
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue1", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2) {
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_2;
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#endif
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue2", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3) {
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_3;
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#endif
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue3", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE) {
int_ctx->cause = NSS_N2H_INTR_COREDUMP_COMPLETE;
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#endif
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_coredump_complete", int_ctx);
}
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS) {
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
+#endif
int_ctx->cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS;
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_paged_empty_buf_sos", int_ctx);
}
@ -135,26 +91,18 @@
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA) {
int_ctx->cause = NSS_N2H_INTR_PROFILE_DMA;
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
+#endif
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx);
}
--- a/nss_hal/ipq806x/nss_hal_pvt.c
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
@@ -1185,7 +1185,11 @@ static int __nss_hal_request_irq(struct
@@ -1185,7 +1185,7 @@ static int __nss_hal_request_irq(struct
}
int_ctx->irq = npd->irq[irq_num];
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
+#endif
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi, 64);
return 0;
}
@ -233,18 +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,11 @@ static int __nss_hal_request_irq(struct
return err;
}
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
+ netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
+#else
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
+#endif
int_ctx->cause = cause;
err = request_irq(irq, nss_hal_handle_irq, 0, irq_name, int_ctx);
if (err) {

View File

@ -0,0 +1,18 @@
--- a/nss_dynamic_interface_stats.c
+++ b/nss_dynamic_interface_stats.c
@@ -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",
+ "NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER",
+ "NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER",
+ "NSS_DYNAMIC_INTERFACE_TYPE_MIRROR",
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS",
"NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER",
"NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER",
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN",
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER",
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER"
};
/*

View File

@ -0,0 +1,57 @@
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -407,9 +407,9 @@ void nss_stats_create_dentry(char *name,
/*
* gmac_stats_ops
*/
-#ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
-NSS_STATS_DECLARE_FILE_OPERATIONS(gmac);
-#endif
+// #ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
+// NSS_STATS_DECLARE_FILE_OPERATIONS(gmac);
+// #endif
/*
* wt_stats_ops
@@ -464,9 +464,9 @@ void nss_stats_init(void)
/*
* gmac_stats
*/
-#ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
- nss_stats_create_dentry("gmac", &nss_gmac_stats_ops);
-#endif
+// #ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
+// nss_stats_create_dentry("gmac", &nss_gmac_stats_ops);
+// #endif
/*
* Per-project stats
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,6 @@ qca-nss-drv-objs := \
nss_n2h_stats.o \
nss_n2h_strings.o \
nss_pm.o \
- nss_profiler.o \
nss_project.o \
nss_rps.o \
nss_stats.o \
@@ -40,7 +39,6 @@ qca-nss-drv-objs += nss_hal/nss_hal.o
ifneq "$(NSS_DRV_POINT_OFFLOAD)" "y"
qca-nss-drv-objs += \
- nss_gmac_stats.o \
nss_if.o \
nss_if_log.o \
nss_phys_if.o \
@@ -381,7 +379,9 @@ endif
ifeq ($(SoC),$(filter $(SoC),ipq806x))
qca-nss-drv-objs += nss_data_plane/nss_data_plane_gmac.o \
- nss_hal/ipq806x/nss_hal_pvt.o
+ nss_hal/ipq806x/nss_hal_pvt.o \
+ nss_gmac_stats.o \
+ nss_profiler.o
ifneq "$(NSS_DRV_C2C_ENABLE)" "n"
ccflags-y += -DNSS_DRV_C2C_ENABLE

View File

@ -0,0 +1,37 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -517,7 +517,7 @@ static uint32_t nss_soc_mem_info(void)
goto err_use_default_memsize;
}
- nss_info_always("NSS DDR size is 0x%x\n", (uint32_t) resource_size(&r));
+ nss_info("NSS DDR size is 0x%x\n", (uint32_t) resource_size(&r));
return resource_size(&r);
--- a/nss_hal/ipq95xx/nss_hal_pvt.c
+++ b/nss_hal/ipq95xx/nss_hal_pvt.c
@@ -724,19 +724,19 @@ static int __nss_hal_clock_configure(str
}
}
- nss_info_always("Supported Frequencies - ");
+ nss_info("Supported Frequencies - ");
for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) {
switch (nss_runtime_samples.freq_scale[i].frequency) {
case NSS_FREQ_748:
- nss_info_always("748 MHz ");
+ nss_info("748 MHz ");
break;
case NSS_FREQ_1497:
- nss_info_always("1.497 GHz ");
+ nss_info("1.497 GHz ");
break;
case NSS_FREQ_1689:
- nss_info_always("1.689 GHz ");
+ nss_info("1.689 GHz ");
break;
default:

View File

@ -0,0 +1,33 @@
--- a/Makefile
+++ b/Makefile
@@ -350,10 +350,17 @@ endif
ifneq "$(NSS_DRV_WIFIOFFLOAD_ENABLE)" "n"
ccflags-y += -DNSS_DRV_WIFIOFFLOAD_ENABLE
+ifneq "$(NSS_DRV_WIFI_LEGACY_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_WIFI_LEGACY_ENABLE
qca-nss-drv-objs += \
nss_wifi.o \
nss_wifi_log.o \
- nss_wifi_stats.o \
+ nss_wifi_stats.o
+ifeq ($(SoC),$(filter $(SoC),ipq806x))
+ccflags-y += -DNSS_HAL_IPQ806x_SUPPORT
+endif
+endif
+qca-nss-drv-objs += \
nss_wifi_vdev.o \
nss_wifili.o \
nss_wifili_log.o \
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -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;
+#if defined(NSS_HAL_IPQ806x_SUPPORT)
nss_wifi_register_handler();
+#endif
nss_wifili_register_handler();
#ifdef NSS_DRV_WIFI_EXT_VDEV_ENABLE
nss_wifi_ext_vdev_register_handler();

View File

@ -0,0 +1,14 @@
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -395,8 +395,9 @@ size_t nss_stats_print(char *node, char
*/
void nss_stats_create_dentry(char *name, const struct file_operations *ops)
{
- if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
- nss_warning("Failed to create debug entry for subsystem %s\n", name);
+ if (!debugfs_lookup(name, nss_top_main.stats_dentry))
+ if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
+ nss_warning("Failed to create debug entry for subsystem %s\n", name);
}
}

View File

@ -0,0 +1,40 @@
--- a/nss_igs.c
+++ b/nss_igs.c
@@ -163,7 +163,7 @@ EXPORT_SYMBOL(nss_igs_register_if);
* nss_igs_get_context()
* Get the IGS context.
*/
-struct nss_ctx_instance *nss_igs_get_context()
+struct nss_ctx_instance *nss_igs_get_context(void)
{
return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.igs_handler_id];
}
@@ -177,8 +177,9 @@ EXPORT_SYMBOL(nss_igs_get_context);
void nss_igs_module_save(struct tc_action_ops *act, struct module *module)
{
nss_assert(act);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
nss_assert(act->type == TCA_ACT_MIRRED_NSS);
-
+#endif
nss_igs_module = module;
}
EXPORT_SYMBOL(nss_igs_module_save);
@@ -188,7 +189,7 @@ EXPORT_SYMBOL(nss_igs_module_save);
* nss_igs_module_get()
* Get the ingress shaping module reference.
*/
-bool nss_igs_module_get()
+bool nss_igs_module_get(void)
{
nss_assert(nss_igs_module);
return try_module_get(nss_igs_module);
@@ -199,7 +200,7 @@ EXPORT_SYMBOL(nss_igs_module_get);
* nss_igs_module_put()
* Release the ingress shaping module reference.
*/
-void nss_igs_module_put()
+void nss_igs_module_put(void)
{
nss_assert(nss_igs_module);
module_put(nss_igs_module);

View File

@ -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)

View File

@ -0,0 +1,18 @@
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -751,6 +751,15 @@ struct nss_wifili_stats_notification {
struct nss_wifili_stats stats; /**< Wifili statistics. */
};
+/**
+ * nss_wifili_get_context
+ * Gets the Wi-Fi Li context used in NSS GRE transmit.
+ *
+ * @return
+ * Pointer to the NSS core context.
+ */
+extern struct nss_ctx_instance *nss_wifili_get_context(void);
+
#ifdef __KERNEL__ /* only kernel will use. */
/**

View File

@ -0,0 +1,88 @@
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -1300,11 +1300,11 @@ static int nss_n2h_mitigationcfg_core0_h
}
if (!nss_n2h_core0_mitigation_cfg) {
- printk(KERN_INFO "Disabling NSS MITIGATION\n");
+ dev_info(nss_ctx->dev, "Disabling NSS MITIGATION\n");
nss_n2h_mitigation_cfg(nss_ctx, 0, NSS_CORE_0);
return 0;
}
- printk(KERN_INFO "Invalid input value.Valid value is 0, Runtime re-enabling not supported\n");
+ dev_info(nss_ctx->dev, "Invalid input value.Valid value is 0, Runtime re-enabling not supported\n");
return -EINVAL;
}
@@ -1331,11 +1331,11 @@ static int nss_n2h_mitigationcfg_core1_h
}
if (!nss_n2h_core1_mitigation_cfg) {
- printk(KERN_INFO "Disabling NSS MITIGATION\n");
+ dev_info(nss_ctx->dev, "Disabling NSS MITIGATION\n");
nss_n2h_mitigation_cfg(nss_ctx, 0, NSS_CORE_1);
return 0;
}
- printk(KERN_INFO "Invalid input value.Valid value is 0, Runtime re-enabling not supported\n");
+ dev_info(nss_ctx->dev, "Invalid input value.Valid value is 0, Runtime re-enabling not supported\n");
return -EINVAL;
}
@@ -1367,14 +1367,14 @@ static int nss_n2h_buf_cfg_core0_handler
}
if ((nss_n2h_core0_add_buf_pool_size >= 1) && (nss_n2h_core0_add_buf_pool_size <= NSS_N2H_MAX_BUF_POOL_SIZE)) {
- printk(KERN_INFO "configuring additional NSS pbufs\n");
+ dev_info(nss_ctx->dev, "Configuring additional NSS pbufs\n");
ret = nss_n2h_buf_pool_cfg(nss_ctx, nss_n2h_core0_add_buf_pool_size, NSS_CORE_0);
nss_n2h_core0_add_buf_pool_size = nss_ctx->buf_sz_allocated;
- printk(KERN_INFO "additional pbufs of size %d got added to NSS\n", nss_ctx->buf_sz_allocated);
+ dev_info(nss_ctx->dev, "Additional pbufs of size %d got added to NSS\n", nss_ctx->buf_sz_allocated);
return ret;
}
- printk(KERN_INFO "Invalid input value. should be greater than 1 and less than %d\n", NSS_N2H_MAX_BUF_POOL_SIZE);
+ dev_info(nss_ctx->dev, "Invalid input value. should be greater than 1 and less than %d\n", NSS_N2H_MAX_BUF_POOL_SIZE);
return -EINVAL;
}
@@ -1406,14 +1406,14 @@ static int nss_n2h_buf_cfg_core1_handler
}
if ((nss_n2h_core1_add_buf_pool_size >= 1) && (nss_n2h_core1_add_buf_pool_size <= NSS_N2H_MAX_BUF_POOL_SIZE)) {
- printk(KERN_INFO "configuring additional NSS pbufs\n");
+ dev_info(nss_ctx->dev, "Configuring additional NSS pbufs\n");
ret = nss_n2h_buf_pool_cfg(nss_ctx, nss_n2h_core1_add_buf_pool_size, NSS_CORE_1);
nss_n2h_core1_add_buf_pool_size = nss_ctx->buf_sz_allocated;
- printk(KERN_INFO "additional pbufs of size %d got added to NSS\n", nss_ctx->buf_sz_allocated);
+ dev_info(nss_ctx->dev, "Additional pbufs of size %d got added to NSS\n", nss_ctx->buf_sz_allocated);
return ret;
}
- printk(KERN_INFO "Invalid input value. should be greater than 1 and less than %d\n", NSS_N2H_MAX_BUF_POOL_SIZE);
+ dev_info(nss_ctx->dev, "Invalid input value. should be greater than 1 and less than %d\n", NSS_N2H_MAX_BUF_POOL_SIZE);
return -EINVAL;
}
--- a/nss_core.c
+++ b/nss_core.c
@@ -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);
- nss_info_always("%px: nss core %d booted successfully\n", nss_ctx, nss_ctx->id);
+ dev_info(nss_ctx->dev, "NSS core %d booted successfully\n", nss_ctx->id);
nss_top = nss_ctx->nss_top;
#ifdef NSS_DRV_C2C_ENABLE
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -83,7 +83,7 @@ int nss_hal_firmware_load(struct nss_ctx
return rc;
}
- nss_info("nss_driver - fw of size %d bytes copied to load addr: %x, nss_id : %d\n", (int)nss_fw->size, npd->load_addr, nss_dev->id);
+ dev_info(&nss_dev->dev, "fw of size %d bytes copied to addr: %x, nss_id: %d\n", (int)nss_fw->size, npd->load_addr, nss_ctx->id);
memcpy_toio(load_mem, nss_fw->data, nss_fw->size);
release_firmware(nss_fw);
iounmap(load_mem);

View File

@ -0,0 +1,11 @@
--- a/nss_virt_if.c
+++ b/nss_virt_if.c
@@ -450,6 +450,8 @@ EXPORT_SYMBOL(nss_virt_if_create_sync_ne
*/
struct nss_virt_if_handle *nss_virt_if_create_sync(struct net_device *netdev)
{
+ if (!nss_ctl_redirect)
+ return NULL;
/*
* NSS_N2H_INTERFACE is the nexthop of the dynamic interface which is created for handling the
* n2h traffic.

View File

@ -0,0 +1,353 @@
--- a/nss_hal/ipq807x/nss_hal_pvt.c
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
@@ -67,6 +67,20 @@
#define NSS_NC_AXI_CLK "nss-nc-axi-clk"
/*
+ * N2H interrupts
+ */
+#define NSS_IRQ_NAME_EMPTY_BUF_SOS "nss_empty_buf_sos"
+#define NSS_IRQ_NAME_EMPTY_BUF_QUEUE "nss_empty_buf_queue"
+#define NSS_IRQ_NAME_TX_UNBLOCK "nss-tx-unblock"
+#define NSS_IRQ_NAME_QUEUE0 "nss_queue0"
+#define NSS_IRQ_NAME_QUEUE1 "nss_queue1"
+#define NSS_IRQ_NAME_QUEUE2 "nss_queue2"
+#define NSS_IRQ_NAME_QUEUE3 "nss_queue3"
+#define NSS_IRQ_NAME_COREDUMP_COMPLETE "nss_coredump_complete"
+#define NSS_IRQ_NAME_PAGED_EMPTY_BUF_SOS "nss_paged_empty_buf_sos"
+#define NSS_IRQ_NAME_PROFILE_DMA "nss_profile_dma"
+
+/*
* Voltage values
*/
#define NOMINAL_VOLTAGE 1
@@ -654,74 +668,96 @@ static void __nss_hal_send_interrupt(str
static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num)
{
struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num];
+ uint32_t cause, napi_wgt;
int err = -1, irq = npd->irq[irq_num];
+ int (*napi_poll_cb)(struct napi_struct *, int) = NULL;
+ const char *irq_name;
irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_sos", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_queue", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_TX_UNBLOCKED;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss-tx-unblock", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_0;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue0", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1) {
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_1;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue1", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2) {
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_2;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue2", int_ctx);
- }
+ switch (irq_num) {
+ case NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS:
+ napi_poll_cb = nss_core_handle_napi_non_queue;
+ napi_wgt = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS;
+ irq_name = NSS_IRQ_NAME_EMPTY_BUF_SOS;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE;
+ irq_name = NSS_IRQ_NAME_EMPTY_BUF_QUEUE;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED:
+ napi_poll_cb = nss_core_handle_napi_non_queue;
+ napi_wgt = NSS_TX_UNBLOCKED_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_TX_UNBLOCKED;
+ irq_name = NSS_IRQ_NAME_TX_UNBLOCK;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_0;
+ irq_name = NSS_IRQ_NAME_QUEUE0;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_1;
+ irq_name = NSS_IRQ_NAME_QUEUE1;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_2;
+ irq_name = NSS_IRQ_NAME_QUEUE2;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_3;
+ irq_name = NSS_IRQ_NAME_QUEUE3;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE:
+ napi_poll_cb = nss_core_handle_napi_emergency;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_COREDUMP_COMPLETE;
+ irq_name = NSS_IRQ_NAME_COREDUMP_COMPLETE;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS:
+ napi_poll_cb = nss_core_handle_napi_non_queue;
+ napi_wgt = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS;
+ irq_name = NSS_IRQ_NAME_PAGED_EMPTY_BUF_SOS;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA:
+ napi_poll_cb = nss_core_handle_napi_sdma;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_PROFILE_DMA;
+ irq_name = NSS_IRQ_NAME_PROFILE_DMA;
+ break;
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3) {
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_3;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue3", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE) {
- int_ctx->cause = NSS_N2H_INTR_COREDUMP_COMPLETE;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_coredump_complete", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_paged_empty_buf_sos", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA) {
- int_ctx->cause = NSS_N2H_INTR_PROFILE_DMA;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx);
+ default:
+ nss_warning("%px: nss%d: unsupported irq# %d\n", nss_ctx, nss_ctx->id, irq_num);
+ return err;
}
+ 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) {
+ nss_warning("%px: nss%d: request_irq failed for irq# %d\n", nss_ctx, nss_ctx->id, irq_num);
return err;
}
-
int_ctx->irq = irq;
return 0;
}
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
@@ -64,6 +64,20 @@
#define NSS_UTCM_CLK "nss-utcm-clk"
/*
+ * N2H interrupts
+ */
+#define NSS_IRQ_NAME_EMPTY_BUF_SOS "nss_empty_buf_sos"
+#define NSS_IRQ_NAME_EMPTY_BUF_QUEUE "nss_empty_buf_queue"
+#define NSS_IRQ_NAME_TX_UNBLOCK "nss-tx-unblock"
+#define NSS_IRQ_NAME_QUEUE0 "nss_queue0"
+#define NSS_IRQ_NAME_QUEUE1 "nss_queue1"
+#define NSS_IRQ_NAME_QUEUE2 "nss_queue2"
+#define NSS_IRQ_NAME_QUEUE3 "nss_queue3"
+#define NSS_IRQ_NAME_COREDUMP_COMPLETE "nss_coredump_complete"
+#define NSS_IRQ_NAME_PAGED_EMPTY_BUF_SOS "nss_paged_empty_buf_sos"
+#define NSS_IRQ_NAME_PROFILE_DMA "nss_profile_dma"
+
+/*
* Voltage values
*/
#define NOMINAL_VOLTAGE 1
@@ -610,71 +624,94 @@ static void __nss_hal_send_interrupt(str
static int __nss_hal_request_irq(struct nss_ctx_instance *nss_ctx, struct nss_platform_data *npd, int irq_num)
{
struct int_ctx_instance *int_ctx = &nss_ctx->int_ctx[irq_num];
+ uint32_t cause, napi_wgt;
int err = -1, irq = npd->irq[irq_num];
+ int (*napi_poll_cb)(struct napi_struct *, int) = NULL;
+ const char *irq_name;
irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_sos", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_queue", int_ctx);
- }
+ switch (irq_num) {
+ case NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS:
+ napi_poll_cb = nss_core_handle_napi_non_queue;
+ napi_wgt = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS;
+ irq_name = NSS_IRQ_NAME_EMPTY_BUF_SOS;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE;
+ irq_name = NSS_IRQ_NAME_EMPTY_BUF_QUEUE;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED:
+ napi_poll_cb = nss_core_handle_napi_non_queue;
+ napi_wgt = NSS_TX_UNBLOCKED_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_TX_UNBLOCKED;
+ irq_name = NSS_IRQ_NAME_TX_UNBLOCK;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_0;
+ irq_name = NSS_IRQ_NAME_QUEUE0;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_1;
+ irq_name = NSS_IRQ_NAME_QUEUE1;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_2;
+ irq_name = NSS_IRQ_NAME_QUEUE2;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3:
+ napi_poll_cb = nss_core_handle_napi_queue;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_DATA_QUEUE_3;
+ irq_name = NSS_IRQ_NAME_QUEUE3;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE:
+ napi_poll_cb = nss_core_handle_napi_emergency;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_COREDUMP_COMPLETE;
+ irq_name = NSS_IRQ_NAME_COREDUMP_COMPLETE;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS:
+ napi_poll_cb = nss_core_handle_napi_non_queue;
+ napi_wgt = NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS;
+ irq_name = NSS_IRQ_NAME_PAGED_EMPTY_BUF_SOS;
+ break;
+
+ case NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA:
+ napi_poll_cb = nss_core_handle_napi_sdma;
+ napi_wgt = NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT;
+ cause = NSS_N2H_INTR_PROFILE_DMA;
+ irq_name = NSS_IRQ_NAME_PROFILE_DMA;
+ break;
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_TX_UNBLOCKED;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss-tx-unblock", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_0;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue0", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1) {
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_1;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue1", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2) {
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_2;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue2", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3) {
- int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_3;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue3", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE) {
- int_ctx->cause = NSS_N2H_INTR_COREDUMP_COMPLETE;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_coredump_complete", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS) {
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
- int_ctx->cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS;
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_paged_empty_buf_sos", int_ctx);
- }
-
- if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA) {
- int_ctx->cause = NSS_N2H_INTR_PROFILE_DMA;
- netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
- err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx);
+ default:
+ nss_warning("%px: nss%d: unsupported irq# %d\n", nss_ctx, nss_ctx->id, irq_num);
+ return err;
}
+ 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) {
+ nss_warning("%px: nss%d: request_irq failed for irq# %d\n", nss_ctx, nss_ctx->id, irq_num);
return err;
}

View File

@ -0,0 +1,79 @@
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -30,7 +30,6 @@
#include <linux/ethtool.h>
#include "nss_hal.h"
-#include "nss_arch.h"
#include "nss_core.h"
#include "nss_tx_rx_common.h"
#ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
@@ -51,6 +50,57 @@
*/
#define NSS_AP0_IMAGE "qca-nss0.bin"
#define NSS_AP1_IMAGE "qca-nss1.bin"
+#define BUFFER_SIZE 8192
+
+// Function to search for the byte sequence in the buffer
+static unsigned char *search_sequence(const unsigned char *buffer,
+ size_t buffer_size,
+ const unsigned char *sequence,
+ size_t sequence_size)
+{
+ for (size_t i = 0; i <= buffer_size - sequence_size; i++) {
+ if (memcmp(buffer + i, sequence, sequence_size) == 0) {
+ return (unsigned char *)(buffer + i);
+ }
+ }
+ return NULL;
+}
+
+static int nss_hal_firmware_info(struct platform_device *nss_dev,
+ const struct firmware *fw)
+{
+ unsigned char *start_pos, *end_pos;
+ size_t i;
+ unsigned char start_sequence[] = { 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20 };
+ unsigned char end_sequence[] = { 0x00 };
+ char version[256];
+ bool found = false;
+
+ // Search for the start sequence
+ start_pos = search_sequence(fw->data, fw->size, start_sequence, sizeof(start_sequence));
+ if (start_pos) {
+ start_pos += sizeof(start_sequence);
+
+ end_pos = search_sequence(start_pos, fw->size - (start_pos - fw->data), end_sequence, sizeof(end_sequence));
+ if (end_pos) {
+ // Convert the version information to a string
+ for (i = 0; start_pos + i < end_pos && i < sizeof(version) - 1; i++) {
+ version[i] = start_pos[i];
+ }
+ version[i] = '\0';
+
+ dev_info(&nss_dev->dev, "NSS fw version: %s\n", version);
+ found = true;
+ }
+ }
+
+ if (!found) {
+ dev_err(&nss_dev->dev, "Unable to get NSS fw version\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
int nss_hal_firmware_load(struct nss_ctx_instance *nss_ctx, struct platform_device *nss_dev, struct nss_platform_data *npd)
{
@@ -83,6 +133,10 @@ int nss_hal_firmware_load(struct nss_ctx
return rc;
}
+ if (nss_ctx->id == 0) {
+ nss_hal_firmware_info(nss_dev, nss_fw);
+ }
+
dev_info(&nss_dev->dev, "fw of size %d bytes copied to addr: %x, nss_id: %d\n", (int)nss_fw->size, npd->load_addr, nss_ctx->id);
memcpy_toio(load_mem, nss_fw->data, nss_fw->size);
release_firmware(nss_fw);

View File

@ -0,0 +1,201 @@
--- a/exports/nss_capwap.h
+++ b/exports/nss_capwap.h
@@ -284,6 +284,7 @@ struct nss_capwap_dtls_msg {
uint32_t reserved; /**< Reserved field for future use. */
};
+#ifdef NSS_FIRMWARE_VERSION_12_5
/**
* nss_capwap_flow_attr
* Inner Flow attributes.
@@ -293,6 +294,7 @@ struct nss_capwap_flow_attr {
uint32_t flow_id; /**< Flow Identification. */
uint32_t scs_sdwf_id; /**< SCS or SDWF Identification. */
};
+#endif
/**
* nss_capwap_flow_rule_msg
@@ -312,7 +314,11 @@ struct nss_capwap_flow_rule_msg {
/*
* Flow attributes.
*/
+#ifdef NSS_FIRMWARE_VERSION_12_5
struct nss_capwap_flow_attr flow_attr;
+#else
+ uint32_t flow_id; /**< Flow identification. */
+#endif
};
/**
--- a/exports/nss_ipv4.h
+++ b/exports/nss_ipv4.h
@@ -290,7 +290,9 @@ enum nss_ipv4_stats_types {
#define NSS_IPV4_RULE_CREATE_IDENTIFIER_VALID 0x1000
/**< Identifier is valid. */
#define NSS_IPV4_RULE_CREATE_MIRROR_VALID 0x2000 /**< Mirror fields are valid. */
+#ifdef NSS_FIRMWARE_VERSION_12_5
#define NSS_IPV4_RULE_CREATE_RAWIP_VALID 0x4000 /**< RAW IP fields are valid. */
+#endif
/*
* Multicast command rule flags
--- a/exports/nss_pvxlan.h
+++ b/exports/nss_pvxlan.h
@@ -63,8 +63,10 @@ typedef enum nss_pvxlan_msg_type {
NSS_PVXLAN_MSG_TYPE_TUNNEL_DISABLE, /**< Disable the tunnel. */
NSS_PVXLAN_MSG_TYPE_MAC_ADD, /**< Add MAC rule to the database. */
NSS_PVXLAN_MSG_TYPE_MAC_DEL, /**< Remove MAC rule from the database. */
+#ifdef NSS_FIRMWARE_VERSION_12_5
NSS_PVXLAN_MSG_TYPE_CONFIG_VP, /**< VP configuration. */
NSS_PVXLAN_MSG_TYPE_UNCONFIG_VP, /**< VP unconfiguration. */
+#endif
NSS_PVXLAN_MSG_TYPE_MAX, /**< Maximum message type. */
} nss_pvxlan_msg_type_t;
@@ -97,10 +99,12 @@ typedef enum nss_pvxlan_error_response_t
/**< MAC entry allocation failed. */
PVXLAN_ERROR_MSG_MAC_ENTRY_DELETE_FAILED,
/**< MAC entry deletion failed. */
+#ifdef NSS_FIRMWARE_VERSION_12_5
PVXLAN_ERROR_MSG_CONFIG_VP_FAILED,
/**< VP configuration failed. */
PVXLAN_ERROR_MSG_UNCONFIG_VP_FAILED,
/**< VP unconfiguration failed. */
+#endif
NSS_PVXLAN_ERROR_MAX, /**< Maximum error type. */
} nss_pvxlan_error_response_t;
@@ -181,6 +185,7 @@ struct nss_pvxlan_mac_msg {
uint16_t policy_id; /**< Policy ID. */
};
+#ifdef NSS_FIRMWARE_VERSION_12_5
/**
* nss_pvxlan_vp_msg
* VP configuration message.
@@ -192,6 +197,7 @@ struct nss_pvxlan_vp_msg {
int16_t vp_num; /**< VP number. */
bool ppe_to_host; /**< Enable/disable PPE to host mode. */
};
+#endif
/**
* nss_pvxlan_msg
@@ -216,8 +222,10 @@ struct nss_pvxlan_msg {
/**< MAC rule add message. */
struct nss_pvxlan_mac_msg mac_del;
/**< MAC rule delete message. */
+#ifdef NSS_FIRMWARE_VERSION_12_5
struct nss_pvxlan_vp_msg vp_config;
/**< VP configuration message. */
+#endif
} msg; /**< Message payload. */
};
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -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. */
+#ifdef NSS_FIRMWARE_VERSION_12_5
uint32_t ucast_rcv_cnt; /**< Total number of unicast packets received. */
uint32_t ucast_rcv_bytes; /**< Total number of unicast bytes received. */
+#endif
};
/**
@@ -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. */
+#ifdef NSS_FIRMWARE_VERSION_12_5
uint32_t tx_mpdu_retry_count; /**< Per mpdu retry count. */
uint32_t tx_mpdu_total_retry_count; /**< Total mpdu retry count. */
+#endif
};
/**
--- a/nss_pvxlan_log.c
+++ b/nss_pvxlan_log.c
@@ -36,7 +36,9 @@ static int8_t *nss_pvxlan_log_message_ty
"PVxLAN Disable Tunnel",
"PVxLAN Add MAC rule",
"PVxLAN Delete MAC rule",
+#ifdef NSS_FIRMWARE_VERSION_12_5
"PVxLAN Config VP"
+#endif
};
/*
@@ -54,7 +56,9 @@ static int8_t *nss_pvxlan_log_error_resp
"PVXLAN MAC Table Full",
"PVXLAN MAC Exists",
"PVXLAN MAC Does Not Exist",
+#ifdef NSS_FIRMWARE_VERSION_12_5
"PVXLAN Config VP failed"
+#endif
};
/*
@@ -158,6 +162,7 @@ static void nss_pvxlan_log_mac_del_msg(s
nss_pvxlan_log_mac_msg(npvcm);
}
+#ifdef NSS_FIRMWARE_VERSION_12_5
/*
* nss_pvxlan_log_unconfig_vp_msg()
* Log NSS PVXLAN unconfig VP message.
@@ -181,6 +186,7 @@ static void nss_pvxlan_log_config_vp_msg
vpm->vp_num,
vpm->ppe_to_host ? "enabled" : "disabled");
}
+#endif
/*
* nss_pvxlan_log_verbose()
@@ -213,6 +219,7 @@ static void nss_pvxlan_log_verbose(struc
nss_pvxlan_log_mac_del_msg(npvm);
break;
+#ifdef NSS_FIRMWARE_VERSION_12_5
case NSS_PVXLAN_MSG_TYPE_CONFIG_VP:
nss_pvxlan_log_config_vp_msg(npvm);
break;
@@ -220,6 +227,7 @@ static void nss_pvxlan_log_verbose(struc
case NSS_PVXLAN_MSG_TYPE_UNCONFIG_VP:
nss_pvxlan_log_unconfig_vp_msg(npvm);
break;
+#endif
case NSS_PVXLAN_MSG_TYPE_SYNC_STATS:
break;
--- a/nss_capwap_log.c
+++ b/nss_capwap_log.c
@@ -166,7 +166,11 @@ static void nss_capwap_flow_rule_msg(str
"CAPWAP Destination Port: %d\n"
"CAPWAP Source IP: %x %x %x %x\n"
"CAPWAP Destination IP: %x %x %x %x"
+#ifdef NSS_FIRMWARE_VERSION_12_5
"CAPWAP Flow type:%d Flow ID: %d SCS_SDWF ID: %d",
+#else
+ "CAPWAP Flow ID: %d",
+#endif
ncfrm,
ncfrm->ip_version, ncfrm->protocol,
ncfrm->src_port, ncfrm->dst_port,
@@ -174,9 +178,13 @@ static void nss_capwap_flow_rule_msg(str
ncfrm->src_ip[2], ncfrm->src_ip[3],
ncfrm->dst_ip[0], ncfrm->dst_ip[1],
ncfrm->dst_ip[2], ncfrm->dst_ip[3],
+#ifdef NSS_FIRMWARE_VERSION_12_5
ncfrm->flow_attr.type,
ncfrm->flow_attr.flow_id,
ncfrm->flow_attr.scs_sdwf_id);
+#else
+ ncfrm->flow_id);
+#endif
}
/*

View File

@ -0,0 +1,88 @@
--- a/exports/nss_bridge.h
+++ b/exports/nss_bridge.h
@@ -273,7 +273,7 @@ nss_tx_status_t nss_bridge_tx_set_mtu_ms
* @return
* Status of the Tx operation.
*/
-nss_tx_status_t nss_bridge_tx_set_mac_addr_msg(uint32_t bridge_if_num, uint8_t *addr);
+nss_tx_status_t nss_bridge_tx_set_mac_addr_msg(uint32_t bridge_if_num, const uint8_t *addr);
/**
* nss_bridge_tx_join_msg
--- a/exports/nss_vlan.h
+++ b/exports/nss_vlan.h
@@ -210,7 +210,7 @@ nss_tx_status_t nss_vlan_tx_set_mtu_msg(
* @return
* Status of the Tx operation.
*/
-nss_tx_status_t nss_vlan_tx_set_mac_addr_msg(uint32_t vlan_if_num, uint8_t *addr);
+nss_tx_status_t nss_vlan_tx_set_mac_addr_msg(uint32_t vlan_if_num, const uint8_t *addr);
/**
* nss_vlan_tx_vsi_attach_msg
--- a/exports/nss_wifi_vdev.h
+++ b/exports/nss_wifi_vdev.h
@@ -1404,7 +1404,7 @@ nss_tx_status_t nss_wifi_vdev_base_set_n
* @return
* Status of the Tx operation.
*/
-nss_tx_status_t nss_wifi_vdev_set_peer_next_hop(struct nss_ctx_instance *nss_ctx, uint32_t nss_if, uint8_t *addr, uint32_t next_hop_if);
+nss_tx_status_t nss_wifi_vdev_set_peer_next_hop(struct nss_ctx_instance *nss_ctx, uint32_t nss_if, const uint8_t *addr, uint32_t next_hop_if);
/*
* nss_wifi_vdev_set_dp_type
--- a/nss_bridge.c
+++ b/nss_bridge.c
@@ -304,7 +304,7 @@ EXPORT_SYMBOL(nss_bridge_tx_set_mtu_msg)
* nss_bridge_tx_set_mac_addr_msg
* API to send change mac addr message to NSS FW
*/
-nss_tx_status_t nss_bridge_tx_set_mac_addr_msg(uint32_t bridge_if_num, uint8_t *addr)
+nss_tx_status_t nss_bridge_tx_set_mac_addr_msg(uint32_t bridge_if_num, const uint8_t *addr)
{
struct nss_ctx_instance *nss_ctx = nss_bridge_get_context();
struct nss_bridge_msg nbm;
--- a/nss_phys_if.c
+++ b/nss_phys_if.c
@@ -402,7 +402,7 @@ nss_tx_status_t nss_phys_if_link_state(s
* nss_phys_if_mac_addr()
* Send a MAC address to physical interface
*/
-nss_tx_status_t nss_phys_if_mac_addr(struct nss_ctx_instance *nss_ctx, uint8_t *addr, uint32_t if_num)
+nss_tx_status_t nss_phys_if_mac_addr(struct nss_ctx_instance *nss_ctx, const uint8_t *addr, uint32_t if_num)
{
struct nss_phys_if_msg nim;
struct nss_if_mac_address_set *nmas;
--- a/nss_phys_if.h
+++ b/nss_phys_if.h
@@ -284,7 +284,7 @@ nss_tx_status_t nss_phys_if_link_state(s
*
* @return nss_tx_status_t Tx status
*/
-nss_tx_status_t nss_phys_if_mac_addr(struct nss_ctx_instance *nss_ctx, uint8_t *addr, uint32_t if_num);
+nss_tx_status_t nss_phys_if_mac_addr(struct nss_ctx_instance *nss_ctx, const uint8_t *addr, uint32_t if_num);
/**
* @brief Send MTU change notification to NSS
--- a/nss_vlan.c
+++ b/nss_vlan.c
@@ -246,7 +246,7 @@ EXPORT_SYMBOL(nss_vlan_tx_set_mtu_msg);
* nss_vlan_tx_set_mac_addr_msg
* API to send change mac addr message to NSS FW
*/
-nss_tx_status_t nss_vlan_tx_set_mac_addr_msg(uint32_t vlan_if_num, uint8_t *addr)
+nss_tx_status_t nss_vlan_tx_set_mac_addr_msg(uint32_t vlan_if_num, const uint8_t *addr)
{
struct nss_ctx_instance *nss_ctx = nss_vlan_get_context();
struct nss_vlan_msg nvm;
--- a/nss_wifi_vdev.c
+++ b/nss_wifi_vdev.c
@@ -274,7 +274,7 @@ EXPORT_SYMBOL(nss_wifi_vdev_base_set_nex
/*
* nss_wifi_vdev_set_peer_next_hop()
*/
-nss_tx_status_t nss_wifi_vdev_set_peer_next_hop(struct nss_ctx_instance *ctx, uint32_t nss_if, uint8_t *addr, uint32_t next_hop_if)
+nss_tx_status_t nss_wifi_vdev_set_peer_next_hop(struct nss_ctx_instance *ctx, uint32_t nss_if, const uint8_t *addr, uint32_t next_hop_if)
{
nss_tx_status_t status;
struct nss_wifi_vdev_msg *wifivdevmsg = kzalloc(sizeof(struct nss_wifi_vdev_msg), GFP_KERNEL);

View File

@ -0,0 +1,60 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -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");
+static int nss_bootstate = 0;
+
/*
* Atomic variables to control jumbo_mru & paged_mode
*/
@@ -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);
}
+void nss_bootwait(void)
+{
+ int dead = 10 * 10;
+#if (NSS_MAX_CORES > 1)
+ while (nss_bootstate < 2 && dead-- > 0)
+#else
+ while (!nss_bootstate && dead-- > 0)
+#endif
+ {
+ msleep(100);
+ }
+}
+
/*
* nss_core_handle_cause_nonqueue()
* Handle non-queue interrupt causes (e.g. empty buffer SOS, Tx unblocked)
@@ -2321,6 +2336,9 @@ static void nss_core_handle_cause_nonque
#endif
#endif
}
+ if (unlikely(nss_ctx->state == NSS_CORE_STATE_INITIALIZED)) {
+ nss_bootstate++;
+ }
#if defined(NSS_DRV_EDMA_LITE_ENABLE)
/*
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -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);
+ nss_bootwait();
goto out;
err_register_irq:
--- a/nss_core.h
+++ b/nss_core.h
@@ -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);
+void nss_bootwait(void);
+
#endif /* __NSS_CORE_H */

View File

@ -0,0 +1,39 @@
--- a/nss_wifi_mesh_strings.c
+++ b/nss_wifi_mesh_strings.c
@@ -80,8 +80,8 @@ struct nss_stats_info nss_wifi_mesh_stri
{"not_found", NSS_STATS_TYPE_SPECIAL},
{"delete_success", NSS_STATS_TYPE_SPECIAL},
{"update_success", NSS_STATS_TYPE_SPECIAL},
- {"mesh_path_expired", NSS_STATS_TYPE_SPECIAL},
- {"mesh_path_refresh_needed", NSS_STATS_TYPE_SPECIAL},
+ {"path_expired", NSS_STATS_TYPE_SPECIAL},
+ {"path_refresh_needed", NSS_STATS_TYPE_SPECIAL},
{"add_requests", NSS_STATS_TYPE_SPECIAL},
{"del_requests", NSS_STATS_TYPE_SPECIAL},
{"update_requests", NSS_STATS_TYPE_SPECIAL},
@@ -91,8 +91,8 @@ struct nss_stats_info nss_wifi_mesh_stri
{"metric_updations", NSS_STATS_TYPE_SPECIAL},
{"block_mesh_fwd_updations", NSS_STATS_TYPE_SPECIAL},
{"delete_failures", NSS_STATS_TYPE_SPECIAL},
- {"mesh_path_dummy_add_failures",NSS_STATS_TYPE_SPECIAL},
- {"mesh_path_dummy_add_success", NSS_STATS_TYPE_SPECIAL}
+ {"path_dummy_add_failures", NSS_STATS_TYPE_SPECIAL},
+ {"path_dummy_add_success", NSS_STATS_TYPE_SPECIAL}
};
@@ -126,10 +126,10 @@ struct nss_stats_info nss_wifi_mesh_stri
{"update_requests", NSS_STATS_TYPE_SPECIAL},
{"mda_updations", NSS_STATS_TYPE_SPECIAL},
{"flag_updations", NSS_STATS_TYPE_SPECIAL},
- {"mesh_proxy_path_dummy_lookup_success", NSS_STATS_TYPE_SPECIAL},
- {"mesh_proxy_path_dummy_lookup_failures", NSS_STATS_TYPE_SPECIAL},
- {"mesh_proxy_path_dummy_add_failures", NSS_STATS_TYPE_SPECIAL},
- {"mesh_proxy_path_dummy_add_success", NSS_STATS_TYPE_SPECIAL}
+ {"proxy_path_dummy_lookup_success", NSS_STATS_TYPE_SPECIAL},
+ {"proxy_path_dummy_lookup_failures", NSS_STATS_TYPE_SPECIAL},
+ {"proxy_path_dummy_add_failures", NSS_STATS_TYPE_SPECIAL},
+ {"proxy_path_dummy_add_success", NSS_STATS_TYPE_SPECIAL}
};
/*

View File

@ -0,0 +1,195 @@
--- a/nss_rps.c
+++ b/nss_rps.c
@@ -70,7 +70,7 @@ static inline void nss_rps_pri_map_usage
* nss_rps_pri_map_print()
* Sysctl handler for printing rps/pri mapping.
*/
-static int nss_rps_pri_map_print(struct ctl_table *ctl, void __user *buffer,
+static int nss_rps_pri_map_print(void *buffer,
size_t *lenp, loff_t *ppos, int *pri_map)
{
char *r_buf;
@@ -109,7 +109,7 @@ static int nss_rps_pri_map_print(struct
len = scnprintf(r_buf + cp_bytes, 4, "\n");
cp_bytes += len;
- cp_bytes = simple_read_from_buffer(buffer, *lenp, ppos, r_buf, cp_bytes);
+ cp_bytes = memory_read_from_buffer(buffer, *lenp, ppos, r_buf, cp_bytes);
*lenp = cp_bytes;
kfree(r_buf);
return 0;
@@ -119,13 +119,10 @@ static int nss_rps_pri_map_print(struct
* nss_rps_pri_map_parse()
* Sysctl handler for rps/pri mappings.
*/
-static int nss_rps_pri_map_parse(struct ctl_table *ctl, void __user *buffer,
- size_t *lenp, loff_t *ppos, struct nss_rps_pri_map_parse_data *out)
+static int nss_rps_pri_map_parse(void *buffer,
+ size_t *lenp, struct nss_rps_pri_map_parse_data *out)
{
- size_t cp_bytes = 0;
char w_buf[5];
- loff_t w_offset = 0;
- char *str;
unsigned int pri;
int core, res;
@@ -140,14 +137,15 @@ static int nss_rps_pri_map_parse(struct
/*
* It's a write operation
*/
- cp_bytes = simple_write_to_buffer(w_buf, *lenp, &w_offset, buffer, 5);
- if (cp_bytes != *lenp) {
- nss_warning("failed to write to buffer\n");
- return -EFAULT;
+ if (*lenp >= sizeof(w_buf)) {
+ nss_warning("Input too large: %zu\n", *lenp);
+ return -EINVAL;
}
- str = w_buf;
- res = sscanf(str, "%u %d", &pri, &core);
+ memcpy(w_buf, buffer, *lenp);
+ w_buf[*lenp] = '\0'; /* Ensure null termination */
+
+ res = sscanf(w_buf, "%u %d", &pri, &core);
if (res != NSS_RPS_PRI_MAP_PARAM_FIELD_COUNT) {
nss_warning("failed to read the buffer\n");
return -EFAULT;
@@ -407,7 +405,7 @@ static nss_tx_status_t nss_rps_pri_map_c
* Enable NSS RPS.
*/
static int nss_rps_cfg_handler(struct ctl_table *ctl, int write,
- void __user *buffer, size_t *lenp, loff_t *ppos)
+ void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx;
@@ -458,7 +456,7 @@ static int nss_rps_cfg_handler(struct ct
* Configure NSS rps_hash_bitmap
*/
static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write,
- void __user *buffer, size_t *lenp, loff_t *ppos)
+ void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx __attribute__((unused)) = &nss_top->nss[0];
@@ -521,7 +519,7 @@ static int nss_rps_hash_bitmap_cfg_handl
* Configure NSS rps_pri_map
*/
static int nss_rps_pri_map_cfg_handler(struct ctl_table *ctl, int write,
- void __user *buffer, size_t *lenp, loff_t *ppos)
+ void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -529,10 +527,10 @@ static int nss_rps_pri_map_cfg_handler(s
int ret, ret_pri_map;
struct nss_rps_pri_map_parse_data out, current_state;
if (!write) {
- return nss_rps_pri_map_print(ctl, buffer, lenp, ppos, nss_rps_pri_map);
+ return nss_rps_pri_map_print(buffer, lenp, ppos, nss_rps_pri_map);
}
- ret = nss_rps_pri_map_parse(ctl, buffer, lenp, ppos, &out);
+ ret = nss_rps_pri_map_parse(buffer, lenp, &out);
if (ret != NSS_SUCCESS) {
nss_rps_pri_map_usage();
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -595,7 +595,7 @@ void nss_ipv6_free_conn_tables(void)
* nss_ipv6_accel_mode_cfg_handler()
* Configure acceleration mode for IPv6
*/
-static int nss_ipv6_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -639,7 +639,7 @@ static int nss_ipv6_accel_mode_cfg_handl
* nss_ipv6_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv6_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -599,7 +599,7 @@ void nss_ipv4_free_conn_tables(void)
* nss_ipv4_accel_mode_cfg_handler()
* Configure acceleration mode for IPv4
*/
-static int nss_ipv4_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -643,7 +643,7 @@ static int nss_ipv4_accel_mode_cfg_handl
* nss_ipv4_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv4_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
--- a/nss_dscp_map.h
+++ b/nss_dscp_map.h
@@ -46,7 +46,7 @@ struct nss_dscp_map_parse {
* nss_dscp_map_print()
* Sysctl handler for printing dscp/pri mapping.
*/
-static int nss_dscp_map_print(struct ctl_table *ctl, void __user *buffer, size_t *lenp,
+static int nss_dscp_map_print(struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_entry *mapping)
{
char *r_buf;
@@ -105,7 +105,7 @@ static int nss_dscp_map_print(struct ctl
len = scnprintf(r_buf + cp_bytes, 4, "\n");
cp_bytes += len;
- cp_bytes = simple_read_from_buffer(buffer, *lenp, ppos, r_buf, cp_bytes);
+ cp_bytes = memory_read_from_buffer(buffer, *lenp, ppos, r_buf, cp_bytes);
*lenp = cp_bytes;
kfree(r_buf);
return 0;
@@ -115,13 +115,11 @@ static int nss_dscp_map_print(struct ctl
* nss_dscp_map_parse()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_dscp_map_parse(struct ctl_table *ctl, void __user *buffer, size_t *lenp,
+static int nss_dscp_map_parse(struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_parse *out)
{
int count;
- size_t cp_bytes = 0;
char w_buf[7];
- loff_t w_offset = 0;
char *str;
char *tokens[NSS_DSCP_MAP_PARAM_FIELD_COUNT];
unsigned int dscp, priority, action;
@@ -135,15 +133,14 @@ static int nss_dscp_map_parse(struct ctl
return -EINVAL;
}
- /*
- * It's a write operation
- */
- cp_bytes = simple_write_to_buffer(w_buf, *lenp, &w_offset, buffer, 7);
- if (cp_bytes != *lenp) {
- nss_warning("failed to write to buffer\n");
- return -EFAULT;
+ if (*lenp >= sizeof(w_buf)) {
+ nss_warning("Input too large: %zu\n", *lenp);
+ return -EINVAL;
}
+ memcpy(w_buf, buffer, *lenp);
+ w_buf[*lenp] = '\0'; /* Ensure null termination */
+
count = 0;
str = w_buf;
tokens[count] = strsep(&str, " ");

View File

@ -0,0 +1,788 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -38,6 +38,9 @@
#endif
#endif
#include <linux/etherdevice.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0))
+#include <linux/skbuff_ref.h>
+#endif
#include "nss_tx_rx_common.h"
#ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
@@ -50,26 +53,7 @@
#define NSS_CORE_JUMBO_LINEAR_BUF_SIZE 128
#if (NSS_SKB_REUSE_SUPPORT == 1)
-/*
- * We have validated the skb recycling code within the NSS for the
- * following kernel versions. Before enabling the driver in new kernels,
- * the skb recycle code must be checked against Linux skb handling.
- *
- * Tested on: 3.4, 3.10, 3.14, 3.18, 4.4, 5.4 and 6.6
- */
-#if (!( \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)))) || \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)))) || \
-(((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(6, 6, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0))))))
-#error "Check skb recycle code in this file to match Linux version"
-#endif
-
static atomic_t max_reuse = ATOMIC_INIT(PAGE_SIZE);
-
#endif /* NSS_SKB_REUSE_SUPPORT */
static int max_ipv4_conn = NSS_DEFAULT_NUM_CONN;
--- a/Makefile
+++ b/Makefile
@@ -598,7 +598,7 @@ ccflags-y += -I$(obj)/nss_hal/include -I
ccflags-y += -I$(obj)/nss_data_plane/hal/include
ccflags-y += -DNSS_PM_DEBUG_LEVEL=0 -DNSS_SKB_REUSE_SUPPORT=1
-ccflags-y += -Wall -Werror
+ccflags-y += -Wall -Werror -Wno-missing-declarations -Wno-missing-prototypes -Wno-empty-body
KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
@@ -630,6 +630,8 @@ qca-nss-drv-objs += \
ccflags-y += -DNSS_FREQ_SCALE_SUPPORT=1
endif
+ccflags-y += -include $(obj)/compat.h
+
ccflags-y += $(NSS_CCFLAGS)
export NSS_CCFLAGS
--- a/nss_init.c
+++ b/nss_init.c
@@ -123,10 +123,17 @@ static inline int nss_probe(struct platf
* nss_remove()
* HLOS device remove callback
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
static inline int nss_remove(struct platform_device *nss_dev)
{
return nss_hal_remove(nss_dev);
}
+#else
+static inline void nss_remove(struct platform_device *nss_dev)
+{
+ nss_hal_remove(nss_dev);
+}
+#endif
#if (NSS_DT_SUPPORT == 1)
/*
@@ -136,7 +143,6 @@ struct of_device_id nss_dt_ids[] = {
{ .compatible = "qcom,nss" },
{ .compatible = "qcom,nss0" },
{ .compatible = "qcom,nss1" },
- {},
};
MODULE_DEVICE_TABLE(of, nss_dt_ids);
#endif
@@ -176,7 +182,7 @@ static void nss_reset_frequency_stats_sa
* nss_current_freq_handler()
* Handle Userspace Frequency Change Requests
*/
-static int nss_current_freq_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_current_freq_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, i;
@@ -236,7 +242,7 @@ static int nss_current_freq_handler(stru
* nss_auto_scale_handler()
* Enables or Disable Auto Scaling
*/
-static int nss_auto_scale_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_auto_scale_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -301,7 +307,7 @@ static int nss_auto_scale_handler(struct
* nss_get_freq_table_handler()
* Display Support Freq and Ex how to Change.
*/
-static int nss_get_freq_table_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_freq_table_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, i;
@@ -330,7 +336,7 @@ static int nss_get_freq_table_handler(st
* nss_get_average_inst_handler()
* Display AVG Inst Per Ms.
*/
-static int nss_get_average_inst_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_average_inst_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -352,7 +358,7 @@ static int nss_get_average_inst_handler(
* nss_debug_handler()
* Enable NSS debug output
*/
-static int nss_debug_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_debug_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -372,7 +378,7 @@ static int nss_debug_handler(struct ctl_
* nss_coredump_handler()
* Send Signal To Coredump NSS Cores
*/
-static int nss_coredump_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_coredump_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[NSS_CORE_0];
int ret;
@@ -397,7 +403,7 @@ static int nss_coredump_handler(struct c
* nss_jumbo_mru_handler()
* Sysctl to modify nss_jumbo_mru
*/
-static int nss_jumbo_mru_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_jumbo_mru_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -418,7 +424,7 @@ static int nss_jumbo_mru_handler(struct
* Sysctl to modify nss_paged_mode.
*/
-static int nss_paged_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_paged_mode_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -440,7 +446,7 @@ static int nss_paged_mode_handler(struct
* nss_get_min_reuse_handler()
* Sysctl to get min reuse sizes
*/
-static int nss_get_min_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_min_reuse_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
struct nss_ctx_instance *nss_ctx = NULL;
@@ -467,7 +473,7 @@ static int nss_get_min_reuse_handler(str
* nss_max_reuse_handler()
* Sysctl to modify nss_max_reuse
*/
-static int nss_max_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_max_reuse_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -502,8 +508,7 @@ static struct ctl_table nss_skb_reuse_ta
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_max_reuse_handler,
- },
- { }
+ }
};
#endif
@@ -539,8 +544,7 @@ static struct ctl_table nss_freq_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_get_average_inst_handler,
- },
- { }
+ }
};
#endif
@@ -588,8 +592,7 @@ static struct ctl_table nss_general_tabl
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_paged_mode_handler,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -70,7 +70,7 @@ static size_t nss_stats_spacing(uint64_t
* nss_stats_nonzero_handler()
* Handler to take nonzero stats print configuration.
*/
-static int nss_stats_nonzero_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_stats_nonzero_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -84,8 +84,7 @@ static struct ctl_table nss_stats_table[
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_stats_nonzero_handler,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
@@ -261,7 +260,7 @@ size_t nss_stats_banner(char *lbuf, size
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "<");
}
- strlcpy(node_upr, node, NSS_STATS_NODE_NAME_MAX);
+ strscpy(node_upr, node, NSS_STATS_NODE_NAME_MAX + 1);
for (i = 0; node_upr[i] != '\0' && i < NSS_STATS_NODE_NAME_MAX; i++) {
node_upr[i] = toupper(node_upr[i]);
}
@@ -326,7 +325,7 @@ size_t nss_stats_print(char *node, char
continue;
}
- strlcpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
+ strscpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
/*
* Converting uppercase to lower case.
@@ -335,7 +334,7 @@ size_t nss_stats_print(char *node, char
stats_string[j] = tolower(stats_string[j]);
}
- strlcpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX);
+ strscpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX + 1);
for (j = 0; node_lwr[j] != '\0' && j < NSS_STATS_NODE_NAME_MAX; j++) {
node_lwr[j] = tolower(node_lwr[j]);
}
--- a/nss_tunipip6_stats.c
+++ b/nss_tunipip6_stats.c
@@ -17,6 +17,10 @@
**************************************************************************
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#endif
+
#include "nss_core.h"
#include "nss_tunipip6.h"
#include "nss_stats.h"
--- /dev/null
+++ b/compat.h
@@ -0,0 +1,14 @@
+// compat.h
+#ifndef _COMPAT_H
+#define _COMPAT_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#define compat_const const
+#else
+#define compat_const
+#endif
+
+#endif /* _COMPAT_H */
--- a/nss_c2c_tx.c
+++ b/nss_c2c_tx.c
@@ -284,7 +284,7 @@ EXPORT_SYMBOL(nss_c2c_tx_msg_init);
* nss_c2c_tx_performance_test_handler()
* Handles the performance test.
*/
-static int nss_c2c_tx_performance_test_handler(struct ctl_table *ctl, int write,
+static int nss_c2c_tx_performance_test_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -330,8 +330,7 @@ static struct ctl_table nss_c2c_tx_table
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_c2c_tx_performance_test_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_c2c_tx_header;
--- a/nss_dma.c
+++ b/nss_dma.c
@@ -285,7 +285,7 @@ EXPORT_SYMBOL(nss_dma_get_context);
* nss_dma_test_handler()
* Handles the performance test.
*/
-static int nss_dma_test_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_dma_test_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_dma_get_context();
int cur_state = test_cfg.run.val;
@@ -375,8 +375,7 @@ static struct ctl_table nss_dma_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -599,7 +599,7 @@ void nss_ipv4_free_conn_tables(void)
* nss_ipv4_accel_mode_cfg_handler()
* Configure acceleration mode for IPv4
*/
-static int nss_ipv4_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_accel_mode_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -643,7 +643,7 @@ static int nss_ipv4_accel_mode_cfg_handl
* nss_ipv4_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv4_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_dscp_map_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -708,8 +708,7 @@ static struct ctl_table nss_ipv4_table[]
.maxlen = sizeof(struct nss_dscp_map_entry),
.mode = 0644,
.proc_handler = &nss_ipv4_dscp_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_ipv4_header;
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -595,7 +595,7 @@ void nss_ipv6_free_conn_tables(void)
* nss_ipv6_accel_mode_cfg_handler()
* Configure acceleration mode for IPv6
*/
-static int nss_ipv6_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_accel_mode_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -639,7 +639,7 @@ static int nss_ipv6_accel_mode_cfg_handl
* nss_ipv6_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv6_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_dscp_map_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -703,8 +703,7 @@ static struct ctl_table nss_ipv6_table[]
.maxlen = sizeof(struct nss_dscp_map_entry),
.mode = 0644,
.proc_handler = &nss_ipv6_dscp_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_ipv6_header;
--- a/nss_log.c
+++ b/nss_log.c
@@ -524,7 +524,7 @@ fail:
* nss_logbuffer_handler()
* Enable NSS debug output
*/
-int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+int nss_logbuffer_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
int core_status;
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -357,7 +357,7 @@ static int nss_n2h_get_paged_payload_inf
* nss_n2h_set_empty_buf_pool()
* Sets empty pool buffer
*/
-static int nss_n2h_set_empty_buf_pool(struct ctl_table *ctl, int write,
+static int nss_n2h_set_empty_buf_pool(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
nss_ptr_t core_num, int *new_val)
@@ -459,7 +459,7 @@ failure:
* nss_n2h_set_empty_paged_pool_buf()
* Sets empty paged pool buffer
*/
-static int nss_n2h_set_empty_paged_pool_buf(struct ctl_table *ctl, int write,
+static int nss_n2h_set_empty_paged_pool_buf(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
nss_ptr_t core_num, int *new_val)
@@ -561,7 +561,7 @@ failure:
* nss_n2h_set_water_mark()
* Sets water mark for N2H SOS
*/
-static int nss_n2h_set_water_mark(struct ctl_table *ctl, int write,
+static int nss_n2h_set_water_mark(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
uint32_t core_num, int *low, int *high)
@@ -675,7 +675,7 @@ failure:
* nss_n2h_set_paged_water_mark()
* Sets water mark for paged pool N2H SOS
*/
-static int nss_n2h_set_paged_water_mark(struct ctl_table *ctl, int write,
+static int nss_n2h_set_paged_water_mark(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
uint32_t core_num, int *low, int *high)
@@ -789,7 +789,7 @@ failure:
* nss_n2h_cfg_wifi_pool()
* Sets number of wifi payloads to adjust high water mark for N2H SoS
*/
-static int nss_n2h_cfg_wifi_pool(struct ctl_table *ctl, int write,
+static int nss_n2h_cfg_wifi_pool(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
int *payloads)
@@ -886,7 +886,7 @@ failure:
* nss_n2h_empty_pool_buf_core1_handler()
* Sets the number of empty buffer for core 1
*/
-static int nss_n2h_empty_pool_buf_cfg_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_pool_buf_cfg_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -898,7 +898,7 @@ static int nss_n2h_empty_pool_buf_cfg_co
* nss_n2h_empty_pool_buf_core0_handler()
* Sets the number of empty buffer for core 0
*/
-static int nss_n2h_empty_pool_buf_cfg_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_pool_buf_cfg_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -910,7 +910,7 @@ static int nss_n2h_empty_pool_buf_cfg_co
* nss_n2h_empty_paged_pool_buf_cfg_core1_handler()
* Sets the number of empty paged buffer for core 1
*/
-static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -922,7 +922,7 @@ static int nss_n2h_empty_paged_pool_buf_
* nss_n2h_empty_paged_pool_buf_cfg_core0_handler()
* Sets the number of empty paged buffer for core 0
*/
-static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -934,7 +934,7 @@ static int nss_n2h_empty_paged_pool_buf_
* nss_n2h_water_mark_core1_handler()
* Sets water mark for core 1
*/
-static int nss_n2h_water_mark_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_water_mark_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -947,7 +947,7 @@ static int nss_n2h_water_mark_core1_hand
* nss_n2h_water_mark_core0_handler()
* Sets water mark for core 0
*/
-static int nss_n2h_water_mark_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_water_mark_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -960,7 +960,7 @@ static int nss_n2h_water_mark_core0_hand
* nss_n2h_paged_water_mark_core1_handler()
* Sets paged water mark for core 1
*/
-static int nss_n2h_paged_water_mark_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_paged_water_mark_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -973,7 +973,7 @@ static int nss_n2h_paged_water_mark_core
* nss_n2h_paged_water_mark_core0_handler()
* Sets paged water mark for core 0
*/
-static int nss_n2h_paged_water_mark_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_paged_water_mark_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -986,7 +986,7 @@ static int nss_n2h_paged_water_mark_core
* nss_n2h_wifi_payloads_handler()
* Sets number of wifi payloads
*/
-static int nss_n2h_wifi_payloads_handler(struct ctl_table *ctl,
+static int nss_n2h_wifi_payloads_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1281,7 +1281,7 @@ failure:
* nss_mitigation_handler()
* Enable NSS MITIGATION
*/
-static int nss_n2h_mitigationcfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_mitigationcfg_core0_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0];
@@ -1312,7 +1312,7 @@ static int nss_n2h_mitigationcfg_core0_h
* nss_mitigation_handler()
* Enable NSS MITIGATION
*/
-static int nss_n2h_mitigationcfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_mitigationcfg_core1_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1];
@@ -1343,7 +1343,7 @@ static int nss_n2h_mitigationcfg_core1_h
* nss_buf_handler()
* Add extra NSS bufs from host memory
*/
-static int nss_n2h_buf_cfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_buf_cfg_core0_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0];
@@ -1382,7 +1382,7 @@ static int nss_n2h_buf_cfg_core0_handler
* nss_n2h_buf_handler()
* Add extra NSS bufs from host memory
*/
-static int nss_n2h_buf_cfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_buf_cfg_core1_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1];
@@ -1435,7 +1435,7 @@ static void nss_n2h_queue_limit_callback
* nss_n2h_set_queue_limit_sync()
* Sets the n2h queue size limit synchronously.
*/
-static int nss_n2h_set_queue_limit_sync(struct ctl_table *ctl, int write, void __user *buffer,
+static int nss_n2h_set_queue_limit_sync(compat_const struct ctl_table *ctl, int write, void __user *buffer,
size_t *lenp, loff_t *ppos, uint32_t core_id)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -1512,7 +1512,7 @@ static int nss_n2h_set_queue_limit_sync(
* nss_n2h_queue_limit_core0_handler()
* Sets the n2h queue size limit for core0
*/
-static int nss_n2h_queue_limit_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_queue_limit_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1524,7 +1524,7 @@ static int nss_n2h_queue_limit_core0_han
* nss_n2h_queue_limit_core1_handler()
* Sets the n2h queue size limit for core1
*/
-static int nss_n2h_queue_limit_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_queue_limit_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1602,7 +1602,7 @@ static nss_tx_status_t nss_n2h_host_bp_c
* nss_n2h_host_bp_cfg_handler()
* Enable n2h back pressure.
*/
-static int nss_n2h_host_bp_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos, uint32_t core_id)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -1640,7 +1640,7 @@ static int nss_n2h_host_bp_cfg_handler(s
* nss_n2h_host_bp_cfg_core0_handler()
* Enable n2h back pressure in core 0.
*/
-static int nss_n2h_host_bp_cfg_core0_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_core0_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_0);
@@ -1650,7 +1650,7 @@ static int nss_n2h_host_bp_cfg_core0_han
* nss_n2h_host_bp_cfg_core1_handler()
* Enable n2h back pressure in core 1.
*/
-static int nss_n2h_host_bp_cfg_core1_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_core1_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_1);
@@ -1740,9 +1740,7 @@ static struct ctl_table nss_n2h_table_si
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_n2h_get_qos_mem_size_cfg_handler,
- },
-
- { }
+ }
};
static struct ctl_table nss_n2h_table_multi_core[] = {
@@ -1900,8 +1898,7 @@ static struct ctl_table nss_n2h_table_mu
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_n2h_get_qos_mem_size_cfg_handler,
- },
- { }
+ }
};
--- a/nss_ppe_vp.c
+++ b/nss_ppe_vp.c
@@ -215,7 +215,7 @@ static void nss_ppe_vp_callback(void *ap
* Since ath0 has only one type i.e. ath0 is NSS_DYNAMIC_INTERFACE_TYPE_VAP, the above command can be rewritten as
* echo ath0 > /proc/sys/nss/ppe_vp/create => Here 6 can be ignored.
*/
-static nss_if_num_t nss_ppe_vp_parse_vp_cmd(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static nss_if_num_t nss_ppe_vp_parse_vp_cmd(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int32_t if_num;
struct net_device *dev;
@@ -693,7 +693,7 @@ static void nss_ppe_vp_handler(struct ns
* nss_ppe_vp_destroy_handler()
* PPE VP destroy handler.
*/
-static int nss_ppe_vp_destroy_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ppe_vp_destroy_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context();
int32_t if_num;
@@ -730,7 +730,7 @@ static int nss_ppe_vp_destroy_handler(st
* nss_ppe_vp_create_handler()
* PPE VP create handler.
*/
-static int nss_ppe_vp_create_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ppe_vp_create_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int32_t if_num;
struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context();
--- a/nss_pppoe.c
+++ b/nss_pppoe.c
@@ -203,7 +203,7 @@ static void nss_pppoe_handler(struct nss
* nss_pppoe_br_accel_mode_handler()
* Enable/disable pppoe bridge acceleration in NSS
*/
-int nss_pppoe_br_accel_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+int nss_pppoe_br_accel_mode_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context();
struct nss_pppoe_msg npm;
--- a/nss_project.c
+++ b/nss_project.c
@@ -235,7 +235,7 @@ static void nss_project_msg_handler(stru
* Uses proc_dointvec to process data. For a write operation, also sends worker
* thread stats enable messages containing the new value to each NSS core.
*/
-static int nss_project_wt_stats_handler(struct ctl_table *ctl, int write,
+static int nss_project_wt_stats_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -332,8 +332,7 @@ static struct ctl_table nss_project_tabl
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_project_wt_stats_handler,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
--- a/nss_rps.c
+++ b/nss_rps.c
@@ -404,7 +404,7 @@ static nss_tx_status_t nss_rps_pri_map_c
* nss_rps_cfg_handler()
* Enable NSS RPS.
*/
-static int nss_rps_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -455,7 +455,7 @@ static int nss_rps_cfg_handler(struct ct
* nss_rps_hash_bitmap_cfg_handler()
* Configure NSS rps_hash_bitmap
*/
-static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_hash_bitmap_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -518,7 +518,7 @@ static int nss_rps_hash_bitmap_cfg_handl
/* nss_rps_pri_map_cfg_handler()
* Configure NSS rps_pri_map
*/
-static int nss_rps_pri_map_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_pri_map_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -571,8 +571,7 @@ static struct ctl_table nss_rps_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_rps_pri_map_cfg_handler,
- },
- { }
+ }
};
--- a/nss_core.h
+++ b/nss_core.h
@@ -1036,7 +1036,7 @@ extern void nss_stats_clean(void);
*/
extern void nss_log_init(void);
extern bool nss_debug_log_buffer_alloc(uint8_t nss_id, uint32_t nentry);
-extern int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos);
+extern int nss_logbuffer_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos);
/*
* APIs to set jumbo_mru & paged_mode
--- a/nss_dscp_map.h
+++ b/nss_dscp_map.h
@@ -46,7 +46,7 @@ struct nss_dscp_map_parse {
* nss_dscp_map_print()
* Sysctl handler for printing dscp/pri mapping.
*/
-static int nss_dscp_map_print(struct ctl_table *ctl, void *buffer, size_t *lenp,
+static int nss_dscp_map_print(compat_const struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_entry *mapping)
{
char *r_buf;
@@ -115,7 +115,7 @@ static int nss_dscp_map_print(struct ctl
* nss_dscp_map_parse()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_dscp_map_parse(struct ctl_table *ctl, void *buffer, size_t *lenp,
+static int nss_dscp_map_parse(compat_const struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_parse *out)
{
int count;
--- a/nss_n2h_stats.c
+++ b/nss_n2h_stats.c
@@ -46,6 +46,7 @@ static ssize_t nss_n2h_stats_read(struct
size_t size_wr = 0;
ssize_t bytes_read = 0;
uint64_t *stats_shadow;
+ char n2h_tag[7];
char *lbuf = kzalloc(size_al, GFP_KERNEL);
if (unlikely(lbuf == NULL)) {
@@ -69,7 +70,8 @@ static ssize_t nss_n2h_stats_read(struct
stats_shadow[i] = nss_n2h_stats[core][i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr += nss_stats_banner(lbuf, size_wr, size_al, "n2h", core);
+ snprintf(n2h_tag, 7, "N2H %d", core);
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, n2h_tag, NSS_STATS_SINGLE_CORE);
size_wr += nss_stats_print("n2h", NULL, NSS_STATS_SINGLE_INSTANCE
, nss_n2h_strings_stats
, stats_shadow

View File

@ -0,0 +1,33 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -2704,7 +2704,7 @@
if (unlikely(irqs_disabled()))
return false;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
if (unlikely(skb_shinfo(nbuf)->tx_flags & SKBTX_DEV_ZEROCOPY))
return false;
#else
--- a/nss_coredump.c
+++ b/nss_coredump.c
@@ -26,7 +26,7 @@
#include "nss_log.h"
#include <linux/kernel.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
#include <linux/notifier.h> /* for panic_notifier_list */
#else
#include <linux/panic_notifier.h> /* for panic_notifier_list */
--- a/nss_core.h
+++ b/nss_core.h
@@ -125,7 +125,7 @@
#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))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
#define nss_ioremap ioremap_nocache
#else
#define nss_ioremap ioremap