[PATCH v5] wifi: mt76: mt7915: report tx retries/failed counts for non-WED path

Ryder Lee Ryder.Lee at mediatek.com
Tue May 9 11:10:40 PDT 2023


On Tue, 2023-05-09 at 11:26 +0800, Ryder Lee wrote:
> Get missing tx retries/failed counts from txfree done events and
> report
> them via mt7915_sta_statistics().
> 
> Co-developed-by: Peter Chiu <chui-hao.chiu at mediatek.com>
> Signed-off-by: Peter Chiu <chui-hao.chiu at mediatek.com>
> Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
> ---
> v5 - fix noacked
> v4 - switch from Tx latency report to enable Tx count in txfree path
> for non-v3 format
> v3 - add a missing check for mt7921
> v2 - add a missing check for non-v3 format
> ---
>  .../wireless/mediatek/mt76/mt76_connac_mac.c  |  7 ++++--
>  .../net/wireless/mediatek/mt76/mt7915/init.c  |  2 ++
>  .../net/wireless/mediatek/mt76/mt7915/mac.c   | 22
> +++++++++++++++++--
>  .../net/wireless/mediatek/mt76/mt7915/mac.h   |  7 +++++-
>  .../net/wireless/mediatek/mt76/mt7915/main.c  | 12 +++++-----
>  .../net/wireless/mediatek/mt76/mt7915/regs.h  |  3 +++
>  6 files changed, 42 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> index ee0fbfcd07d6..6b515f330976 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> @@ -728,16 +728,19 @@ bool mt76_connac2_mac_add_txs_skb(struct
> mt76_dev *dev, struct mt76_wcid *wcid,
>  	skb = mt76_tx_status_skb_get(dev, wcid, pid, &list);
>  	if (skb) {
>  		struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
> -		bool noacked = !(info->flags & IEEE80211_TX_STAT_ACK);
> +		bool noacked;
>  
>  		if (!(le32_to_cpu(txs_data[0]) &
> MT_TXS0_ACK_ERROR_MASK))
>  			info->flags |= IEEE80211_TX_STAT_ACK;
>  
> +		noacked = !(info->flags & IEEE80211_TX_STAT_ACK);
>  		info->status.ampdu_len = 1;
>  		info->status.ampdu_ack_len = !noacked;
>  		info->status.rates[0].idx = -1;
>  
> -		wcid->stats.tx_failed += noacked;
> +		/* avoid double counting if dev supports txfree event
> */
> +		if (is_mt7921(dev))
> +			wcid->stats.tx_failed += noacked;
@Deren, can you help to check if mt7921 can drop this  and calculate
tx_failed from txfree directly?

Ryder


More information about the Linux-mediatek mailing list