[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_n2h.c b/nss_n2h.c
index 6acf338..3d6d303 100644
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -58,6 +58,7 @@
 static void nss_n2h_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_n2h_stats_sync *nnss)
 {
 	struct nss_top_instance *nss_top = nss_ctx->nss_top;
+	int j;
 
 	spin_lock_bh(&nss_top->stats_lock);
 
@@ -66,10 +67,13 @@
 	 */
 	nss_ctx->stats_n2h[NSS_STATS_NODE_RX_PKTS] += nnss->node_stats.rx_packets;
 	nss_ctx->stats_n2h[NSS_STATS_NODE_RX_BYTES] += nnss->node_stats.rx_bytes;
-	nss_ctx->stats_n2h[NSS_STATS_NODE_RX_DROPPED] += nnss->node_stats.rx_dropped;
 	nss_ctx->stats_n2h[NSS_STATS_NODE_TX_PKTS] += nnss->node_stats.tx_packets;
 	nss_ctx->stats_n2h[NSS_STATS_NODE_TX_BYTES] += nnss->node_stats.tx_bytes;
 
+	for (j = 0; j < NSS_MAX_NUM_PRI; j++) {
+		nss_ctx->stats_n2h[NSS_STATS_NODE_RX_QUEUE_0_DROPPED + j] += nnss->node_stats.rx_dropped[j];
+	}
+
 	/*
 	 * General N2H stats
 	 */
@@ -1099,6 +1103,14 @@
 		return NSS_TX_SUCCESS;
 	}
 
+	/*
+	 * MQ mode doesnot make any sense if number of priority queues in NSS
+	 * is 1
+	 */
+	if (NSS_MAX_NUM_PRI <= 1) {
+		return NSS_TX_SUCCESS;
+	}
+
 	memset(&nnm, 0, sizeof(struct nss_n2h_msg));
 
 	nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE,
@@ -1141,6 +1153,14 @@
 		return NSS_TX_SUCCESS;
 	}
 
+	/*
+	 * MQ mode doesnot make any sense if number of priority queues in NSS
+	 * is 1
+	 */
+	if (NSS_MAX_NUM_PRI <= 1) {
+		return NSS_TX_SUCCESS;
+	}
+
 	memset(&nnm, 0, sizeof(struct nss_n2h_msg));
 
 	nss_n2h_msg_init(&nnm, NSS_N2H_INTERFACE,