nss-packages: NSS 11.4.0.5 for Linux 6.1

This commit is contained in:
Qosmio 2024-03-05 21:58:19 -05:00
parent 79597046e6
commit d4d3e00692
26 changed files with 2409 additions and 439 deletions

View File

@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-clients.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2023-10-04
PKG_SOURCE_VERSION:=f058ae199b42f30be9925b2ed1ce53afb128200c
PKG_MIRROR_HASH:=90401b577a7750d3b7eadb423700aab7e1da1af392637598e08f6007f23a92e1
PKG_SOURCE_DATE:=2021-08-17
PKG_SOURCE_VERSION:=153998d70fdba508a59a28c13a606032cbf32686
PKG_MIRROR_HASH:=8b0eb211da44c36022ef85fe0bf7c37836333f6ffa6c312117a43e5473dffdf8
PKG_BUILD_PARALLEL:=1

View File

@ -1,11 +0,0 @@
--- a/vxlanmgr/nss_vxlanmgr.c
+++ b/vxlanmgr/nss_vxlanmgr.c
@@ -84,7 +84,7 @@ int32_t nss_vxlanmgr_bind_ipsec_by_ip(un
{
int32_t ipsec_if_num;
nss_vxlanmgr_get_ipsec_if_num_by_ip_callback_t ipsec_cb;
- struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx();
+ __attribute__((unused)) struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx();
/*
* Check if the VxLAN interface is applied over an IPsec interface by querying the IPsec.

View File

@ -1,6 +1,6 @@
--- a/bridge/nss_bridge_mgr.c
+++ b/bridge/nss_bridge_mgr.c
@@ -1081,7 +1081,7 @@ int nss_bridge_mgr_register_br(struct ne
@@ -1045,7 +1045,7 @@ int nss_bridge_mgr_register_br(struct ne
}
#endif
@ -8,8 +8,8 @@
+ err = nss_bridge_tx_set_mac_addr_msg(ifnum, (uint8_t *) dev->dev_addr);
if (err != NSS_TX_SUCCESS) {
nss_bridge_mgr_warn("%px: failed to set mac_addr msg, error = %d\n", b_pvt, err);
goto fail_4;
@@ -1242,7 +1242,7 @@ static int nss_bridge_mgr_changeaddr_eve
goto fail_3;
@@ -1202,7 +1202,7 @@ static int nss_bridge_mgr_changeaddr_eve
nss_bridge_mgr_trace("%px: MAC changed to %pM, update NSS\n", b_pvt, dev->dev_addr);
@ -104,7 +104,7 @@
retval = READ_ONCE(act->tcf_action);
--- a/nss_qdisc/nss_qdisc.h
+++ b/nss_qdisc/nss_qdisc.h
@@ -217,7 +217,7 @@ struct nss_qdisc {
@@ -188,7 +188,7 @@ struct nss_qdisc {
/* Shaper configure callback for reading shaper specific
* responses (e.g. memory size).
*/
@ -113,7 +113,7 @@
struct gnet_stats_queue qstats; /* Qstats for use by classes */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0))
atomic_t refcnt; /* Reference count for class use */
@@ -464,7 +464,7 @@ extern int nss_qdisc_init(struct Qdisc *
@@ -445,7 +445,7 @@ extern void nss_qdisc_stop_basic_stats_p
* Wrapper around gnet_stats_copy_basic()
*/
extern int nss_qdisc_gnet_stats_copy_basic(struct Qdisc *sch,
@ -139,7 +139,15 @@
--- a/nss_qdisc/nss_qdisc.c
+++ b/nss_qdisc/nss_qdisc.c
@@ -2189,7 +2189,7 @@ int __nss_qdisc_init(struct Qdisc *sch,
@@ -14,6 +14,7 @@
**************************************************************************
*/
+#include "net/gen_stats.h"
#include <nss_api_if.h>
#include "nss_qdisc.h"
#include "nss_fifo.h"
@@ -2173,7 +2174,7 @@ int __nss_qdisc_init(struct Qdisc *sch,
* This is to prevent mixing NSS and PPE qdisc with linux qdisc.
*/
if ((parent != TC_H_ROOT) && (root->ops->owner != THIS_MODULE)) {
@ -148,7 +156,27 @@
" or the interface is currently down", nq->qdisc, nq->type);
}
@@ -2606,12 +2606,14 @@ int nss_qdisc_init(struct Qdisc *sch, st
@@ -2562,7 +2563,7 @@ static void nss_qdisc_basic_stats_callba
{
struct nss_qdisc *nq = (struct nss_qdisc *)app_data;
struct Qdisc *qdisc = nq->qdisc;
- struct gnet_stats_basic_packed *bstats;
+ struct gnet_stats_basic_sync *bstats;
struct gnet_stats_queue *qstats;
struct nss_shaper_node_stats_response *response;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0))
@@ -2601,8 +2602,8 @@ static void nss_qdisc_basic_stats_callba
* Update qdisc->bstats
*/
spin_lock_bh(&nq->lock);
- bstats->bytes += (__u64)response->sn_stats.delta.dequeued_bytes;
- bstats->packets += response->sn_stats.delta.dequeued_packets;
+ u64_stats_add(&bstats->bytes, (__u64)response->sn_stats.delta.dequeued_bytes);
+ u64_stats_add(&bstats->packets, response->sn_stats.delta.dequeued_packets);
/*
* Update qdisc->qstats
@@ -2762,12 +2763,14 @@ void nss_qdisc_stop_basic_stats_polling(
* Wrapper around gnet_stats_copy_basic()
*/
int nss_qdisc_gnet_stats_copy_basic(struct Qdisc *sch, struct gnet_dump *d,
@ -164,31 +192,26 @@
#else
return gnet_stats_copy_basic(qdisc_root_sleeping_running(sch), d, NULL, b);
#endif
--- a/nss_qdisc/nss_qdisc_stats.c
+++ b/nss_qdisc/nss_qdisc_stats.c
@@ -160,7 +160,7 @@ static void nss_qdisc_stats_process_node
{
struct Qdisc *qdisc;
struct nss_qdisc *nq;
- struct gnet_stats_basic_packed *bstats;
+ struct gnet_stats_basic_sync *bstats;
struct gnet_stats_queue *qstats;
uint32_t qos_tag = response->qos_tag;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0))
@@ -214,8 +214,8 @@ static void nss_qdisc_stats_process_node
* Update qdisc->bstats
*/
spin_lock_bh(&nq->lock);
- bstats->bytes += (__u64)response->sn_stats.delta.dequeued_bytes;
- bstats->packets += response->sn_stats.delta.dequeued_packets;
+ u64_stats_add(&bstats->bytes, (__u64)response->sn_stats.delta.dequeued_bytes);
+ u64_stats_add(&bstats->packets, response->sn_stats.delta.dequeued_packets);
@@ -2798,7 +2801,6 @@ static int nss_qdisc_if_event_cb(struct
struct net_device *br;
struct Qdisc *br_qdisc;
int if_num, br_num;
- struct nss_qdisc *nq;
/*
* Update qdisc->qstats
dev = nss_qdisc_get_dev(ptr);
if (!dev) {
@@ -2841,8 +2843,6 @@ static int nss_qdisc_if_event_cb(struct
break;
}
- nq = (struct nss_qdisc *)qdisc_priv(br_qdisc);
-
/*
* Call attach or detach according as per event type.
*/
--- a/vlan/nss_vlan_mgr.c
+++ b/vlan/nss_vlan_mgr.c
@@ -787,7 +787,7 @@ static struct nss_vlan_pvt *nss_vlan_mgr
@@ -808,7 +808,7 @@ static struct nss_vlan_pvt *nss_vlan_mgr
}
v->mtu = dev->mtu;
@ -197,7 +220,7 @@
v->ifindex = dev->ifindex;
v->refs = 1;
@@ -936,14 +936,14 @@ static int nss_vlan_mgr_changeaddr_event
@@ -956,14 +956,14 @@ static int nss_vlan_mgr_changeaddr_event
}
spin_unlock(&vlan_mgr_ctx.lock);
@ -216,7 +239,7 @@
nss_vlan_mgr_instance_deref(v_pvt);
--- a/vxlanmgr/nss_vxlanmgr_tunnel.c
+++ b/vxlanmgr/nss_vxlanmgr_tunnel.c
@@ -489,8 +489,8 @@ static void nss_vxlanmgr_tunnel_inner_st
@@ -465,8 +465,8 @@ static void nss_vxlanmgr_tunnel_inner_st
tstats = this_cpu_ptr(dev->tstats);
u64_stats_update_begin(&tstats->syncp);
@ -226,8 +249,8 @@
+ u64_stats_add(&tstats->tx_bytes, stats->node_stats.tx_bytes);
u64_stats_update_end(&tstats->syncp);
netdev_stats->tx_dropped += dropped;
}
@@ -526,8 +526,8 @@ static void nss_vxlanmgr_tunnel_outer_st
dev_put(dev);
@@ -503,8 +503,8 @@ static void nss_vxlanmgr_tunnel_outer_st
tstats = this_cpu_ptr(dev->tstats);
u64_stats_update_begin(&tstats->syncp);
@ -258,17 +281,6 @@
memset(dev->broadcast, 0xff, dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
}
--- a/clmapmgr/nss_clmapmgr.c
+++ b/clmapmgr/nss_clmapmgr.c
@@ -103,7 +103,7 @@ static struct rtnl_link_stats64 *nss_clm
* Netdev seems to be incrementing rx_dropped because we don't give IP header.
* So reset it as it's of no use for us.
*/
- atomic_long_set(&dev->rx_dropped, 0);
+ atomic_long_set(&(dev)->stats.__rx_dropped, 0);
priv = netdev_priv(dev);
memset(stats, 0, sizeof(struct rtnl_link_stats64));
memcpy(stats, &priv->stats, sizeof(struct rtnl_link_stats64));
--- a/tls/nss_tlsmgr_tun.c
+++ b/tls/nss_tlsmgr_tun.c
@@ -185,7 +185,7 @@ static void nss_tlsmgr_tun_setup(struct

View File

@ -1,8 +1,6 @@
diff --git a/wifi_meshmgr/nss_wifi_meshmgr.c b/wifi_meshmgr/nss_wifi_meshmgr.c
index 498ed35..c8002c8 100644
--- a/wifi_meshmgr/nss_wifi_meshmgr.c
+++ b/wifi_meshmgr/nss_wifi_meshmgr.c
@@ -49,7 +49,7 @@ static bool nss_wifi_meshmgr_verify_if_num(int32_t if_num, enum nss_dynamic_inte
@@ -49,7 +49,7 @@ static bool nss_wifi_meshmgr_verify_if_n
*/
static nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_msg(struct nss_wifi_mesh_msg *msg)
{
@ -11,7 +9,7 @@ index 498ed35..c8002c8 100644
}
/*
@@ -126,7 +126,7 @@ static void nss_wifi_meshmgr_cleanup(struct nss_wifi_meshmgr_mesh_ctx *wmesh_ctx
@@ -126,7 +126,7 @@ static void nss_wifi_meshmgr_cleanup(str
* Unregister and dealloc decap DI.
*/
nss_unregister_wifi_mesh_if(decap_ifnum);
@ -20,7 +18,7 @@ index 498ed35..c8002c8 100644
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
nss_wifi_meshmgr_warn("%px: Failed to dealloc decap: %d\n", &wmgr_ctx, nss_status);
}
@@ -135,7 +135,7 @@ static void nss_wifi_meshmgr_cleanup(struct nss_wifi_meshmgr_mesh_ctx *wmesh_ctx
@@ -135,7 +135,7 @@ static void nss_wifi_meshmgr_cleanup(str
* Unregister and dealloc encap DI.
*/
nss_unregister_wifi_mesh_if(encap_ifnum);
@ -29,7 +27,7 @@ index 498ed35..c8002c8 100644
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
nss_wifi_meshmgr_warn("%px: Failed to dealloc encap: %d\n", &wmgr_ctx, nss_status);
}
@@ -257,10 +257,10 @@ static void nss_wifi_meshmgr_tx_msg_cb(void *app_data, struct nss_cmn_msg *ncm)
@@ -249,10 +249,10 @@ static void nss_wifi_meshmgr_tx_msg_cb(v
/*
* FIXME: The wmesh_ctx can be invalid if the memory goes away with the caller being timedout.
*/
@ -42,7 +40,7 @@ index 498ed35..c8002c8 100644
}
complete(&wmesh_ctx->complete);
@@ -289,10 +289,10 @@ static nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_msg_sync(struct nss_wifi_me
@@ -281,10 +281,10 @@ static nss_wifi_meshmgr_status_t nss_wif
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -55,7 +53,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
return status;
}
@@ -324,7 +324,7 @@ nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_buf(nss_wifi_mesh_handle_t mesh_ha
@@ -316,7 +316,7 @@ nss_wifi_meshmgr_status_t nss_wifi_meshm
return NSS_WIFI_MESHMGR_FAILURE;
}
@ -64,7 +62,7 @@ index 498ed35..c8002c8 100644
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
return nss_status;
}
@@ -548,10 +548,10 @@ nss_wifi_meshmgr_dump_mesh_path_sync(nss_wifi_mesh_handle_t mesh_handle)
@@ -540,10 +540,10 @@ nss_wifi_meshmgr_dump_mesh_path_sync(nss
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -77,7 +75,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -643,10 +643,10 @@ nss_wifi_meshmgr_dump_mesh_proxy_path_sync(nss_wifi_mesh_handle_t mesh_handle)
@@ -635,10 +635,10 @@ nss_wifi_meshmgr_dump_mesh_proxy_path_sy
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -90,7 +88,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -715,7 +715,7 @@ nss_wifi_meshmgr_assoc_link_vap(nss_wifi_mesh_handle_t mesh_handle, struct nss_w
@@ -707,7 +707,7 @@ nss_wifi_meshmgr_assoc_link_vap(nss_wifi
/*
* Send the link vap mesage to the NSS synchronously.
*/
@ -99,7 +97,7 @@ index 498ed35..c8002c8 100644
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
nss_wifi_meshmgr_warn("%px: Mesh link vap association failed: %d.\n", &wmgr_ctx, nss_status);
}
@@ -761,10 +761,10 @@ nss_wifi_meshmgr_assoc_link_vap_sync(nss_wifi_mesh_handle_t mesh_handle, struct
@@ -753,10 +753,10 @@ nss_wifi_meshmgr_assoc_link_vap_sync(nss
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -112,7 +110,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -886,10 +886,10 @@ nss_wifi_meshmgr_mesh_config_update_sync(nss_wifi_mesh_handle_t mesh_handle, str
@@ -878,10 +878,10 @@ nss_wifi_meshmgr_mesh_config_update_sync
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -125,7 +123,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -985,10 +985,10 @@ nss_wifi_meshmgr_mesh_proxy_path_delete_sync(nss_wifi_mesh_handle_t mesh_handle,
@@ -977,10 +977,10 @@ nss_wifi_meshmgr_mesh_proxy_path_delete_
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -138,7 +136,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1084,10 +1084,10 @@ nss_wifi_meshmgr_mesh_proxy_path_update_sync(nss_wifi_mesh_handle_t mesh_handle,
@@ -1076,10 +1076,10 @@ nss_wifi_meshmgr_mesh_proxy_path_update_
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -151,7 +149,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1183,10 +1183,10 @@ nss_wifi_meshmgr_mesh_proxy_path_add_sync(nss_wifi_mesh_handle_t mesh_handle, st
@@ -1175,10 +1175,10 @@ nss_wifi_meshmgr_mesh_proxy_path_add_syn
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -164,7 +162,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1282,10 +1282,10 @@ nss_wifi_meshmgr_mesh_path_delete_sync(nss_wifi_mesh_handle_t mesh_handle, struc
@@ -1274,10 +1274,10 @@ nss_wifi_meshmgr_mesh_path_delete_sync(n
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -177,7 +175,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1381,10 +1381,10 @@ nss_wifi_meshmgr_mesh_path_add_sync(nss_wifi_mesh_handle_t mesh_handle, struct n
@@ -1373,10 +1373,10 @@ nss_wifi_meshmgr_mesh_path_add_sync(nss_
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -190,7 +188,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
return nss_status;
@@ -1479,10 +1479,10 @@ nss_wifi_meshmgr_mesh_path_update_sync(nss_wifi_mesh_handle_t mesh_handle, struc
@@ -1471,10 +1471,10 @@ nss_wifi_meshmgr_mesh_path_update_sync(n
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -203,7 +201,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1578,10 +1578,10 @@ nss_wifi_meshmgr_mesh_path_exception_sync(nss_wifi_mesh_handle_t mesh_handle,str
@@ -1570,10 +1570,10 @@ nss_wifi_meshmgr_mesh_path_exception_syn
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
@ -216,20 +214,7 @@ index 498ed35..c8002c8 100644
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1702,10 +1702,10 @@ nss_wifi_meshmgr_config_mesh_exception_sync(nss_wifi_mesh_handle_t mesh_handle,s
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
if (!ret) {
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
}
- nss_status = wmesh_ctx->response;
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
up(&wmesh_ctx->sem);
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
@@ -1795,7 +1795,7 @@ nss_wifi_mesh_handle_t nss_wifi_meshmgr_if_create_sync(struct net_device *dev, s
@@ -1663,7 +1663,7 @@ nss_wifi_mesh_handle_t nss_wifi_meshmgr_
int32_t encap_ifnum, decap_ifnum;
uint32_t features = 0;
nss_wifi_mesh_handle_t mesh_handle;

View File

@ -1,6 +1,6 @@
--- a/capwapmgr/nss_capwapmgr.c
+++ b/capwapmgr/nss_capwapmgr.c
@@ -334,7 +334,7 @@ static struct rtnl_link_stats64 *nss_cap
@@ -331,7 +331,7 @@ static struct rtnl_link_stats64 *nss_cap
* Netdev seems to be incrementing rx_dropped because we don't give IP header.
* So reset it as it's of no use for us.
*/
@ -9,7 +9,7 @@
memset(stats, 0, sizeof (struct rtnl_link_stats64));
nss_capwapmgr_fill_up_stats(stats, &global.tunneld);
@@ -379,7 +379,6 @@ static const struct net_device_ops nss_c
@@ -376,7 +376,6 @@ static const struct net_device_ops nss_c
.ndo_stop = nss_capwapmgr_close,
.ndo_start_xmit = nss_capwapmgr_start_xmit,
.ndo_set_mac_address = eth_mac_addr,
@ -17,7 +17,7 @@
.ndo_get_stats64 = nss_capwapmgr_dev_tunnel_stats,
};
@@ -403,7 +402,7 @@ static void nss_capwapmgr_dummpy_netdev_
@@ -400,7 +399,7 @@ static void nss_capwapmgr_dummpy_netdev_
#else
dev->priv_destructor = NULL;
#endif
@ -26,7 +26,7 @@
memset(dev->broadcast, 0xff, dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
}
@@ -572,7 +571,7 @@ static struct nss_capwapmgr_tunnel *nss_
@@ -569,7 +568,7 @@ static struct nss_capwapmgr_tunnel *nss_
* nss_capwapmgr_netdev_create()
* API to create a CAPWAP netdev
*/
@ -35,7 +35,7 @@
{
struct nss_capwapmgr_priv *priv;
struct nss_capwapmgr_response *r;
@@ -1179,7 +1178,7 @@ static nss_capwapmgr_status_t nss_capwap
@@ -1168,7 +1167,7 @@ static nss_capwapmgr_status_t nss_capwap
/*
* Call NSS driver
*/
@ -44,7 +44,7 @@
if (status != NSS_CAPWAPMGR_SUCCESS) {
up(&r->sem);
dev_put(dev);
@@ -1220,7 +1219,7 @@ static nss_capwapmgr_status_t nss_capwap
@@ -1209,7 +1208,7 @@ static nss_capwapmgr_status_t nss_capwap
struct nss_ctx_instance *ctx = nss_capwap_get_ctx();
struct nss_capwap_msg capwapmsg;
struct nss_capwap_rule_msg *capwapcfg;
@ -53,7 +53,7 @@
nss_capwapmgr_info("%px: ctx: CAPWAP Rule src_port: 0x%d dest_port:0x%d\n", ctx,
ntohl(msg->encap.src_port), ntohl(msg->encap.dest_port));
@@ -1285,7 +1284,7 @@ static nss_capwapmgr_status_t nss_capwap
@@ -1274,7 +1273,7 @@ static nss_capwapmgr_status_t nss_capwap
nss_capwapmgr_msg_event_receive, dev);
status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
@ -62,7 +62,7 @@
nss_capwapmgr_warn("%px: ctx: create encap data tunnel error %d \n", ctx, status);
return status;
}
@@ -1297,10 +1296,10 @@ static nss_capwapmgr_status_t nss_capwap
@@ -1286,10 +1285,10 @@ static nss_capwapmgr_status_t nss_capwap
* nss_capwapmgr_tx_msg_enable_tunnel()
* Common function to send CAPWAP tunnel enable msg
*/
@ -75,7 +75,7 @@
/*
* Prepare the tunnel configuration parameter to send to NSS FW
@@ -1314,7 +1313,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
@@ -1303,7 +1302,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
nss_capwap_msg_init(&capwapmsg, if_num, NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, sizeof(struct nss_capwap_enable_tunnel_msg), nss_capwapmgr_msg_event_receive, dev);
status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
@ -84,7 +84,7 @@
nss_capwapmgr_warn("%px: ctx: CMD: %d Tunnel error : %d \n", ctx, NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, status);
}
@@ -1326,7 +1325,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
@@ -1315,7 +1314,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
* Common function for CAPWAP tunnel operation messages without
* any message data structures.
*/
@ -93,7 +93,7 @@
{
struct nss_capwap_msg capwapmsg;
nss_tx_status_t status;
@@ -1341,12 +1340,12 @@ static nss_tx_status_t nss_capwapmgr_tun
@@ -1330,12 +1329,12 @@ static nss_tx_status_t nss_capwapmgr_tun
*/
nss_capwap_msg_init(&capwapmsg, if_num, cmd, 0, nss_capwapmgr_msg_event_receive, dev);
@ -108,7 +108,7 @@
}
/*
@@ -1471,7 +1470,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_path_
@@ -1460,7 +1459,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_path_
*/
nss_capwapmgr_status_t nss_capwapmgr_update_dest_mac_addr(struct net_device *dev, uint8_t tunnel_id, uint8_t *mac_addr)
{
@ -116,7 +116,7 @@
struct nss_capwapmgr_tunnel *t;
nss_tx_status_t nss_status;
nss_capwapmgr_status_t status = NSS_CAPWAPMGR_SUCCESS;
@@ -1487,7 +1485,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
@@ -1476,7 +1474,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
}
@ -124,7 +124,7 @@
nss_capwapmgr_info("%px: %d: tunnel update mac Addr is being called\n", dev, tunnel_id);
/*
@@ -1534,7 +1531,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_dest_
@@ -1523,7 +1520,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_dest_
*/
nss_capwapmgr_status_t nss_capwapmgr_update_src_interface(struct net_device *dev, uint8_t tunnel_id, uint32_t src_interface_num)
{
@ -132,7 +132,7 @@
struct nss_capwapmgr_tunnel *t;
nss_tx_status_t nss_status;
uint32_t outer_trustsec_enabled, dtls_enabled, forward_if_num, src_interface_num_temp;
@@ -1548,7 +1544,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
@@ -1537,7 +1533,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
}
@ -140,7 +140,7 @@
nss_capwapmgr_info("%px: %d: tunnel update source interface is being called\n", dev, tunnel_id);
outer_trustsec_enabled = t->capwap_rule.enabled_features & NSS_CAPWAPMGR_FEATURE_OUTER_TRUSTSEC_ENABLED;
dtls_enabled = t->capwap_rule.enabled_features & NSS_CAPWAPMGR_FEATURE_DTLS_ENABLED;
@@ -1587,7 +1582,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
@@ -1576,7 +1571,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
/*
* Destroy the IP rule only if it already exist.
*/
@ -149,7 +149,7 @@
struct nss_ipv4_destroy v4_destroy;
v4_destroy.protocol = IPPROTO_UDP;
v4_destroy.src_ip = t->ip_rule.v4.src_ip;
@@ -1617,7 +1612,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
@@ -1606,7 +1601,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
/*
* Destroy the IP rule only if it already exist.
*/
@ -158,7 +158,7 @@
struct nss_ipv6_destroy v6_destroy;
if (t->capwap_rule.which_udp == NSS_CAPWAP_TUNNEL_UDP) {
@@ -1761,7 +1756,7 @@ nss_capwapmgr_status_t nss_capwapmgr_dsc
@@ -1750,7 +1745,7 @@ nss_capwapmgr_status_t nss_capwapmgr_dsc
uint8_t rule_nr = NSS_CAPWAPMGR_RULE_NR;
uint8_t list_id, v4_rule_id, v6_rule_id;
uint8_t lid, rid, i, j;

View File

@ -1,6 +1,6 @@
--- a/netlink/Makefile
+++ b/netlink/Makefile
@@ -27,7 +27,6 @@ ccflags-y += -DCONFIG_NSS_NLPPTP=1
@@ -26,7 +26,6 @@ ccflags-y += -DCONFIG_NSS_NLPPTP=1
ccflags-y += -DCONFIG_NSS_NLCAPWAP=${CAPWAP_ENABLED}
ccflags-y += -DCONFIG_NSS_NLIPSEC=${IPSEC_ENABLED}
ccflags-y += -DCONFIG_NSS_NLDTLS=${DTLS_ENABLED}
@ -8,15 +8,15 @@
qca-nss-netlink-objs := nss_nl.o
qca-nss-netlink-objs += nss_nlgre_redir_family.o
@@ -49,7 +48,6 @@ qca-nss-netlink-objs += nss_nlmap_t.o
@@ -48,7 +47,6 @@ qca-nss-netlink-objs += nss_nlmap_t.o
qca-nss-netlink-objs += nss_nlpppoe.o
qca-nss-netlink-objs += nss_nll2tpv2.o
qca-nss-netlink-objs += nss_nlpptp.o
-qca-nss-netlink-objs += nss_nludp_st.o
qca-nss-netlink-objs += nss_nlqrfs.o
ifneq (,$(filter $(capwapmgr), y))
@@ -81,4 +79,11 @@ else
qca-nss-netlink-objs += nss_nlcapwap.o
@@ -79,4 +77,11 @@ else
ccflags-y += -DCONFIG_NSS_NLEDMA=0
endif

View File

@ -0,0 +1,42 @@
--- a/pvxlanmgr/nss_pvxlanmgr.c
+++ b/pvxlanmgr/nss_pvxlanmgr.c
@@ -18,6 +18,7 @@
* nss_pvxlanmgr.c
* NSS to HLOS Pvxlan manager
*/
+#include "nss_pvxlanmgr.h"
#include "nss_pvxlanmgr_priv.h"
/*
@@ -431,19 +432,19 @@ EXPORT_SYMBOL(nss_pvxlanmgr_netdev_disab
nss_pvxlanmgr_status_t nss_pvxlanmgr_netdev_enable(struct net_device *dev)
{
struct nss_pvxlanmgr_priv *priv;
- nss_tx_status_t ret;
+ nss_pvxlanmgr_status_t ret;
dev_hold(dev);
priv = netdev_priv(dev);
nss_pvxlanmgr_info("%px: tunnel enable is being called\n", dev);
- ret = nss_pvxlanmgr_tunnel_tx_msg_enable(priv->pvxlan_ctx, priv->if_num_host_inner, priv->if_num_outer);
+ ret = (nss_pvxlanmgr_status_t)nss_pvxlanmgr_tunnel_tx_msg_enable(priv->pvxlan_ctx, priv->if_num_host_inner, priv->if_num_outer);
if (ret != NSS_TX_SUCCESS) {
nss_pvxlanmgr_warn("%px: Tunnel enable failed: %d\n", dev, ret);
dev_put(dev);
return ret;
}
- ret = nss_pvxlanmgr_tunnel_tx_msg_enable(priv->pvxlan_ctx, priv->if_num_outer, priv->if_num_host_inner);
+ ret = (nss_pvxlanmgr_status_t)nss_pvxlanmgr_tunnel_tx_msg_enable(priv->pvxlan_ctx, priv->if_num_outer, priv->if_num_host_inner);
if (ret != NSS_TX_SUCCESS) {
nss_pvxlanmgr_warn("%px: Tunnel enable failed: %d\n", dev, ret);
nss_pvxlanmgr_tunnel_tx_msg_disable(priv->pvxlan_ctx, priv->if_num_host_inner);
@@ -524,7 +525,7 @@ EXPORT_SYMBOL(nss_pvxlanmgr_netdev_destr
* nss_pvxlanmgr_netdev_create()
* API to create a Pvxlan netdev
*/
-struct net_device *nss_pvxlanmgr_netdev_create()
+struct net_device *nss_pvxlanmgr_netdev_create(void)
{
struct nss_pvxlanmgr_priv *priv;
struct net_device *dev;

View File

@ -0,0 +1,330 @@
--- a/nss_qdisc/nss_bf.c
+++ b/nss_qdisc/nss_bf.c
@@ -331,10 +331,19 @@ static int nss_bf_delete_class(struct Qd
qdisc_class_hash_remove(&q->clhash, &cl->cl_common);
refcnt = nss_qdisc_atomic_sub_return(&cl->nq);
sch_tree_unlock(sch);
+
+ /*
+ * For 5.4 and above kernels, calling nss_htb_destroy_class
+ * explicitly as there is no put_class which would have called
+ * nss_bf_destroy_class when refcnt becomes zero.
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ nss_bf_destroy_class(sch, cl);
+#else
if (!refcnt) {
nss_qdisc_error("Reference count should not be zero for class %px\n", cl);
}
-
+#endif
return 0;
}
@@ -634,6 +643,11 @@ static int nss_bf_change_qdisc(struct Qd
*/
static void nss_bf_reset_class(struct nss_bf_class_data *cl)
{
+ if (cl->qdisc == &noop_qdisc) {
+ nss_qdisc_trace("Class %x has no child qdisc to reset\n", cl->nq.qos_tag);
+ return;
+ }
+
nss_qdisc_reset(cl->qdisc);
nss_qdisc_info("Nssbf class resetted %px\n", cl->qdisc);
}
--- a/nss_qdisc/nss_htb.c
+++ b/nss_qdisc/nss_htb.c
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2014-2017, 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017, 2019-2021, The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
@@ -574,10 +574,16 @@ static int nss_htb_delete_class(struct Q
/*
* If we are root class, we dont have to update our parent.
* We simply deduct refcnt and return.
+ * For 5.4 and above kernels, calling nss_htb_destroy_class
+ * explicitly as there is no put_class which would have called
+ * nss_htb_destroy_class when refcnt becomes zero.
*/
if (!cl->parent) {
refcnt = nss_qdisc_atomic_sub_return(&cl->nq);
sch_tree_unlock(sch);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ nss_htb_destroy_class(sch, cl);
+#endif
return 0;
}
@@ -596,6 +602,14 @@ static int nss_htb_delete_class(struct Q
refcnt = nss_qdisc_atomic_sub_return(&cl->nq);
sch_tree_unlock(sch);
+ /*
+ * For 5.4 and above kernels, calling nss_htb_destroy_class
+ * explicitly as there is no put_class which would have called
+ * nss_htb_destroy_class when refcnt becomes zero.
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ nss_htb_destroy_class(sch, cl);
+#endif
return 0;
}
@@ -898,6 +912,11 @@ static int nss_htb_change_qdisc(struct Q
*/
static void nss_htb_reset_class(struct nss_htb_class_data *cl)
{
+ if (cl->qdisc == &noop_qdisc) {
+ nss_qdisc_trace("Class %x has no child qdisc to reset\n", cl->nq.qos_tag);
+ return;
+ }
+
nss_qdisc_reset(cl->qdisc);
nss_qdisc_trace("htb class %x reset\n", cl->nq.qos_tag);
}
--- a/nss_qdisc/nss_qdisc.c
+++ b/nss_qdisc/nss_qdisc.c
@@ -30,9 +30,6 @@
void *nss_qdisc_ctx; /* Shaping context for nss_qdisc */
-#define NSS_QDISC_COMMAND_TIMEOUT (10*HZ) /* We set 10sec to be the command */
- /* timeout value for messages */
-
/*
* Defines related to root hash maintenance
*/
@@ -40,6 +37,53 @@ void *nss_qdisc_ctx; /* Shaping contex
#define NSS_QDISC_ROOT_HASH_MASK (NSS_QDISC_ROOT_HASH_SIZE - 1)
/*
+ * nss_qdisc_get_interface_msg()
+ * Returns the correct message that needs to be sent down to the NSS interface.
+ */
+int nss_qdisc_get_interface_msg(bool is_bridge, uint32_t msg_type)
+{
+ /*
+ * We re-assign the message based on whether this is for the I shaper
+ * or the B shaper. The is_bridge flag tells if we are on a bridge interface.
+ */
+ if (is_bridge) {
+ switch (msg_type) {
+ case NSS_QDISC_IF_SHAPER_ASSIGN:
+ return NSS_IF_BSHAPER_ASSIGN;
+ case NSS_QDISC_IF_SHAPER_UNASSIGN:
+ return NSS_IF_BSHAPER_UNASSIGN;
+ case NSS_QDISC_IF_SHAPER_CONFIG:
+ return NSS_IF_BSHAPER_CONFIG;
+ default:
+ nss_qdisc_info("Unknown message type for a bridge - type %d", msg_type);
+ return -1;
+ }
+ } else {
+ switch (msg_type) {
+ case NSS_QDISC_IF_SHAPER_ASSIGN:
+ return NSS_IF_ISHAPER_ASSIGN;
+ case NSS_QDISC_IF_SHAPER_UNASSIGN:
+ return NSS_IF_ISHAPER_UNASSIGN;
+ case NSS_QDISC_IF_SHAPER_CONFIG:
+ return NSS_IF_ISHAPER_CONFIG;
+ default:
+ nss_qdisc_info("Unknown message type for an interface - type %d", msg_type);
+ return -1;
+ }
+ }
+}
+
+/*
+ * nss_qdisc_msg_init()
+ * Initialize the qdisc specific message
+ */
+void nss_qdisc_msg_init(struct nss_if_msg *nim, uint16_t if_num, uint32_t msg_type, uint32_t len,
+ nss_if_msg_callback_t cb, void *app_data)
+{
+ nss_cmn_msg_init(&nim->cm, if_num, msg_type, len, (void *)cb, app_data);
+}
+
+/*
* nss_qdisc_interface_is_virtual()
* Return true if it is redirect or bridge interface.
*/
@@ -122,53 +166,6 @@ static int nss_qdisc_ppe_init(struct Qdi
#endif
/*
- * nss_qdisc_msg_init()
- * Initialize the qdisc specific message
- */
-static void nss_qdisc_msg_init(struct nss_if_msg *nim, uint16_t if_num, uint32_t msg_type, uint32_t len,
- nss_if_msg_callback_t cb, void *app_data)
-{
- nss_cmn_msg_init(&nim->cm, if_num, msg_type, len, (void*)cb, app_data);
-}
-
-/*
- * nss_qdisc_get_interface_msg()
- * Returns the correct message that needs to be sent down to the NSS interface.
- */
-static inline int nss_qdisc_get_interface_msg(bool is_bridge, uint32_t msg_type)
-{
- /*
- * We re-assign the message based on whether this is for the I shaper
- * or the B shaper. The is_bridge flag tells if we are on a bridge interface.
- */
- if (is_bridge) {
- switch(msg_type) {
- case NSS_QDISC_IF_SHAPER_ASSIGN:
- return NSS_IF_BSHAPER_ASSIGN;
- case NSS_QDISC_IF_SHAPER_UNASSIGN:
- return NSS_IF_BSHAPER_UNASSIGN;
- case NSS_QDISC_IF_SHAPER_CONFIG:
- return NSS_IF_BSHAPER_CONFIG;
- default:
- nss_qdisc_info("Unknown message type for a bridge - type %d", msg_type);
- return -1;
- }
- } else {
- switch(msg_type) {
- case NSS_QDISC_IF_SHAPER_ASSIGN:
- return NSS_IF_ISHAPER_ASSIGN;
- case NSS_QDISC_IF_SHAPER_UNASSIGN:
- return NSS_IF_ISHAPER_UNASSIGN;
- case NSS_QDISC_IF_SHAPER_CONFIG:
- return NSS_IF_ISHAPER_CONFIG;
- default:
- nss_qdisc_info("Unknown message type for an interface - type %d", msg_type);
- return -1;
- }
- }
-}
-
-/*
* nss_qdisc_attach_bshaper_callback()
* Call back funtion for bridge shaper attach to an interface.
*/
@@ -613,7 +610,6 @@ static void nss_qdisc_root_cleanup_free_
nss_qdisc_info("Root qdisc %px (type %d) free SUCCESS - response "
"type: %d\n", nq->qdisc, nq->type,
nim->msg.shaper_configure.config.response_type);
-
nss_qdisc_root_cleanup_shaper_unassign(nq);
}
@@ -1168,8 +1164,15 @@ unsigned int nss_qdisc_drop(struct Qdisc
*/
void nss_qdisc_reset(struct Qdisc *sch)
{
- struct nss_qdisc *nq = qdisc_priv(sch);
+ struct nss_qdisc *nq;
+ if(!(sch->flags & TCQ_F_NSS)) {
+ qdisc_reset_queue(sch);
+ nss_qdisc_info("Qdisc %px resetting non NSS qdisc\n", sch);
+ return;
+ }
+
+ nq = qdisc_priv(sch);
nss_qdisc_info("Qdisc %px (type %d) resetting\n",
sch, nq->type);
@@ -1891,6 +1894,7 @@ int nss_qdisc_configure(struct nss_qdisc
return 0;
}
+
/*
* nss_qdisc_register_configure_callback()
* Register shaper configure callback, which gets invoked on receiving a response.
@@ -2117,6 +2121,8 @@ int __nss_qdisc_init(struct Qdisc *sch,
*/
if ((sch->parent == TC_H_ROOT) && (!nq->is_class)) {
nss_qdisc_info("Qdisc %px (type %d) is root\n", nq->qdisc, nq->type);
+ nss_qdisc_info("Qdisc %px dev-name %s qdisc_dev(sch)->qdisc %px, qdisc_dev(sch)->qdisc->handle %x\n", qdisc_dev(sch), qdisc_dev(sch)->name, qdisc_dev(sch)->qdisc, qdisc_dev(sch)->qdisc->handle);
+ nss_qdisc_info("Qdisc %px (sch %px) is root, sch->handle %x\n", nq->qdisc, sch, sch->handle);
nq->is_root = true;
root = sch;
} else {
--- a/nss_qdisc/nss_qdisc.h
+++ b/nss_qdisc/nss_qdisc.h
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2014-2018, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018, 2020-2021 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
@@ -41,6 +41,9 @@
#define NSS_QDISC_DEBUG_LEVEL_INFO 3
#define NSS_QDISC_DEBUG_LEVEL_TRACE 4
+#define NSS_QDISC_COMMAND_TIMEOUT (10*HZ) /* We set 10sec to be the command */
+ /* timeout value for messages */
+
/*
* Debug message for module init and exit
*/
@@ -486,3 +489,15 @@ extern unsigned long nss_qdisc_tcf_bind(
* Unbind the filter from the qdisc.
*/
extern void nss_qdisc_tcf_unbind(struct Qdisc *sch, unsigned long arg);
+
+/*
+ * nss_qdisc_get_interface_msg()
+ * Returns the correct message that needs to be sent down to the NSS interface.
+ */
+extern int nss_qdisc_get_interface_msg(bool is_bridge, uint32_t msg_type);
+
+/*
+ * nss_qdisc_msg_init()
+ * Initialize the qdisc specific message
+ */
+extern void nss_qdisc_msg_init(struct nss_if_msg *nim, uint16_t if_num, uint32_t msg_type, uint32_t len, nss_if_msg_callback_t cb, void *app_data);
--- a/nss_qdisc/nss_wrr.c
+++ b/nss_qdisc/nss_wrr.c
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2014-2017, 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017, 2019-2021, The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
@@ -442,10 +442,19 @@ static int nss_wrr_delete_class(struct Q
refcnt = nss_qdisc_atomic_sub_return(&cl->nq);
sch_tree_unlock(sch);
+
+ /*
+ * For 5.4 and above kernels, calling nss_htb_destroy_class
+ * explicitly as there is no put_class which would have called
+ * nss_wrr_destroy_class when refcnt becomes zero.
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ nss_wrr_destroy_class(sch, cl);
+#else
if (!refcnt) {
nss_qdisc_error("Reference count should not be zero for class %px\n", cl);
}
-
+#endif
return 0;
}
@@ -764,6 +773,11 @@ static int nss_wrr_change_qdisc(struct Q
static void nss_wrr_reset_class(struct nss_wrr_class_data *cl)
{
+ if (cl->qdisc == &noop_qdisc) {
+ nss_qdisc_trace("Class %x has no child qdisc to reset\n", cl->nq.qos_tag);
+ return;
+ }
+
nss_qdisc_reset(cl->qdisc);
nss_qdisc_info("Nsswrr class resetted %px\n", cl->qdisc);
}

View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-nss-drv
PKG_RELEASE:=7
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-01-04
PKG_SOURCE_VERSION:=89cc01b57199c6b9845bcef48125f21b6a8c0cc2
PKG_MIRROR_HASH:=2d505bff0602a74b14ea0c4aefee0604e20ce2f95dab0ebb2a70b36cd884e9f4
PKG_SOURCE_DATE:=2021-06-24
PKG_SOURCE_VERSION:=dc14ca2
PKG_MIRROR_HASH:=316d683281818ab3715ca31af42e9b82e1f1a9f13713a015030277f84febea25
PKG_BUILD_PARALLEL:=1
PKG_FLAGS:=nonshared

View File

@ -135,35 +135,6 @@ 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));
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) {
@ -171,10 +142,10 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
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
@@ -78,9 +78,9 @@ int nss_hal_firmware_load(struct nss_ctx
return rc;
}
- load_mem = ioremap_nocache(npd->load_addr, nss_fw->size);
+ load_mem = ioremap(npd->load_addr, nss_fw->size);
if (!load_mem) {
@ -185,7 +156,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
}
--- a/nss_meminfo.c
+++ b/nss_meminfo.c
@@ -735,7 +735,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
@@ -728,7 +728,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
/*
* meminfo_start is the label where the start address of meminfo map is stored.
*/

View File

@ -0,0 +1,31 @@
From 40d4b080f17883ac6b39c74a5feb1af384ab6a51 Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Thu, 11 Jun 2020 16:57:39 +0200
Subject: [PATCH] nss-drv: Control fab scaling from package Makefile
Lets control the fab scaling from the package Makefile
instead of using kernel checks that dont work.
Fab scaling in OpenWrt is done in a external way.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Makefile | 9 ---------
1 file changed, 9 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -481,14 +481,7 @@ NSS_CCFLAGS = -DNSS_DT_SUPPORT=1 -DNSS_F
ccflags-y += -I$(obj)
endif
-# Fabric scaling is supported in 3.14 and 4.4 only
-ifneq ($(findstring 3.14, $(KERNELVERSION)),)
-NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1
-else ifneq ($(findstring 4.4, $(KERNELVERSION)),)
-NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1
-else
NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=0
-endif
# Disable Frequency scaling
ifeq "$(NSS_FREQ_SCALE_DISABLE)" "y"

View File

@ -16,18 +16,20 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
--- a/nss_core.c
+++ b/nss_core.c
@@ -61,7 +61,9 @@
@@ -52,7 +52,11 @@
(((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, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)))) || \
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))) || \
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))))))
+
#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
@@ -2579,7 +2583,7 @@ static inline bool nss_core_skb_can_reus
if (unlikely(irqs_disabled()))
return false;
@ -38,7 +40,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
if (unlikely(skb_is_nonlinear(nbuf)))
--- a/nss_coredump.c
+++ b/nss_coredump.c
@@ -25,7 +25,11 @@
@@ -23,7 +23,11 @@
#include "nss_hal.h"
#include "nss_log.h"
#include <linux/kernel.h>
@ -52,7 +54,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -27,6 +27,7 @@
@@ -24,6 +24,7 @@
#include <linux/firmware.h>
#include <linux/of.h>
#include <linux/irq.h>
@ -60,7 +62,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
#include "nss_hal.h"
#include "nss_arch.h"
@@ -64,9 +65,9 @@ int nss_hal_firmware_load(struct nss_ctx
@@ -57,9 +58,9 @@ int nss_hal_firmware_load(struct nss_ctx
int rc;
if (nss_ctx->id == 0) {

View File

@ -1,23 +1,6 @@
From a6e3e81daab4eb9acbdef0ad1fed056e1bfbe320 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Tue, 8 Jun 2021 23:24:43 +0200
Subject: [PATCH 3/4] DMA: Fix NULL pointer exceptions
There are multiple instances that pass NULL instead
of device to DMA functions.
That is incorrect and will cause kernel NULL pointer
exceptions.
So, simply pass the device structure pointers.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
nss_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/nss_core.c
+++ b/nss_core.c
@@ -1660,7 +1660,7 @@ static int32_t nss_core_handle_cause_que
@@ -1616,7 +1616,7 @@ static int32_t nss_core_handle_cause_que
*
*/
if (unlikely((buffer_type == N2H_BUFFER_CRYPTO_RESP))) {

File diff suppressed because it is too large Load Diff

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
@@ -1421,6 +1421,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:
@@ -1474,7 +1476,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
@@ -1496,6 +1500,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
@@ -1507,7 +1512,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
@@ -1536,13 +1542,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:
@@ -1671,7 +1687,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:
@@ -1683,11 +1700,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
@@ -1762,6 +1780,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
@@ -1831,7 +1850,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
@@ -1845,7 +1866,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
@@ -1858,7 +1880,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
@@ -1905,7 +1927,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
@@ -1919,7 +1943,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
@@ -1932,6 +1957,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
@@ -1939,6 +1965,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
@@ -1991,13 +2018,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
@@ -2008,7 +2048,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
@@ -2021,6 +2062,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
@@ -2031,7 +2073,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
@@ -2076,6 +2119,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
@@ -2083,7 +2127,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)
@@ -2651,9 +2696,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
@@ -2707,7 +2754,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:
@@ -2731,7 +2779,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:
@@ -2745,9 +2794,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
@@ -2787,7 +2838,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
@@ -2811,7 +2863,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
@@ -2827,7 +2880,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
@@ -2841,9 +2895,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
@@ -2882,7 +2938,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
@@ -2935,7 +2992,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
@@ -2954,7 +3012,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_
@@ -3033,8 +3092,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_
@@ -3099,13 +3160,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_
@@ -3129,7 +3190,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,7 +430,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
#ifdef CONFIG_DEBUG_KMEMLEAK
--- a/nss_core.h
+++ b/nss_core.h
@@ -105,31 +105,30 @@
@@ -100,31 +100,30 @@
#endif
/*
@ -484,7 +484,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/nss_hal/ipq806x/nss_hal_pvt.c
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
@@ -474,10 +474,9 @@ static struct nss_platform_data *__nss_h
@@ -477,10 +477,9 @@ static struct nss_platform_data *__nss_h
/*
* Clear TCM memory used by this core
*/
@ -514,7 +514,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
/*
--- a/nss_meminfo.c
+++ b/nss_meminfo.c
@@ -414,7 +414,6 @@ static bool nss_meminfo_init_block_lists
@@ -415,7 +415,6 @@ static bool nss_meminfo_init_block_lists
/*
* Flush the updated meminfo request.
*/
@ -522,7 +522,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
NSS_CORE_DSB();
/*
@@ -545,7 +544,7 @@ static bool nss_meminfo_configure_n2h_h2
@@ -546,7 +545,7 @@ static bool nss_meminfo_configure_n2h_h2
* Bring a fresh copy of if_map from memory in order to read it correctly.
*/
if_map = mem_ctx->if_map;
@ -531,7 +531,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
NSS_CORE_DSB();
if_map->n2h_rings = NSS_N2H_RING_COUNT;
@@ -583,7 +582,7 @@ static bool nss_meminfo_configure_n2h_h2
@@ -584,7 +583,7 @@ static bool nss_meminfo_configure_n2h_h2
/*
* Flush the updated nss_if_mem_map.
*/
@ -542,7 +542,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
return true;
--- a/nss_profiler.c
+++ b/nss_profiler.c
@@ -202,11 +202,12 @@ EXPORT_SYMBOL(nss_profile_dma_deregister
@@ -209,11 +209,12 @@ EXPORT_SYMBOL(nss_profile_dma_deregister
struct nss_profile_sdma_ctrl *nss_profile_dma_get_ctrl(struct nss_ctx_instance *nss_ctx)
{
struct nss_profile_sdma_ctrl *ctrl = nss_ctx->meminfo_ctx.sdma_ctrl;

View File

@ -21,7 +21,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
--- a/nss_core.c
+++ b/nss_core.c
@@ -26,6 +26,8 @@
@@ -23,6 +23,8 @@
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/of.h>
@ -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
@@ -450,50 +452,38 @@ static void nss_core_handle_crypto_pkt(s
*/
static uint32_t nss_soc_mem_info(void)
{

View File

@ -0,0 +1,30 @@
From 89949decfd9a0f86427b502aae4fbc3a3ef399f0 Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Tue, 23 Jun 2020 19:50:28 +0200
Subject: [PATCH] Fix Kernel Panic dma with NULL dev
---
nss_coredump.c | 4 ++--
nss_log.c | 8 +++++---
2 files changed, 8 insertions(+), 6 deletions(-)
--- a/nss_coredump.c
+++ b/nss_coredump.c
@@ -154,7 +154,7 @@ void nss_fw_coredump_notify(struct nss_c
dma_addr = nss_own->meminfo_ctx.logbuffer_dma;
}
- dma_sync_single_for_cpu(NULL, dma_addr, sizeof(struct nss_log_descriptor), DMA_FROM_DEVICE);
+ dma_sync_single_for_cpu(nss_own->dev, dma_addr, sizeof(struct nss_log_descriptor), DMA_FROM_DEVICE);
/*
* If the current entry is smaller than or equal to the number of NSS_LOG_COREDUMP_LINE_NUM,
@@ -181,7 +181,7 @@ void nss_fw_coredump_notify(struct nss_c
offset = (index * sizeof(struct nss_log_entry))
+ offsetof(struct nss_log_descriptor, log_ring_buffer);
- dma_sync_single_for_cpu(NULL, dma_addr + offset,
+ dma_sync_single_for_cpu(nss_own->dev, dma_addr + offset,
sizeof(struct nss_log_entry), DMA_FROM_DEVICE);
nss_info_always("%px: %s\n", nss_own, nle_print->message);
nle_print++;

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_
@@ -1974,7 +1974,7 @@ nss_if_num_t nss_get_available_wifili_ex
*/
uint8_t nss_wifili_thread_scheme_alloc(struct nss_ctx_instance *nss_ctx,
int32_t radio_ifnum,

View File

@ -11,7 +11,7 @@
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
@@ -599,7 +599,7 @@ static int __nss_hal_request_irq(struct
@@ -598,7 +598,7 @@ static int __nss_hal_request_irq(struct
return err;
}
@ -22,7 +22,7 @@
if (err) {
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
@@ -615,62 +615,62 @@ static int __nss_hal_request_irq(struct
@@ -614,62 +614,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) {
@ -97,7 +97,7 @@
--- a/nss_hal/ipq806x/nss_hal_pvt.c
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
@@ -1185,7 +1185,7 @@ static int __nss_hal_request_irq(struct
@@ -1186,7 +1186,7 @@ static int __nss_hal_request_irq(struct
}
int_ctx->irq = npd->irq[irq_num];
@ -108,7 +108,7 @@
}
--- a/nss_hal/ipq807x/nss_hal_pvt.c
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
@@ -659,62 +659,62 @@ static int __nss_hal_request_irq(struct
@@ -657,62 +657,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) {
@ -181,14 +181,3 @@
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx);
}
--- a/nss_hal/ipq95xx/nss_hal_pvt.c
+++ b/nss_hal/ipq95xx/nss_hal_pvt.c
@@ -889,7 +889,7 @@ static int __nss_hal_request_irq(struct
return err;
}
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, napi_poll_cb, napi_wgt);
int_ctx->cause = cause;
err = request_irq(irq, nss_hal_handle_irq, 0, irq_name, int_ctx);
if (err) {

View File

@ -1,28 +1,26 @@
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -392,9 +392,9 @@ void nss_stats_create_dentry(char *name,
/*
* gmac_stats_ops
@@ -398,11 +398,6 @@ void nss_stats_create_dentry(char *name,
*/
-#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
/*
- * gmac_stats_ops
- */
-NSS_STATS_DECLARE_FILE_OPERATIONS(gmac);
-
-/*
* wt_stats_ops
@@ -449,9 +449,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
*/
NSS_STATS_DECLARE_FILE_OPERATIONS(wt);
@@ -453,11 +448,6 @@ void nss_stats_init(void)
nss_drv_stats_dentry_create();
/*
- * gmac_stats
- */
- nss_stats_create_dentry("gmac", &nss_gmac_stats_ops);
-
- /*
* Per-project stats
*/
nss_top_main.project_dentry = debugfs_create_dir("project",

View File

@ -0,0 +1,204 @@
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,9 @@
obj-m += qca-nss-drv.o
#
+# Regular NSS path
+#
+#
# List the files that belong to the driver in alphabetical order.
#
qca-nss-drv-objs := \
@@ -16,57 +19,38 @@ qca-nss-drv-objs := \
nss_dynamic_interface.o \
nss_dynamic_interface_log.o \
nss_dynamic_interface_stats.o \
- nss_eth_rx.o \
- nss_eth_rx_stats.o \
- nss_eth_rx_strings.o \
- nss_gmac_stats.o \
- nss_if.o \
- nss_if_log.o \
nss_init.o \
- nss_ipv4.o \
- nss_ipv4_stats.o \
- nss_ipv4_strings.o \
- nss_ipv4_log.o \
nss_log.o \
- nss_lso_rx.o \
- nss_lso_rx_stats.o \
- nss_lso_rx_strings.o \
nss_meminfo.o \
nss_n2h.o \
nss_n2h_stats.o \
nss_n2h_strings.o \
- nss_phys_if.o \
nss_pm.o \
nss_profiler.o \
nss_project.o \
- nss_pppoe.o \
- nss_pppoe_log.o \
- nss_pppoe_stats.o \
- nss_pppoe_strings.o \
nss_rps.o \
nss_stats.o \
nss_strings.o \
- nss_tx_msg_sync.o \
nss_unaligned.o \
nss_unaligned_log.o \
- nss_unaligned_stats.o \
+ nss_unaligned_stats.o
+
+# Base NSS HAL support
+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 \
+ nss_tx_msg_sync.o \
nss_virt_if.o \
- nss_virt_if_stats.o \
- nss_vlan.o \
- nss_vlan_log.o \
- nss_wifi.o \
- nss_wifi_log.o \
- nss_wifi_stats.o \
- nss_wifi_vdev.o \
- nss_wifili.o \
- nss_wifili_log.o \
- nss_wifili_stats.o \
- nss_wifili_strings.o \
- nss_wifi_mac_db.o
+ nss_virt_if_stats.o
-# Base NSS data plane/HAL support
+# Base NSS data plane support
qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
-qca-nss-drv-objs += nss_hal/nss_hal.o
+endif
ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n"
ccflags-y += -DNSS_DRV_BRIDGE_ENABLE
@@ -332,7 +316,70 @@ qca-nss-drv-objs += \
nss_udp_st_strings.o
endif
+ifneq "$(NSS_DRV_IPV4_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_IPV4_ENABLE
+qca-nss-drv-objs += \
+ nss_ipv4.o \
+ nss_ipv4_stats.o \
+ nss_ipv4_strings.o \
+ nss_ipv4_log.o
+endif
+
+ifneq "$(NSS_DRV_ETH_RX_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_ETH_RX_ENABLE
+qca-nss-drv-objs += \
+ nss_eth_rx.o \
+ nss_eth_rx_stats.o \
+ nss_eth_rx_strings.o
+endif
+
+ifneq "$(NSS_DRV_PPPOE_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_PPPOE_ENABLE
+qca-nss-drv-objs += \
+ nss_pppoe.o \
+ nss_pppoe_log.o \
+ nss_pppoe_stats.o \
+ nss_pppoe_strings.o
+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
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 \
+ nss_wifili_stats.o \
+ nss_wifili_strings.o \
+ nss_wifi_mac_db.o
+endif
+
+ifneq "$(NSS_DRV_VLAN_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_VLAN_ENABLE
+qca-nss-drv-objs += \
+ nss_vlan.o \
+ nss_vlan_log.o
+endif
+
+ifneq "$(NSS_DRV_LSO_RX_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_LSO_RX_ENABLE
+qca-nss-drv-objs += \
+ nss_lso_rx.o \
+ nss_lso_rx_stats.o \
+ nss_lso_rx_strings.o
+endif
+
+ifeq ($(SoC),$(filter $(SoC),ipq806x))
+ccflags-y += -DNSS_DRV_IPV4_ENABLE -DNSS_DRV_IPV6_ENABLE
qca-nss-drv-objs += nss_data_plane/nss_data_plane_gmac.o \
nss_hal/ipq806x/nss_hal_pvt.o
@@ -438,6 +485,8 @@ qca-nss-drv-objs += \
endif
endif
+ccflags-y += -DNSS_DATA_PLANE_GENERIC_SUPPORT
+
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
qca-nss-drv-objs += nss_hal/ipq807x/nss_hal_pvt.o \
nss_data_plane/hal/nss_ipq807x.o
@@ -496,6 +545,7 @@ ccflags-y += -I$(obj)/nss_hal/ipq50xx -D
endif
ccflags-y += -I$(obj)/nss_hal/include -I$(obj)/nss_data_plane/include -I$(obj)/exports -DNSS_DEBUG_LEVEL=0 -DNSS_PKT_STATS_ENABLED=1
+
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
@@ -510,7 +560,14 @@ NSS_CCFLAGS = -DNSS_DT_SUPPORT=1 -DNSS_F
ccflags-y += -I$(obj)
endif
+# Fabric scaling is supported in 3.14 and 4.4 only
+ifneq ($(findstring 3.14, $(KERNELVERSION)),)
+NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1
+else ifneq ($(findstring 4.4, $(KERNELVERSION)),)
+NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1
+else
NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=0
+endif
# Disable Frequency scaling
ifeq "$(NSS_FREQ_SCALE_DISABLE)" "y"
--- a/nss_init.c
+++ b/nss_init.c
@@ -880,6 +880,13 @@ static int __init nss_init(void)
#endif
/*
+ * Init Wi-Fi mesh
+ */
+#ifdef NSS_DRV_WIFI_MESH_ENABLE
+ nss_wifi_mesh_init();
+#endif
+
+ /*
* Register platform_driver
*/
return platform_driver_register(&nss_driver);

View File

@ -1,165 +0,0 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -518,7 +518,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);
@@ -563,7 +563,7 @@ static void nss_get_ddr_info(struct nss_
const __be32 *ppp = (__be32 *)of_get_property(node, "reg", &n_items);
n_items /= sizeof(ppp[0]);
- nss_info_always("node size %d # items %d\n",
+ nss_info("node size %d # items %d\n",
of_n_size_cells(node), n_items);
if (ppp) {
if (n_items & 1) { /* case 1 */
@@ -590,7 +590,7 @@ case3:
n_items = 0;
if (n_items) {
of_node_put(node);
- nss_info_always("%s: %x %u (avl %u) items %d active_cores %d\n",
+ nss_info("%s: %x %u (avl %u) items %d active_cores %d\n",
name, mmu->start_address, mmu->ddr_size,
avail_ddr, n_items, mmu->num_active_cores);
/*
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
@@ -449,15 +449,15 @@ 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_850:
- nss_info_always("850 MHz ");
+ nss_info("850 MHz ");
break;
case NSS_FREQ_1000:
- nss_info_always("1 GHz ");
+ nss_info("1 GHz ");
break;
case NSS_FREQ_SCALE_NA:
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
@@ -532,16 +532,16 @@ 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++) {
if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_187) {
- nss_info_always("187.2 MHz ");
+ nss_info("187.2 MHz ");
} else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_748) {
- nss_info_always("748.8 MHz ");
+ nss_info("748.8 MHz ");
} else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1497) {
- nss_info_always("1.4976 GHz ");
+ nss_info("1.4976 GHz ");
} else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1689) {
- nss_info_always("1.6896 GHz ");
+ nss_info("1.6896 GHz ");
} else {
nss_info_always("Error\nNo Table/Invalid Frequency Found\n");
return -EFAULT;
--- a/nss_hal/ipq806x/nss_hal_pvt.c
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
@@ -1081,7 +1081,7 @@ clk_complete:
}
}
- nss_info_always("Supported Frequencies - ");
+ nss_info("Supported Frequencies - ");
for (i = 0; i < NSS_FREQ_MAX_SCALE; i++) {
if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_110) {
nss_info_always("110Mhz ");
--- a/nss_hal/ipq807x/nss_hal_pvt.c
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
@@ -570,16 +570,16 @@ 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++) {
if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_187) {
- nss_info_always("187.2 MHz ");
+ nss_info("187.2 MHz ");
} else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_748) {
- nss_info_always("748.8 MHz ");
+ nss_info("748.8 MHz ");
} else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1497) {
- nss_info_always("1.4976 GHz ");
+ nss_info("1.4976 GHz ");
} else if (nss_runtime_samples.freq_scale[i].frequency == NSS_FREQ_1689) {
- nss_info_always("1.6896 GHz ");
+ nss_info("1.6896 GHz ");
} else {
nss_info_always("Error\nNo Table/Invalid Frequency Found\n");
return -EFAULT;
--- 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:
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -799,7 +799,7 @@ int nss_hal_probe(struct platform_device
nss_hal_enable_interrupt(nss_ctx, nss_ctx->int_ctx[i].shift_factor, NSS_HAL_SUPPORTED_INTERRUPTS);
}
- nss_info_always("%px: All resources initialized and nss core%d has been brought out of reset", nss_ctx, nss_dev->id);
+ nss_info("%px: All resources initialized and nss core%d has been brought out of reset", nss_ctx, nss_dev->id);
goto out;
err_register_irq:
--- a/nss_meminfo.c
+++ b/nss_meminfo.c
@@ -408,7 +408,7 @@ static bool nss_meminfo_init_block_lists
if (strcmp(r->name, "profile_dma_ctrl") == 0) {
mem_ctx->sdma_ctrl = kern_addr;
- nss_info_always("%px: set sdma %px\n", nss_ctx, kern_addr);
+ nss_info("%px: set sdma %px\n", nss_ctx, kern_addr);
}
/*
@@ -799,6 +799,6 @@ bool nss_meminfo_init(struct nss_ctx_ins
nss_meminfo_init_debugfs(nss_ctx);
- nss_info_always("%px: meminfo init succeed\n", nss_ctx);
+ nss_info("%px: meminfo init succeed\n", nss_ctx);
return true;
}

View File

@ -1,27 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -352,10 +352,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
@@ -593,7 +593,9 @@ int nss_hal_probe(struct platform_device
@@ -572,7 +572,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;

View File

@ -1,6 +1,6 @@
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -380,8 +380,9 @@ size_t nss_stats_print(char *node, char
@@ -388,8 +388,9 @@ size_t nss_stats_print(char *node, char
*/
void nss_stats_create_dentry(char *name, const struct file_operations *ops)
{

View File

@ -0,0 +1,45 @@
--- a/exports/nss_wifi_vdev.h
+++ b/exports/nss_wifi_vdev.h
@@ -166,6 +166,7 @@ enum nss_wifi_vdev_ext_data_pkt_type {
/**< Mesh link VAP special packet. */
NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_MCAST_EXC = 16,
/**< Mesh link VAP multicast packet. */
+ NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_4ADDR, /**< 4 address exception to host. */
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MAX
};
@@ -815,6 +816,16 @@ struct nss_wifi_vdev_ppdu_metadata {
};
/**
+ * nss_wifi_vdev_addr4_data_metadata
+ * Address four metadata
+ */
+struct nss_wifi_vdev_addr4_data_metadata {
+ uint16_t peer_id; /**< Peer ID. */
+ uint8_t sa_valid; /**< Source address is valid. */
+ uint8_t addr4_valid; /**< Address four is valid. */
+};
+
+/**
* nss_wifi_vdev_per_packet_metadata
* Wi-Fi per packet metadata content.
*/
@@ -843,6 +854,8 @@ struct nss_wifi_vdev_per_packet_metadata
/**< Per packet Tx metadata structure for wireless distribution system mode. */
struct nss_wifi_vdev_ppdu_metadata ppdu_metadata;
/**< Per packet PPDU metadata needed for per PPDU copy mode. */
+ struct nss_wifi_vdev_addr4_data_metadata addr4_metadata;
+ /**< Create metadata for the WDS extension interface. */
} metadata;
/**< Metadata payload for special data receive message. */
};
@@ -1039,6 +1052,8 @@ struct nss_wifi_vdev_stats_sync_msg {
uint32_t rx_mic_err; /**< Receive MIC error */
uint32_t mcbc_exc_host_fail_cnt;
/**< Number of multicast/broadcast packets failed to send to host through exception path. */
+ uint32_t addr4_exc_fail; /**< Number of failed 4 address exceptions. */
+ uint32_t addr4_exc_pass; /**< Number of successful 4 address exceptions. */
};
/**