From 74af4177a80b83dca791929fe893cd5e35ba5ff5 Mon Sep 17 00:00:00 2001 From: Chaoli Zhou Date: Mon, 12 Aug 2019 14:54:17 +0800 Subject: [PATCH] qcacld-3.0: Add packet drop status In the current wlanhost driver dump status, it doesn't support to count the dropped packets seperately that due to firmware don't have enough tx descriptors, so add such function which can benefit KPI tune. Change-Id: I1a72acbc4f1f861c2013a1ef1a95b73acccd6b53 CRs-Fixed: 2507410 --- core/dp/ol/inc/ol_txrx_htt_api.h | 3 +++ core/dp/ol/inc/ol_txrx_stats.h | 8 +++++++- core/dp/txrx/ol_txrx.c | 10 ++++++++-- core/dp/txrx/ol_txrx_internal.h | 9 +++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/core/dp/ol/inc/ol_txrx_htt_api.h b/core/dp/ol/inc/ol_txrx_htt_api.h index c6e394ba97ba..9bc38bd10c7c 100644 --- a/core/dp/ol/inc/ol_txrx_htt_api.h +++ b/core/dp/ol/inc/ol_txrx_htt_api.h @@ -117,6 +117,9 @@ enum htt_tx_status { /* no_ack - sent, but no ack */ htt_tx_status_no_ack = HTT_TX_COMPL_IND_STAT_NO_ACK, + /* drop may due to tx descriptor not enough*/ + htt_tx_status_drop = HTT_TX_COMPL_IND_STAT_DROP, + /* download_fail - host could not deliver the tx frame to target */ htt_tx_status_download_fail = HTT_HOST_ONLY_STATUS_CODE_START, }; diff --git a/core/dp/ol/inc/ol_txrx_stats.h b/core/dp/ol/inc/ol_txrx_stats.h index 4c2a073e0209..8d966a51a90d 100644 --- a/core/dp/ol/inc/ol_txrx_stats.h +++ b/core/dp/ol/inc/ol_txrx_stats.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2014-2017, 2019 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 @@ -78,6 +78,12 @@ struct ol_txrx_stats_tx_dropped { */ struct ol_txrx_stats_elem no_ack; + /* + * MSDUs which the target drop + * (lack of tx descriptor) + */ + struct ol_txrx_stats_elem target_drop; + /* MSDU which were dropped for other reasons */ struct ol_txrx_stats_elem others; }; diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index bf412d3a6198..b61a4bfaf265 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -4179,10 +4179,11 @@ void ol_txrx_stats_display(ol_txrx_pdev_handle pdev, pdev->stats.pub.tx.dropped.download_fail.pkts + pdev->stats.pub.tx.dropped.target_discard.pkts + pdev->stats.pub.tx.dropped.no_ack.pkts + + pdev->stats.pub.tx.dropped.target_drop.pkts + pdev->stats.pub.tx.dropped.others.pkts; if (level == QDF_STATS_VERBOSITY_LEVEL_LOW) { - txrx_nofl_dbg("STATS |%u %u|TX: %lld tso %lld ok %lld drops(%u-%lld %u-%lld %u-%lld ?-%lld hR-%lld)|RX: %lld drops(E %lld PI %lld ME %lld) fwd(S %d F %d SF %d)|", + txrx_nofl_dbg("STATS |%u %u|TX: %lld tso %lld ok %lld drops(%u-%lld %u-%lld %u-%lld %u-%lld ?-%lld hR-%lld)|RX: %lld drops(E %lld PI %lld ME %lld) fwd(S %d F %d SF %d)|", pdev->tx_desc.num_free, pdev->tx_desc.pool_size, pdev->stats.pub.tx.from_stack.pkts, @@ -4195,6 +4196,8 @@ void ol_txrx_stats_display(ol_txrx_pdev_handle pdev, target_discard.pkts, htt_tx_status_no_ack, pdev->stats.pub.tx.dropped.no_ack.pkts, + htt_tx_status_drop, + pdev->stats.pub.tx.dropped.target_drop.pkts, pdev->stats.pub.tx.dropped.others.pkts, pdev->stats.pub.tx.dropped.host_reject.pkts, pdev->stats.pub.rx.delivered.pkts, @@ -4219,8 +4222,9 @@ void ol_txrx_stats_display(ol_txrx_pdev_handle pdev, tx_dropped, pdev->stats.pub.tx.dropped.download_fail.bytes + pdev->stats.pub.tx.dropped.target_discard.bytes + + pdev->stats.pub.tx.dropped.target_drop.bytes + pdev->stats.pub.tx.dropped.no_ack.bytes); - txrx_nofl_info("successfully delivered: %lld (%lld B), download fail: %lld (%lld B), target discard: %lld (%lld B), no ack: %lld (%lld B) others: %lld (%lld B)", + txrx_nofl_info("successfully delivered: %lld (%lld B), download fail: %lld (%lld B), target discard: %lld (%lld B), no ack: %lld (%lld B),target drop: %lld (%lld B), others: %lld (%lld B)", pdev->stats.pub.tx.delivered.pkts, pdev->stats.pub.tx.delivered.bytes, pdev->stats.pub.tx.dropped.download_fail.pkts, @@ -4229,6 +4233,8 @@ void ol_txrx_stats_display(ol_txrx_pdev_handle pdev, pdev->stats.pub.tx.dropped.target_discard.bytes, pdev->stats.pub.tx.dropped.no_ack.pkts, pdev->stats.pub.tx.dropped.no_ack.bytes, + pdev->stats.pub.tx.dropped.target_drop.pkts, + pdev->stats.pub.tx.dropped.target_drop.bytes, pdev->stats.pub.tx.dropped.others.pkts, pdev->stats.pub.tx.dropped.others.bytes); txrx_nofl_info("Tx completions per HTT message:\n" diff --git a/core/dp/txrx/ol_txrx_internal.h b/core/dp/txrx/ol_txrx_internal.h index f663fff8baa5..dcd3e42ac56c 100644 --- a/core/dp/txrx/ol_txrx_internal.h +++ b/core/dp/txrx/ol_txrx_internal.h @@ -214,6 +214,9 @@ ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev, netbuf); \ else if (status == htt_tx_status_no_ack) \ TXRX_STATS_MSDU_INCR(pdev, tx.dropped.no_ack, netbuf); \ + else if (status == htt_tx_status_drop) \ + TXRX_STATS_MSDU_INCR(pdev, tx.dropped.target_drop, \ + netbuf); \ else if (status == htt_tx_status_download_fail) \ TXRX_STATS_MSDU_INCR(pdev, tx.dropped.download_fail, \ netbuf); \ @@ -270,6 +273,12 @@ ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev, TXRX_STATS_ADD(_pdev, pub.tx.dropped.no_ack.bytes, \ _b_cntrs); \ break; \ + case htt_tx_status_drop: \ + TXRX_STATS_ADD(_pdev, \ + pub.tx.dropped.target_drop.pkts, _p_cntrs);\ + TXRX_STATS_ADD(_pdev, \ + pub.tx.dropped.target_drop.bytes, _b_cntrs);\ + break; \ case htt_tx_status_download_fail: \ TXRX_STATS_ADD(_pdev, \ pub.tx.dropped.download_fail.pkts, _p_cntrs); \