[qca-nss-drv] MQ stats

Stats to account for dropped packet count per queue.
Decided to account only dropped count for MQ due to
performance hit. Other stats, ( rx_packet, tx_packets)
shows aggregate and queue level stats are not available
for those.

Change-Id: Iee3bca74ac6de084584ec6e88d32084a950c8814
Signed-off-by: ratheesh kannoth <rkannoth@codeaurora.org>
Signed-off-by: Kiran Kumar C.S.K <kkumarcs@codeaurora.org>
diff --git a/nss_edma.c b/nss_edma.c
index ed63365..bfcca62 100644
--- a/nss_edma.c
+++ b/nss_edma.c
@@ -33,7 +33,7 @@
  */
 static void nss_edma_metadata_port_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_port_stats_sync *nepss)
 {
-	uint16_t i, j = 0;
+	int i;
 	struct nss_top_instance *nss_top = nss_ctx->nss_top;
 
 	spin_lock_bh(&nss_top->stats_lock);
@@ -43,16 +43,20 @@
 	 * We process a subset of port stats since msg payload is not enough to hold all ports at once.
 	 */
 	for (i = nepss->start_port; i < nepss->end_port; i++) {
-		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_RX_PKTS] += nepss->port_stats[j].node_stats.rx_packets;
-		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_RX_BYTES] += nepss->port_stats[j].node_stats.rx_bytes;
-		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_RX_DROPPED] += nepss->port_stats[j].node_stats.rx_dropped;
-		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_TX_PKTS] += nepss->port_stats[j].node_stats.tx_packets;
-		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_TX_BYTES] += nepss->port_stats[j].node_stats.tx_bytes;
+		int k;
 
-		nss_top->stats_edma.port[i].port_type = nepss->port_stats[j].port_type;
-		nss_top->stats_edma.port[i].port_ring_map[NSS_EDMA_PORT_RX_RING] = nepss->port_stats[j].edma_rx_ring;
-		nss_top->stats_edma.port[i].port_ring_map[NSS_EDMA_PORT_TX_RING] = nepss->port_stats[j].edma_tx_ring;
-		j++;
+		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_RX_PKTS] += nepss->port_stats[i].node_stats.rx_packets;
+		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_RX_BYTES] += nepss->port_stats[i].node_stats.rx_bytes;
+		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_TX_PKTS] += nepss->port_stats[i].node_stats.tx_packets;
+		nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_TX_BYTES] += nepss->port_stats[i].node_stats.tx_bytes;
+
+		for (k = 0; k < NSS_MAX_NUM_PRI; k++) {
+			nss_top->stats_edma.port[i].port_stats[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + k] += nepss->port_stats[i].node_stats.rx_dropped[k];
+		}
+
+		nss_top->stats_edma.port[i].port_type = nepss->port_stats[i].port_type;
+		nss_top->stats_edma.port[i].port_ring_map[NSS_EDMA_PORT_RX_RING] = nepss->port_stats[i].edma_rx_ring;
+		nss_top->stats_edma.port[i].port_ring_map[NSS_EDMA_PORT_TX_RING] = nepss->port_stats[i].edma_tx_ring;
 	}
 
 	spin_unlock_bh(&nss_top->stats_lock);
@@ -64,7 +68,7 @@
  */
 static void nss_edma_metadata_ring_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_edma_ring_stats_sync *nerss)
 {
-	int32_t i;
+	int i;
 	struct nss_top_instance *nss_top = nss_ctx->nss_top;
 
 	spin_lock_bh(&nss_top->stats_lock);