[qca-nss-drv] Add payload free count statistic

Add additional field to n2h stat structure

CRs-Fixed: 785448

Change-Id: Idbfbdd909c2fbb03173f81e8d45b358f6658bff0
Signed-off-by: Thomas Wu <wthomas@codeaurora.org>
diff --git a/exports/nss_n2h.h b/exports/nss_n2h.h
index 154a06c..b8d363b 100644
--- a/exports/nss_n2h.h
+++ b/exports/nss_n2h.h
@@ -1,6 +1,6 @@
 /*
  **************************************************************************
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014 - 2015, 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.
@@ -81,6 +81,7 @@
 					/* Pbuf Default Stats */
 
 	uint32_t payload_alloc_fails;	/* Number of payload alloc failures */
+	uint32_t payload_free_count;	/* Number of payload alloc failures */
 
 	uint32_t h2n_ctrl_pkts;		/* Control packets received from HLOS */
 	uint32_t h2n_ctrl_bytes;	/* Control bytes received from HLOS */
diff --git a/nss_core.h b/nss_core.h
index d088084..e8e6430 100755
--- a/nss_core.h
+++ b/nss_core.h
@@ -408,8 +408,8 @@
 	NSS_STATS_N2H_PBUF_DEFAULT_FREE_COUNT,	/* Number of pbuf default free count */
 	NSS_STATS_N2H_PBUF_DEFAULT_TOTAL_COUNT,	/* Number of pbuf default total count */
 
-	NSS_STATS_N2H_PAYLOAD_ALLOC_FAILS,
-					/* Number of pbuf allocations that have failed because there were no free payloads */
+	NSS_STATS_N2H_PAYLOAD_ALLOC_FAILS,	/* Number of pbuf allocations that have failed because there were no free payloads */
+	NSS_STATS_N2H_PAYLOAD_FREE_COUNT,	/* Number of free payloads that exist */
 
 	NSS_STATS_N2H_H2N_CONTROL_PACKETS,	/* Control packets received from HLOS */
 	NSS_STATS_N2H_H2N_CONTROL_BYTES,	/* Control bytes received from HLOS */
diff --git a/nss_n2h.c b/nss_n2h.c
index f1b46d8..883f69b 100755
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -84,6 +84,7 @@
 	 * payload mgr stats
 	 */
 	nss_ctx->stats_n2h[NSS_STATS_N2H_PAYLOAD_ALLOC_FAILS] += nnss->payload_alloc_fails;
+	nss_ctx->stats_n2h[NSS_STATS_N2H_PAYLOAD_FREE_COUNT] = nnss->payload_free_count;
 
 	/*
 	 * Host <=> NSS control traffic stats
diff --git a/nss_stats.c b/nss_stats.c
index 2864c9e..a085f1c 100644
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -115,6 +115,7 @@
 	"pbuf_default_free_count",
 	"pbuf_default_total_count",
 	"payload_fails",
+	"payload_free_count",
 	"h2n_control_packets",
 	"h2n_control_bytes",
 	"n2h_control_packets",