From 74368919c538fa825a121eddc8af26194eca0acc Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Mon, 25 Nov 2019 17:42:19 +0530 Subject: [PATCH] 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 --- dp/inc/cdp_txrx_stats_struct.h | 3 +++ dp/wifi3.0/dp_tx.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 3288fef65a..71f3794823 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -505,6 +505,8 @@ struct cdp_tso_info { * @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_tso_stats { 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 1e3b77e44a..921c757280 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -585,8 +585,10 @@ static QDF_STATUS dp_tx_prepare_tso(struct dp_vdev *vdev, 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;