Merge "[qca-nss-drv] Fixed the instance, core, and buf len usage."
diff --git a/nss_c2c_rx_stats.c b/nss_c2c_rx_stats.c
index d6ec80f..4ba92b2 100644
--- a/nss_c2c_rx_stats.c
+++ b/nss_c2c_rx_stats.c
@@ -78,8 +78,6 @@
return -ENOMEM;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "c2c_rx");
-
/*
* C2C_RX statistics
*/
@@ -89,7 +87,12 @@
stats_shadow[i] = nss_c2c_rx_stats[core][i];
}
spin_unlock_bh(&nss_c2c_rx_stats_lock);
- size_wr = nss_stats_print("c2c_rx", NULL, core, NSS_STATS_SINGLE_INSTANCE, nss_c2c_rx_stats_str, stats_shadow, NSS_C2C_RX_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "c2c_rx", core);
+ size_wr += nss_stats_print("c2c_rx", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_c2c_rx_stats_str
+ , stats_shadow
+ , NSS_C2C_RX_STATS_MAX
+ , lbuf, size_wr, size_al);
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
diff --git a/nss_c2c_tx_stats.c b/nss_c2c_tx_stats.c
index ff9df94..896928d 100644
--- a/nss_c2c_tx_stats.c
+++ b/nss_c2c_tx_stats.c
@@ -76,7 +76,6 @@
kfree(lbuf);
return -ENOMEM;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "c2c_tx");
/*
* C2C_TX statistics
@@ -87,7 +86,8 @@
stats_shadow[i] = nss_c2c_tx_stats[core][i];
}
spin_unlock_bh(&nss_c2c_tx_stats_lock);
- size_wr = nss_stats_print("c2c_tx", NULL, core, NSS_STATS_SINGLE_INSTANCE, nss_c2c_tx_stats_str, stats_shadow, NSS_C2C_TX_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "c2c_tx", core);
+ size_wr += nss_stats_print("c2c_tx", NULL, NSS_STATS_SINGLE_INSTANCE, nss_c2c_tx_stats_str, stats_shadow, NSS_C2C_TX_STATS_MAX, lbuf, size_wr, size_al);
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
diff --git a/nss_drv_stats.c b/nss_drv_stats.c
index 77e8f3a..4cdc71e 100644
--- a/nss_drv_stats.c
+++ b/nss_drv_stats.c
@@ -92,12 +92,12 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "drv");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "drv", NSS_STATS_SINGLE_CORE);
for (i = 0; (i < NSS_DRV_STATS_MAX); i++) {
stats_shadow[i] = NSS_PKT_STATS_READ(&nss_top_main.stats_drv[i]);
}
- size_wr = nss_stats_print("drv", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_drv_stats_str, stats_shadow, NSS_DRV_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("drv", NULL, NSS_STATS_SINGLE_INSTANCE, nss_drv_stats_str, stats_shadow, NSS_DRV_STATS_MAX, lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
@@ -168,7 +168,7 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "worker thread");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "worker thread", NSS_STATS_SINGLE_CORE);
for (i = 0; i < thread_count; ++i) {
for (j = 0; j < irq_count; ++j) {
struct nss_project_irq_stats *is = &(shadow[i * irq_count + j]);
diff --git a/nss_dtls_cmn.c b/nss_dtls_cmn.c
index b382f9d..c3bd47d 100644
--- a/nss_dtls_cmn.c
+++ b/nss_dtls_cmn.c
@@ -102,7 +102,7 @@
}
len += scnprintf(buf + len, size - len, "\n-------------------\n");
- len = nss_stats_fill_common_stats(if_num, buf, len, size - len, "dtls_cmn");
+ len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "dtls_cmn");
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len);
diff --git a/nss_dtls_stats.c b/nss_dtls_stats.c
index 02accfd..0aeff87 100644
--- a/nss_dtls_stats.c
+++ b/nss_dtls_stats.c
@@ -98,7 +98,7 @@
/*
* Session stats.
*/
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "dtls");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "dtls", NSS_STATS_SINGLE_CORE);
for (id = 0; id < NSS_MAX_DTLS_SESSIONS; id++) {
if (!dtls_session_stats[id].valid)
@@ -117,7 +117,7 @@
dtls_session_stats[id].if_num);
}
- size_wr = nss_stats_print("dtls_cmn", NULL, NSS_STATS_SINGLE_CORE, id, nss_dtls_stats_session_str, dtls_session_stats[id].stats, NSS_DTLS_STATS_SESSION_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("dtls_cmn", NULL, id, nss_dtls_stats_session_str, dtls_session_stats[id].stats, NSS_DTLS_STATS_SESSION_MAX, lbuf, size_wr, size_al);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
}
diff --git a/nss_edma_stats.c b/nss_edma_stats.c
index 0f55c99..6505cd7 100644
--- a/nss_edma_stats.c
+++ b/nss_edma_stats.c
@@ -141,7 +141,7 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "edma");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "edma", NSS_STATS_SINGLE_CORE);
/*
* Common node stats
@@ -154,7 +154,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_port", NULL, NSS_STATS_SINGLE_CORE, data->edma_id, nss_edma_stats_str_node, stats_shadow, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_port", NULL, data->edma_id
+ , nss_edma_stats_str_node
+ , stats_shadow
+ , NSS_STATS_NODE_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
@@ -248,7 +252,11 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_port_ring", NULL, NSS_STATS_SINGLE_CORE, data->edma_id, nss_edma_stats_str_port_ring_map, stats_shadow, NSS_EDMA_PORT_RING_MAP_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_port_ring", NULL, data->edma_id
+ , nss_edma_stats_str_port_ring_map
+ , stats_shadow
+ , NSS_EDMA_PORT_RING_MAP_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
@@ -300,7 +308,11 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_tx_ring", NULL, NSS_STATS_SINGLE_CORE, data->edma_id, nss_edma_stats_str_tx, stats_shadow, NSS_EDMA_STATS_TX_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_tx_ring", NULL, data->edma_id
+ , nss_edma_stats_str_tx
+ , stats_shadow
+ , NSS_EDMA_STATS_TX_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
@@ -348,7 +360,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_rx_ring", NULL, NSS_STATS_SINGLE_CORE, data->edma_id, nss_edma_stats_str_rx, stats_shadow, NSS_EDMA_STATS_RX_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_rx_ring", NULL, data->edma_id
+ , nss_edma_stats_str_rx
+ , stats_shadow
+ , NSS_EDMA_STATS_RX_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
@@ -399,7 +415,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_tx_cmpl_ring", NULL, NSS_STATS_SINGLE_CORE, data->edma_id, nss_edma_stats_str_txcmpl, stats_shadow, NSS_EDMA_STATS_TXCMPL_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_tx_cmpl_ring", NULL, data->edma_id
+ , nss_edma_stats_str_txcmpl
+ , stats_shadow
+ , NSS_EDMA_STATS_TXCMPL_MAX
+ , lbuf, size_wr, size_al);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\nedma Tx cmpl ring stats end\n\n");
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
@@ -451,7 +471,12 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_rx_fill_ring", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_edma_stats_str_rxfill, stats_shadow, NSS_EDMA_STATS_RXFILL_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_rx_fill_ring", NULL
+ , NSS_STATS_SINGLE_INSTANCE
+ , nss_edma_stats_str_rxfill
+ , stats_shadow
+ , NSS_EDMA_STATS_RXFILL_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
@@ -500,7 +525,11 @@
stats_shadow[i] = edma_stats.misc_err[i];
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("edma_err", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_edma_stats_str_err_map, stats_shadow, NSS_EDMA_ERR_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("edma_err", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_edma_stats_str_err_map
+ , stats_shadow
+ , NSS_EDMA_ERR_STATS_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_eth_rx_stats.c b/nss_eth_rx_stats.c
index f7feb6f..503e709 100644
--- a/nss_eth_rx_stats.c
+++ b/nss_eth_rx_stats.c
@@ -75,9 +75,9 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "eth_rx");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "eth_rx", NSS_STATS_SINGLE_CORE);
- size_wr = nss_stats_fill_common_stats(NSS_ETH_RX_INTERFACE, lbuf, size_wr, size_al, "eth_rx");
+ size_wr += nss_stats_fill_common_stats(NSS_ETH_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "eth_rx");
/*
* eth_rx node stats.
@@ -89,7 +89,12 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("eth_rx", "eth_rx node stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_eth_rx_stats_str, stats_shadow, NSS_ETH_RX_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("eth_rx", "eth_rx node stats"
+ , NSS_STATS_SINGLE_INSTANCE
+ , nss_eth_rx_stats_str
+ , stats_shadow
+ , NSS_ETH_RX_STATS_MAX
+ , lbuf, size_wr, size_al);
/*
* Exception stats.
@@ -101,7 +106,12 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("eth_rx", "eth_rx exception stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_eth_rx_exception_stats_str, stats_shadow, NSS_ETH_RX_EXCEPTION_EVENT_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("eth_rx", "eth_rx exception stats"
+ , NSS_STATS_SINGLE_INSTANCE
+ , nss_eth_rx_exception_stats_str
+ , stats_shadow
+ , NSS_ETH_RX_EXCEPTION_EVENT_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_gmac_stats.c b/nss_gmac_stats.c
index 07e59e3..23f5924 100644
--- a/nss_gmac_stats.c
+++ b/nss_gmac_stats.c
@@ -58,7 +58,7 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "gmac");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gmac", NSS_STATS_SINGLE_CORE);
for (id = 0; id < NSS_MAX_PHYSICAL_INTERFACES; id++) {
spin_lock_bh(&nss_top_main.stats_lock);
@@ -67,7 +67,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("gmac", "gmac stats", NSS_STATS_SINGLE_CORE, id, nss_gmac_stats_str, stats_shadow, NSS_GMAC_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("gmac", "gmac stats", id
+ , nss_gmac_stats_str
+ , stats_shadow
+ , NSS_GMAC_STATS_MAX
+ , lbuf, size_wr, size_al);
}
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\ngmac stats end\n\n");
diff --git a/nss_gre_stats.c b/nss_gre_stats.c
index ea3191c..08a9279 100644
--- a/nss_gre_stats.c
+++ b/nss_gre_stats.c
@@ -245,14 +245,18 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "gre");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "gre", NSS_STATS_SINGLE_CORE);
/*
* Get all base stats
*/
nss_gre_stats_base_debug_get((void *)bstats, sizeof(struct nss_gre_stats_base_debug));
- size_wr = nss_stats_print("gre", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_gre_stats_base_debug_str, bstats->stats, NSS_GRE_STATS_BASE_DEBUG_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("gre", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_gre_stats_base_debug_str
+ , bstats->stats
+ , NSS_GRE_STATS_BASE_DEBUG_MAX
+ , lbuf, size_wr, size_al);
/*
* Get all session stats
@@ -275,7 +279,11 @@
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id,
(sstats + id)->if_num);
}
- size_wr = nss_stats_print("gre_session", NULL, NSS_STATS_SINGLE_CORE, id, nss_gre_stats_session_debug_str, (sstats + id)->stats, NSS_GRE_STATS_SESSION_DEBUG_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("gre_session", NULL, id
+ , nss_gre_stats_session_debug_str
+ , (sstats + id)->stats
+ , NSS_GRE_STATS_SESSION_DEBUG_MAX
+ , lbuf, size_wr, size_al);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
}
diff --git a/nss_igs_stats.c b/nss_igs_stats.c
index 3e19394..a6b511a 100644
--- a/nss_igs_stats.c
+++ b/nss_igs_stats.c
@@ -160,7 +160,7 @@
* Get all stats
*/
nss_igs_stats_get((void *)igs_shadow_stats);
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "igs");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "igs", NSS_STATS_SINGLE_CORE);
/*
* Session stats
@@ -181,12 +181,17 @@
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "%d. nss interface id=%d\n", id,
igs_shadow_stats[id].if_num);
}
- size_wr = nss_stats_fill_common_stats(igs_shadow_stats[id].if_num, lbuf, size_wr, size_al, "igs");
+ size_wr += nss_stats_fill_common_stats(igs_shadow_stats[id].if_num, id, lbuf, size_wr, size_al, "igs");
/*
* IGS exception stats.
*/
- size_wr = nss_stats_print("igs", "igs exception stats start", NSS_STATS_SINGLE_CORE, id, nss_igs_stats_str, igs_shadow_stats[id].stats, NSS_IGS_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("igs", "igs exception stats start"
+ , id
+ , nss_igs_stats_str
+ , igs_shadow_stats[id].stats
+ , NSS_IGS_STATS_MAX
+ , lbuf, size_wr, size_al);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
}
diff --git a/nss_ipsec_cmn.c b/nss_ipsec_cmn.c
index 88586fa..a283b12 100644
--- a/nss_ipsec_cmn.c
+++ b/nss_ipsec_cmn.c
@@ -88,7 +88,7 @@
return 0;
}
- len = nss_stats_banner(buf, len, size, "ipsec_cmn");
+ len += nss_stats_banner(buf, len, size, "ipsec_cmn", NSS_STATS_SINGLE_CORE);
/*
* Common node stats for each IPSEC dynamic interface.
@@ -119,7 +119,7 @@
}
len += scnprintf(buf + len, size - len, "\n-------------------\n");
- len = nss_stats_fill_common_stats(if_num, buf, len, size - len, "ipsec_cmn");
+ len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "ipsec_cmn");
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len);
diff --git a/nss_ipv4_reasm_stats.c b/nss_ipv4_reasm_stats.c
index ddaa28f..e2e0f71 100644
--- a/nss_ipv4_reasm_stats.c
+++ b/nss_ipv4_reasm_stats.c
@@ -60,9 +60,9 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "ipv4_reasm");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv4_reasm", NSS_STATS_SINGLE_CORE);
- size_wr = nss_stats_fill_common_stats(NSS_IPV4_REASM_INTERFACE, lbuf, size_wr, size_al, "ipv4_reasm");
+ size_wr += nss_stats_fill_common_stats(NSS_IPV4_REASM_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv4_reasm");
/*
* IPv4 reasm node stats
@@ -73,7 +73,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("ipv4_reasm", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_ipv4_reasm_stats_str, stats_shadow, NSS_IPV4_REASM_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("ipv4_reasm", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_ipv4_reasm_stats_str
+ , stats_shadow
+ , NSS_IPV4_REASM_STATS_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_ipv4_stats.c b/nss_ipv4_stats.c
index 7470470..9c7883b 100644
--- a/nss_ipv4_stats.c
+++ b/nss_ipv4_stats.c
@@ -167,8 +167,8 @@
kfree(lbuf);
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "ipv4");
- size_wr = nss_stats_fill_common_stats(NSS_IPV4_RX_INTERFACE, lbuf, size_wr, size_al, "ipv4");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv4", NSS_STATS_SINGLE_CORE);
+ size_wr += nss_stats_fill_common_stats(NSS_IPV4_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv4");
/*
* IPv4 node stats
@@ -178,7 +178,12 @@
stats_shadow[i] = nss_ipv4_stats[i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("ipv4", "ipv4 Special Stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_ipv4_stats_str, stats_shadow, NSS_IPV4_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("ipv4", "ipv4 special stats"
+ , NSS_STATS_SINGLE_INSTANCE
+ , nss_ipv4_stats_str
+ , stats_shadow
+ , NSS_IPV4_STATS_MAX
+ , lbuf, size_wr, size_al);
/*
* Exception stats
@@ -188,7 +193,12 @@
stats_shadow[i] = nss_ipv4_exception_stats[i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("ipv4", "ipv4 Exception Stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_ipv4_exception_stats_str, stats_shadow, NSS_IPV4_EXCEPTION_EVENT_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("ipv4", "ipv4 exception stats"
+ , NSS_STATS_SINGLE_INSTANCE
+ , nss_ipv4_exception_stats_str
+ , stats_shadow
+ , NSS_IPV4_EXCEPTION_EVENT_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_ipv6_reasm_stats.c b/nss_ipv6_reasm_stats.c
index 9300a63..24e80c2 100644
--- a/nss_ipv6_reasm_stats.c
+++ b/nss_ipv6_reasm_stats.c
@@ -59,9 +59,9 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "ipv6_reasm");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv6_reasm", NSS_STATS_SINGLE_CORE);
- size_wr = nss_stats_fill_common_stats(NSS_IPV6_REASM_INTERFACE, lbuf, size_wr, size_al, "ipv6_reasm");
+ size_wr += nss_stats_fill_common_stats(NSS_IPV6_REASM_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv6_reasm");
/*
* Ipv6 reasm node stats
@@ -74,7 +74,11 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("ipv6_reasm", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_ipv6_reasm_stats_str, stats_shadow, NSS_IPV6_REASM_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("ipv6_reasm", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_ipv6_reasm_stats_str
+ , stats_shadow
+ , NSS_IPV6_REASM_STATS_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_ipv6_stats.c b/nss_ipv6_stats.c
index f9b1bb7..1408205 100644
--- a/nss_ipv6_stats.c
+++ b/nss_ipv6_stats.c
@@ -147,8 +147,8 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "ipv6");
- size_wr = nss_stats_fill_common_stats(NSS_IPV6_RX_INTERFACE, lbuf, size_wr, size_al, "ipv6");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "ipv6", NSS_STATS_SINGLE_CORE);
+ size_wr += nss_stats_fill_common_stats(NSS_IPV6_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "ipv6");
/*
* IPv6 node stats
@@ -160,7 +160,11 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("ipv6", "ipv6 node stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_ipv6_stats_str, stats_shadow, NSS_IPV6_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("ipv6", "ipv6 node stats", NSS_STATS_SINGLE_INSTANCE
+ , nss_ipv6_stats_str
+ , stats_shadow
+ , NSS_IPV6_STATS_MAX
+ , lbuf, size_wr, size_al);
/*
* Exception stats
@@ -171,7 +175,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("ipv6", "ipv6 exception stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_ipv6_exception_stats_str, stats_shadow, NSS_IPV6_EXCEPTION_EVENT_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("ipv6", "ipv6 exception stats", NSS_STATS_SINGLE_INSTANCE
+ , nss_ipv6_exception_stats_str
+ , stats_shadow
+ , NSS_IPV6_EXCEPTION_EVENT_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_l2tpv2_stats.c b/nss_l2tpv2_stats.c
index ae876a5..2f51d34 100644
--- a/nss_l2tpv2_stats.c
+++ b/nss_l2tpv2_stats.c
@@ -55,7 +55,7 @@
}
memset(&l2tpv2_session_stats, 0, sizeof(struct nss_l2tpv2_stats_session_debug) * NSS_MAX_L2TPV2_DYNAMIC_INTERFACES);
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "l2tpv2");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "l2tpv2", NSS_STATS_SINGLE_CORE);
/*
* Get all stats
@@ -83,7 +83,12 @@
l2tpv2_session_stats[id].if_num);
}
- size_wr = nss_stats_print("l2tpv2", "l2tp v2 session stats", NSS_STATS_SINGLE_CORE, id, nss_l2tpv2_stats_session_str, l2tpv2_session_stats[id].stats, NSS_L2TPV2_STATS_SESSION_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("l2tpv2", "l2tp v2 session stats"
+ , id
+ , nss_l2tpv2_stats_session_str
+ , l2tpv2_session_stats[id].stats
+ , NSS_L2TPV2_STATS_SESSION_MAX
+ , lbuf, size_wr, size_al);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
}
diff --git a/nss_lso_rx_stats.c b/nss_lso_rx_stats.c
index d953fa4..dfe2eca 100644
--- a/nss_lso_rx_stats.c
+++ b/nss_lso_rx_stats.c
@@ -61,8 +61,8 @@
kfree(lbuf);
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "lso_rx");
- size_wr = nss_stats_fill_common_stats(NSS_LSO_RX_INTERFACE, lbuf, size_wr, size_al, "lso_rx");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "lso_rx", NSS_STATS_SINGLE_CORE);
+ size_wr += nss_stats_fill_common_stats(NSS_LSO_RX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "lso_rx");
/*
* lso_rx node stats
@@ -74,7 +74,12 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("lso_rx", "lso_rx node stats", NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_lso_rx_stats_str, stats_shadow, NSS_LSO_RX_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("lso_rx", "lso_rx node stats"
+ , NSS_STATS_SINGLE_INSTANCE
+ , nss_lso_rx_stats_str
+ , stats_shadow
+ , NSS_LSO_RX_STATS_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
diff --git a/nss_n2h_stats.c b/nss_n2h_stats.c
index 68040a5..4cdc9ad 100644
--- a/nss_n2h_stats.c
+++ b/nss_n2h_stats.c
@@ -90,8 +90,6 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "n2h");
-
/*
* N2H node stats
*/
@@ -101,7 +99,12 @@
stats_shadow[i] = nss_n2h_stats[core][i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("n2h", NULL, core, NSS_STATS_SINGLE_INSTANCE, nss_n2h_stats_str, stats_shadow, NSS_N2H_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "n2h", core);
+ size_wr += nss_stats_print("n2h", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_n2h_stats_str
+ , stats_shadow
+ , NSS_N2H_STATS_MAX
+ , lbuf, size_wr, size_al);
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
diff --git a/nss_portid_stats.c b/nss_portid_stats.c
index d91f440..14ae1ca 100644
--- a/nss_portid_stats.c
+++ b/nss_portid_stats.c
@@ -60,8 +60,8 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "portid");
- size_wr = nss_stats_fill_common_stats(NSS_PORTID_INTERFACE, lbuf, size_wr, size_al, "portid");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "portid", NSS_STATS_SINGLE_CORE);
+ size_wr += nss_stats_fill_common_stats(NSS_PORTID_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "portid");
/*
* PortID node stats
@@ -73,7 +73,11 @@
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("portid", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_portid_stats_str, stats_shadow, NSS_PORTID_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("portid", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_portid_stats_str
+ , stats_shadow
+ , NSS_PORTID_STATS_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
diff --git a/nss_pppoe_stats.c b/nss_pppoe_stats.c
index d319b31..ae5abed 100644
--- a/nss_pppoe_stats.c
+++ b/nss_pppoe_stats.c
@@ -142,8 +142,7 @@
/*
* Base node stats
*/
- size_wr = nss_stats_print("pppoe", "pppoe base node stats start"
- , NSS_STATS_SINGLE_CORE
+ size_wr += nss_stats_print("pppoe", "pppoe base node stats start"
, NSS_STATS_SINGLE_INSTANCE
, nss_pppoe_stats_base_str
, pppoe_stats.base_stats
@@ -167,8 +166,7 @@
pppoe_stats.session_stats[id].if_num, dev->name);
dev_put(dev);
- size_wr = nss_stats_print("pppoe", "pppoe session node stats"
- , NSS_STATS_SINGLE_CORE
+ size_wr += nss_stats_print("pppoe", "pppoe session node stats"
, id
, nss_pppoe_stats_session_str
, pppoe_stats.session_stats[id].stats
diff --git a/nss_qrfs_stats.c b/nss_qrfs_stats.c
index 5bfc773..6949083 100644
--- a/nss_qrfs_stats.c
+++ b/nss_qrfs_stats.c
@@ -74,7 +74,7 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "qrfs");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "qrfs", NSS_STATS_SINGLE_CORE);
/*
* QRFS statistics
*/
@@ -85,7 +85,11 @@
}
spin_unlock_bh(&nss_qrfs_stats_lock);
- size_wr = nss_stats_print("qrfs", NULL, core, NSS_STATS_SINGLE_INSTANCE, nss_qrfs_stats_str, stats_shadow, NSS_QRFS_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("qrfs", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_qrfs_stats_str
+ , stats_shadow
+ , NSS_QRFS_STATS_MAX
+ , lbuf, size_wr, size_al);
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
diff --git a/nss_qvpn_stats.c b/nss_qvpn_stats.c
index 992f4ed..ff139bc 100644
--- a/nss_qvpn_stats.c
+++ b/nss_qvpn_stats.c
@@ -43,7 +43,7 @@
/*
* Common node stats for each QVPN dynamic interface.
*/
- len = nss_stats_banner(buf, len, size, "qvpn");
+ len += nss_stats_banner(buf, len, size, "qvpn", NSS_STATS_SINGLE_CORE);
for_each_set_bit(if_num, ifmap, NSS_MAX_NET_INTERFACES) {
type = nss_dynamic_interface_get_type(nss_ctx, if_num);
@@ -62,7 +62,7 @@
}
len += scnprintf(buf + len, size - len, "\n-------------------\n");
- len = nss_stats_fill_common_stats(if_num, buf, len, size - len, "qvpn");
+ len += nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "qvpn");
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len);
diff --git a/nss_sjack_stats.c b/nss_sjack_stats.c
index 446a08a..139a349 100644
--- a/nss_sjack_stats.c
+++ b/nss_sjack_stats.c
@@ -44,8 +44,8 @@
kfree(lbuf);
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "sjack");
- size_wr = nss_stats_fill_common_stats(NSS_SJACK_INTERFACE, lbuf, size_wr, size_al, "sjack");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "sjack", NSS_STATS_SINGLE_CORE);
+ size_wr += nss_stats_fill_common_stats(NSS_SJACK_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "sjack");
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
diff --git a/nss_stats.c b/nss_stats.c
index f6d6f41..c51591f 100644
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -27,6 +27,11 @@
#define NSS_STATS_DIGITS_MAX 16
/*
+ * Spaces to print core details inside banner
+ */
+#define NSS_STATS_BANNER_SPACES 12
+
+/*
* Max characters for a node name.
*/
#define NSS_STATS_NODE_NAME_MAX 24
@@ -122,7 +127,7 @@
/*
* nss_stats_register_sysctl()
- * Register a sysctl table for stats.
+ * Register a sysctl table for stats.
*/
void nss_stats_register_sysctl(void)
{
@@ -134,7 +139,7 @@
/*
* nss_stats_open()
- * Opens stats file.
+ * Opens stats file.
*/
int nss_stats_open(struct inode *inode, struct file *filp)
{
@@ -157,7 +162,7 @@
/*
* nss_stats_release()
- * Releases stats file.
+ * Releases stats file.
*/
int nss_stats_release(struct inode *inode, struct file *filp)
{
@@ -189,27 +194,30 @@
* nss_stats_fill_common_stats()
* Fill common node statistics.
*/
-size_t nss_stats_fill_common_stats(uint32_t if_num, char *lbuf, size_t size_wr, size_t size_al, char *node)
+size_t nss_stats_fill_common_stats(uint32_t if_num, int instance, char *lbuf, size_t size_wr, size_t size_al, char *node)
{
uint64_t stats_val[NSS_STATS_NODE_MAX];
int i;
+ size_t orig_size_wr = size_wr;
+
spin_lock_bh(&nss_top_main.stats_lock);
for (i = 0; i < NSS_STATS_NODE_MAX; i++) {
stats_val[i] = nss_top_main.stats_node[if_num][i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print(node, NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_stats_str_node, stats_val, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al);
- return size_wr;
+ size_wr += nss_stats_print(node, NULL, instance, nss_stats_str_node, stats_val, NSS_STATS_NODE_MAX, lbuf, size_wr, size_al);
+ return size_wr - orig_size_wr;
}
/*
* nss_stats_banner()
* Printing banner for node.
*/
-size_t nss_stats_banner(char *lbuf, size_t size_wr, size_t size_al, char *node)
+size_t nss_stats_banner(char *lbuf, size_t size_wr, size_t size_al, char *node, int core)
{
uint16_t banner_char_length, i;
+ size_t orig_size_wr = size_wr;
char node_upr[NSS_STATS_NODE_NAME_MAX + 1];
if (strlen(node) > NSS_STATS_NODE_NAME_MAX) {
@@ -221,8 +229,11 @@
for (i = 0; i < NSS_STATS_BANNER_MAX_LENGTH ; i++) {
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "_");
}
-
- banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + 2)) / 2);
+ if (core > NSS_STATS_SINGLE_CORE) {
+ banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + NSS_STATS_BANNER_SPACES)) / 2);
+ } else {
+ banner_char_length = (uint16_t)((NSS_STATS_BANNER_MAX_LENGTH - (strlen(node) + 2)) / 2);
+ }
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n\n");
for (i = 0; i < banner_char_length; i++) {
@@ -234,7 +245,16 @@
node_upr[i] = toupper(node_upr[i]);
}
- size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s ", node);
+ /*
+ * TODO: Enhance so that both core0 and core1 print the same way for a
+ * node that has presence in both cores. i.e. Core0 should have [CORE 0]
+ * and not just Core1.
+ */
+ if (core > 1) {
+ size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s [CORE %d] ", node_upr, core);
+ } else {
+ size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, " %s ", node_upr);
+ }
for (i = 0; i < banner_char_length; i++) {
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, ">");
}
@@ -245,18 +265,20 @@
}
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n\n");
- return size_wr;
+ return size_wr - orig_size_wr;
}
/*
* nss_stats_print()
* Helper API to print stats.
*/
-size_t nss_stats_print(char *node, char *stat_details, int core_num, int instance, struct nss_stats_info *stats_info, uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al)
+size_t nss_stats_print(char *node, char *stat_details, int instance, struct nss_stats_info *stats_info,
+ uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al)
{
uint16_t i, j;
uint16_t maxlen = 0;
char stats_string[NSS_STATS_MAX_STR_LENGTH];
+ size_t orig_size_wr = size_wr;
char node_lwr[NSS_STATS_NODE_NAME_MAX + 1];
if (strlen(node) > NSS_STATS_NODE_NAME_MAX) {
@@ -274,12 +296,6 @@
}
}
- if (core_num >= 0) {
- size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n***** \n");
- size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "***** CORE %d \n", core_num);
- size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "*****\n");
- }
-
if (stat_details != NULL) {
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n#%s\n\n", stat_details);
}
@@ -349,7 +365,7 @@
}
}
- return size_wr;
+ return size_wr - orig_size_wr;
}
/*
@@ -384,7 +400,7 @@
/*
* nss_stats_init()
- * Enable NSS statistics.
+ * Enable NSS statistics.
*/
void nss_stats_init(void)
{
diff --git a/nss_stats.h b/nss_stats.h
index 1c9feec..88c3475 100644
--- a/nss_stats.h
+++ b/nss_stats.h
@@ -109,7 +109,7 @@
extern int nss_stats_release(struct inode *inode, struct file *filp);
extern int nss_stats_open(struct inode *inode, struct file *filp);
void nss_stats_create_dentry(char *name, const struct file_operations *ops);
-extern size_t nss_stats_fill_common_stats(uint32_t if_num, char *lbuf, size_t size_wr, size_t size_al, char *node);
-extern size_t nss_stats_banner(char *lbuf ,size_t size_wr, size_t size_al, char *node);
-extern size_t nss_stats_print(char *node, char *stat_details, int core_num, int instance, struct nss_stats_info *stats_info, uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al);
+extern size_t nss_stats_fill_common_stats(uint32_t if_num, int instance, char *lbuf, size_t size_wr, size_t size_al, char *node);
+extern size_t nss_stats_banner(char *lbuf , size_t size_wr, size_t size_al, char *node, int core);
+extern size_t nss_stats_print(char *node, char *stat_details, int instance, struct nss_stats_info *stats_info, uint64_t *stats_val, uint16_t max, char *lbuf, size_t size_wr, size_t size_al);
#endif /* __NSS_STATS_H */
diff --git a/nss_trustsec_tx_stats.c b/nss_trustsec_tx_stats.c
index a44a882..5302321 100644
--- a/nss_trustsec_tx_stats.c
+++ b/nss_trustsec_tx_stats.c
@@ -102,12 +102,12 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "trustsec_tx");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "trustsec_tx", NSS_STATS_SINGLE_CORE);
/*
* Common node stats
*/
- size_wr = nss_stats_fill_common_stats(NSS_TRUSTSEC_TX_INTERFACE, lbuf, size_wr, size_al, "trustsec_tx");
+ size_wr += nss_stats_fill_common_stats(NSS_TRUSTSEC_TX_INTERFACE, NSS_STATS_SINGLE_INSTANCE, lbuf, size_wr, size_al, "trustsec_tx");
/*
* TrustSec TX node stats
@@ -118,7 +118,11 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("trustsec_tx", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_trustsec_tx_stats_str, stats_shadow, NSS_TRUSTSEC_TX_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("trustsec_tx", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_trustsec_tx_stats_str
+ , stats_shadow
+ , NSS_TRUSTSEC_TX_STATS_MAX
+ , lbuf, size_wr, size_al);
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
kfree(lbuf);
kfree(stats_shadow);
diff --git a/nss_tstamp_stats.c b/nss_tstamp_stats.c
index 54e1fac..6285ad8 100644
--- a/nss_tstamp_stats.c
+++ b/nss_tstamp_stats.c
@@ -80,7 +80,7 @@
kfree(lbuf);
return -ENOMEM;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "tstamp");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "tstamp", NSS_STATS_SINGLE_CORE);
/*
* TSTAMP statistics
*/
@@ -96,7 +96,11 @@
stats_shadow[i] = nss_tstamp_stats[num][i];
}
spin_unlock_bh(&nss_tstamp_stats_lock);
- size_wr = nss_stats_print("tstamp", NULL, NSS_STATS_SINGLE_CORE, NSS_STATS_SINGLE_INSTANCE, nss_tstamp_stats_str, stats_shadow, NSS_TSTAMP_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("tstamp", NULL, NSS_STATS_SINGLE_INSTANCE
+ , nss_tstamp_stats_str
+ , stats_shadow
+ , NSS_TSTAMP_STATS_MAX
+ , lbuf, size_wr, size_al);
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, lbuf, strlen(lbuf));
diff --git a/nss_vxlan_stats.c b/nss_vxlan_stats.c
index c56e191..5988a0e 100644
--- a/nss_vxlan_stats.c
+++ b/nss_vxlan_stats.c
@@ -47,11 +47,11 @@
/*
* Common node stats for each VxLAN dynamic interface.
*/
- for(if_num = 0; if_num < NSS_MAX_NET_INTERFACES; if_num++) {
+ for (if_num = 0; if_num < NSS_MAX_NET_INTERFACES; if_num++) {
if (if_num == NSS_VXLAN_INTERFACE) {
len += scnprintf(buf + len, size - len, "\nBase node if_num:%03u", if_num);
len += scnprintf(buf + len, size - len, "\n-------------------\n");
- len = nss_stats_fill_common_stats(if_num, buf, len, size - len, "vxlan");
+ len = nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "vxlan");
continue;
}
@@ -70,7 +70,7 @@
}
len += scnprintf(buf + len, size - len, "\n-------------------\n");
- len = nss_stats_fill_common_stats(if_num, buf, len, size - len, "vxlan");
+ len = nss_stats_fill_common_stats(if_num, NSS_STATS_SINGLE_INSTANCE, buf, len, size - len, "vxlan");
}
bytes_read = simple_read_from_buffer(ubuf, sz, ppos, buf, len);
diff --git a/nss_wifi_stats.c b/nss_wifi_stats.c
index f2f17da..f6ac211 100644
--- a/nss_wifi_stats.c
+++ b/nss_wifi_stats.c
@@ -122,7 +122,7 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "wifi");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "wifi", NSS_STATS_SINGLE_CORE);
for (id = 0; id < NSS_MAX_WIFI_RADIO_INTERFACES; id++) {
spin_lock_bh(&nss_top_main.stats_lock);
@@ -131,7 +131,7 @@
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifi", NULL, NSS_STATS_SINGLE_CORE, id, nss_wifi_stats_str, stats_shadow, NSS_WIFI_STATS_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifi", NULL, id, nss_wifi_stats_str, stats_shadow, NSS_WIFI_STATS_MAX, lbuf, size_wr, size_al);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
}
diff --git a/nss_wifili_stats.c b/nss_wifili_stats.c
index e7b2857..600b4f1 100644
--- a/nss_wifili_stats.c
+++ b/nss_wifili_stats.c
@@ -200,12 +200,16 @@
return 0;
}
- size_wr = nss_stats_banner(lbuf, size_wr, size_al, "wifili");
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, "wifili", NSS_STATS_SINGLE_CORE);
for (i = 0; i < NSS_WIFILI_MAX_PDEV_NUM_MSG; i++) {
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_txrx, stats_shadow, NSS_WIFILI_STATS_TXRX_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_txrx
+ , stats_shadow
+ , NSS_WIFILI_STATS_TXRX_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -213,7 +217,11 @@
* Fillinng TCL ring stats
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_tcl, stats_shadow, NSS_WIFILI_STATS_TCL_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_tcl
+ , stats_shadow
+ , NSS_WIFILI_STATS_TCL_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -221,7 +229,11 @@
* Fillinng TCL comp stats
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_tx_comp, stats_shadow, NSS_WIFILI_STATS_TX_DESC_FREE_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_tx_comp
+ , stats_shadow
+ , NSS_WIFILI_STATS_TX_DESC_FREE_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -229,7 +241,11 @@
* Fillinng reo ring stats
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_reo, stats_shadow, NSS_WIFILI_STATS_REO_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_reo
+ , stats_shadow
+ , NSS_WIFILI_STATS_REO_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -238,7 +254,11 @@
* Fillinng TX SW Pool
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_txsw_pool, stats_shadow, NSS_WIFILI_STATS_TX_DESC_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_txsw_pool
+ , stats_shadow
+ , NSS_WIFILI_STATS_TX_DESC_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -246,7 +266,11 @@
* Fillinng TX EXt SW Pool
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_ext_txsw_pool, stats_shadow, NSS_WIFILI_STATS_EXT_TX_DESC_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_ext_txsw_pool
+ , stats_shadow
+ , NSS_WIFILI_STATS_EXT_TX_DESC_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -254,7 +278,11 @@
* Fillinng rxdma pool stats
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_rxdma_pool, stats_shadow, NSS_WIFILI_STATS_RX_DESC_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_rxdma_pool
+ , stats_shadow
+ , NSS_WIFILI_STATS_RX_DESC_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
@@ -262,14 +290,22 @@
* Fillinng rxdma ring stats
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_rxdma_ring, stats_shadow, NSS_WIFILI_STATS_RXDMA_DESC_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_rxdma_ring
+ , stats_shadow
+ , NSS_WIFILI_STATS_RXDMA_DESC_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
/*
* Fillinng wbm ring stats
*/
spin_lock_bh(&nss_top_main.stats_lock);
- size_wr = nss_stats_print("wifili", NULL, NSS_STATS_SINGLE_CORE, i, nss_wifili_stats_str_wbm, stats_shadow, NSS_WIFILI_STATS_WBM_MAX, lbuf, size_wr, size_al);
+ size_wr += nss_stats_print("wifili", NULL, i
+ , nss_wifili_stats_str_wbm
+ , stats_shadow
+ , NSS_WIFILI_STATS_WBM_MAX
+ , lbuf, size_wr, size_al);
spin_unlock_bh(&nss_top_main.stats_lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n");
}