Skip to content
Snippets Groups Projects
Commit 46032701 authored by Amit Kumar's avatar Amit Kumar Committed by Rahul Thakur
Browse files

qosmngr: accumulation of stats done based on driver does read and reset of stats or read.

parent 0a3ee19d
Branches Ticket_6746
No related tags found
1 merge request!10qosmngr: accumulation of stats done based on driver does read and reset of stats or read.
Pipeline #40489 failed
......@@ -203,6 +203,7 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
{
int index;
int ret = 0;
int is_read_and_reset;
// Initialize global q_stat global struct
if (init_flag) {
......@@ -214,7 +215,7 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
init_flag = 0;
}
ret = qos_get_stats(ifname, qid, stats);
ret = qos_get_stats(ifname, qid, stats, &is_read_and_reset);
if (ret != 0) {
syslog(LOG_ERR, "blob_get_status: ret %d\n", ret);
return ret;
......@@ -222,10 +223,19 @@ static int prepare_stats_blob(struct blob_buf *b, struct qos_stats *stats, void
index = get_interface_index(ifname);
q_stat[index][qid].tx_packets += stats->tx_packets;
q_stat[index][qid].tx_bytes += stats->tx_bytes;
q_stat[index][qid].tx_dropped_packets += stats->tx_dropped_packets;
q_stat[index][qid].tx_dropped_bytes += stats->tx_dropped_bytes;
/*BCM968 CHIP, stats read from driver is accunulated stats, while in other its read and reset */
if (!is_read_and_reset) {
q_stat[index][qid].tx_packets = stats->tx_packets;
q_stat[index][qid].tx_bytes = stats->tx_bytes;
q_stat[index][qid].tx_dropped_packets = stats->tx_dropped_packets;
q_stat[index][qid].tx_dropped_bytes = stats->tx_dropped_bytes;
}
else {
q_stat[index][qid].tx_packets += stats->tx_packets;
q_stat[index][qid].tx_bytes += stats->tx_bytes;
q_stat[index][qid].tx_dropped_packets += stats->tx_dropped_packets;
q_stat[index][qid].tx_dropped_bytes += stats->tx_dropped_bytes;
}
dd = blobmsg_open_table(b, "");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment