qcacmn: Ratelimit the tso descriptor alloc failure

In cases were all the tso tx descriptors are outstanding,
the alloc for any subsequent tso packet will fail.
This failure to get a tso tx descriptor floods the
console with failure logs.

Ratelimit the tso descriptor allocation failure and
increment the alloc failure in stats to get the exact
number of times the allocation failed.

CRs-Fixed: 2572580
Change-Id: I789788b917421be99df5435ad858d715ef0f5c8e
diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h
index 3288fef..71f3794 100644
--- a/dp/inc/cdp_txrx_stats_struct.h
+++ b/dp/inc/cdp_txrx_stats_struct.h
@@ -505,6 +505,8 @@
  * @num_tso_pkts: Total number of TSO Packets
  * @tso_comp: Total tso packet completions
  * @dropped_host: TSO packets dropped by host
+ * @tso_no_mem_dropped: TSO packets dropped by host due to descriptor
+			unavailablity
  * @dropped_target: TSO packets_dropped by target
  * @tso_info: Per TSO packet counters
  * @seg_histogram: TSO histogram stats
@@ -513,6 +515,7 @@
 	struct cdp_pkt_info num_tso_pkts;
 	uint32_t tso_comp;
 	struct cdp_pkt_info dropped_host;
+	struct cdp_pkt_info tso_no_mem_dropped;
 	uint32_t dropped_target;
 #ifdef FEATURE_TSO_STATS
 	struct cdp_tso_info tso_info;
diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c
index 1e3b77e..921c757 100644
--- a/dp/wifi3.0/dp_tx.c
+++ b/dp/wifi3.0/dp_tx.c
@@ -585,8 +585,10 @@
 			tso_info->tso_seg_list = tso_seg;
 			num_seg--;
 		} else {
-			DP_TRACE(ERROR, "%s: Failed to alloc tso seg desc",
-				 __func__);
+			dp_err_rl("Failed to alloc tso seg desc");
+			DP_STATS_INC_PKT(vdev->pdev,
+					 tso_stats.tso_no_mem_dropped, 1,
+					 qdf_nbuf_len(msdu));
 			dp_tx_free_remaining_tso_desc(soc, msdu_info, false);
 
 			return QDF_STATUS_E_NOMEM;