wifi: rtw89: fix injected retry limit and NO_ACK TX status
v2 cover wifi: rtw89: fix injected retry limit and NO_ACK TX status
Follow-up fixes for injected retry handling and NO_ACK TX status reporting in rtw89, tested on RTL8852AE.
Changes in v2:
- Patch 1: reword commit message, keep RTW89_TX_DATA_CNT_LMT_MAX and use min() with IEEE80211_MAX_TX_RETRY, drop extra parentheses around '&', and drop unnecessary flag clearing in rtw89_tx_rpt_tx_status().
- Patch 2: keep pci tx_ring counters unchanged, skip TX failure debug log when NOACK_TRANSMITTED is set, drop unnecessary flag clearing, drop Fixes/Cc: stable tags, and reword commit message.
v1: https://lore.kernel.org/linux-wireless/[email protected]/
Enver Ikromov (2):
wifi: rtw89: fix retry limit and NO_ACK status for injected frames
wifi: rtw89: pci: fix NO_ACK TX status reporting
drivers/net/wireless/realtek/rtw89/core.c | 5 +++-- drivers/net/wireless/realtek/rtw89/mac.h | 11 ++++++----- drivers/net/wireless/realtek/rtw89/pci.c | 12 ++++++++---- 3 files changed, 17 insertions(+), 11 deletions(-)
base-commit: 18d0bedbb5f0538396cb7f763ed9cd1dd69c5b23
Signature · 1 line
2.53.0
PATCH v2 1/2 wifi: rtw89: fix retry limit and NO_ACK status for injected frames
mac80211 clears IEEE80211_TX_CTRL_RATE_INJECT if the injected rate is unsupported, but still fills rates[0].count. Check RATE_INJECT before applying rates[0].count in rtw89_core_tx_update_injection().
Cap hw->max_rate_tries at min(RTW89_TX_DATA_CNT_LMT_MAX, IEEE80211_MAX_TX_RETRY) so radiotap retry counts do not overflow the 5-bit rates[0].count field.
In rtw89_tx_rpt_tx_status(), setting IEEE80211_TX_STAT_NOACK_TRANSMITTED on dropped NO_ACK skbs (MACID_DROP or LIFE_TIME) makes mac80211 count them as transmitted instead of failed. Only set NOACK_TRANSMITTED on RTW89_TX_DONE, or on RTW89_TX_RETRY_LIMIT for AX unicast NO_ACK frames sent once with tx_cnt_lmt = 1, and do not set IEEE80211_TX_STAT_ACK on NO_ACK frames.
--- drivers/net/wireless/realtek/rtw89/core.c | 5 +++-- drivers/net/wireless/realtek/rtw89/mac.h | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtw89/core.c +3 -2
@@ -1274,7 +1274,8 @@ static void rtw89_core_tx_update_injection(struct rtw89_dev *rtwdev, desc_info->no_ack = true; desc_info->tx_cnt_lmt_en = true; desc_info->tx_cnt_lmt =1 ; - }else if (info->control.rates[0 ].count) { + }else if (info->control.flags &IEEE80211_TX_CTRL_RATE_INJECT && + info->control.rates[0 ].count) { desc_info->tx_cnt_lmt_en = true; desc_info->tx_cnt_lmt = info->control.rates[0 ].count; }
@@ -7561,7 +7562,7 @@ static int rtw89_core_register_hw(struct rtw89_dev *rtwdev) hw->queues =IEEE80211_NUM_ACS ; hw->max_rx_aggregation_subframes = chip->max_rx_agg_num; hw->max_tx_aggregation_subframes = chip->max_tx_agg_num; - hw->max_rate_tries =RTW89_TX_DATA_CNT_LMT_MAX ; + hw->max_rate_tries =min (RTW89_TX_DATA_CNT_LMT_MAX ,IEEE80211_MAX_TX_RETRY ); hw->uapsd_max_sp_len =IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL ; hw->radiotap_mcs_details |= IEEE80211_RADIOTAP_MCS_HAVE_FEC |
drivers/net/wireless/realtek/rtw89/mac.h +6 -5
@@ -1896,12 +1896,13 @@ void rtw89_tx_rpt_tx_status(struct rtw89_dev *rtwdev, struct sk_buff *skb, info =IEEE80211_SKB_CB (skb);ieee80211_tx_info_clear_status (info); -if (info->flags &IEEE80211_TX_CTL_NO_ACK ) - info->flags |=IEEE80211_TX_STAT_NOACK_TRANSMITTED ; -if (tx_status ==RTW89_TX_DONE ) +if (info->flags &IEEE80211_TX_CTL_NO_ACK ) { +if (tx_status ==RTW89_TX_DONE || + tx_status ==RTW89_TX_RETRY_LIMIT ) + info->flags |=IEEE80211_TX_STAT_NOACK_TRANSMITTED ; + }else if (tx_status ==RTW89_TX_DONE ) { info->flags |=IEEE80211_TX_STAT_ACK ; -else - info->flags &= ~IEEE80211_TX_STAT_ACK ; + }ieee80211_tx_status_irqsafe (rtwdev->hw, skb); }
Signature · 1 line
2.53.0
RE: [PATCH rtw-next v2 1/2] wifi: rtw89: fix retry limit and NO_ACK status for injected frames
Quoted 15 lines · Enver Ikromov
mac80211 clears
IEEE80211_TX_CTRL_RATE_INJECTif the injected rate is unsupported, but still fills rates[0].count. CheckRATE_INJECTbefore applying rates[0].count inrtw89_core_tx_update_injection().Cap
hw->max_rate_triesatmin(RTW89_TX_DATA_CNT_LMT_MAX, IEEE80211_MAX_TX_RETRY)so radiotap retry counts do not overflow the 5-bit rates[0].count field.In
rtw89_tx_rpt_tx_status(), settingIEEE80211_TX_STAT_NOACK_TRANSMITTEDon droppedNO_ACKskbs (MACID_DROPorLIFE_TIME) makes mac80211 count them as transmitted instead of failed. Only setNOACK_TRANSMITTEDonRTW89_TX_DONE, or onRTW89_TX_RETRY_LIMITfor AX unicastNO_ACKframes sent once withtx_cnt_lmt= 1, and do not setIEEE80211_TX_STAT_ACKonNO_ACKframes.
Quoted 8 lines
Fixes 92608bb5f14f ("wifi: rtw89: honor ASSIGN_SEQ, retries, and NO_ACK for injected frames")Reported-by Luka Gejak <[email protected]>Reported-by Ahmet Zeren <[email protected]>Closes:
https://lore.kernel.org/linux-wireless/Qmyu_zaapR7fisQhYB1W9CDM3OG849otNXR4xWRbIaRocvy40VyY4N2Jte4
[email protected]/Signed-off-by Enver Ikromov <[email protected]>
Ping-Ke Shih
maintainerRe: [PATCH rtw-next v2 1/2] wifi: rtw89: fix retry limit and NO_ACK status for injected frames
In reply to Enver IkromovQuoted 15 lines · Enver Ikromov
mac80211 clears
IEEE80211_TX_CTRL_RATE_INJECTif the injected rate is unsupported, but still fills rates[0].count. CheckRATE_INJECTbefore applying rates[0].count inrtw89_core_tx_update_injection().Cap
hw->max_rate_triesatmin(RTW89_TX_DATA_CNT_LMT_MAX, IEEE80211_MAX_TX_RETRY)so radiotap retry counts do not overflow the 5-bit rates[0].count field.In
rtw89_tx_rpt_tx_status(), settingIEEE80211_TX_STAT_NOACK_TRANSMITTEDon droppedNO_ACKskbs (MACID_DROPorLIFE_TIME) makes mac80211 count them as transmitted instead of failed. Only setNOACK_TRANSMITTEDonRTW89_TX_DONE, or onRTW89_TX_RETRY_LIMITfor AX unicastNO_ACKframes sent once withtx_cnt_lmt= 1, and do not setIEEE80211_TX_STAT_ACKonNO_ACKframes.
Quoted 7 lines
Fixes 92608bb5f14f ("wifi: rtw89: honor ASSIGN_SEQ, retries, and NO_ACK for injected frames")Reported-by Luka Gejak <[email protected]>Reported-by Ahmet Zeren <[email protected]>Closes https://lore.kernel.org/linux-wireless/Qmyu_zaapR7fisQhYB1W9CDM3OG849otNXR4xWRbIaRocvy40VyY4N2Jte4IHqD33nCI_txHle2bL5F7S0b6Bv_uXvCyk9MJ35CFHWzopyE=@proton.me/ open hereSigned-off-by Enver Ikromov <[email protected]>Acked-by Ping-Ke Shih <[email protected]>
2 patch(es) applied to rtw-next branch of rtw.git, thanks.
f754e82fe7ba wifi: rtw89: fix retry limit and NO_ACK status for injected frames 3726cfb25e29 wifi: rtw89: pci: fix NO_ACK TX status reporting
PATCH v2 2/2 wifi: rtw89: pci: fix NO_ACK TX status reporting
In reply to Enver IkromovPCIe devices report TX status via rtw89_pci_tx_status() rather than rtw89_tx_rpt_tx_status(). Currently it sets IEEE80211_TX_STAT_NOACK_TRANSMITTED even when a NO_ACK skb was dropped (MACID_DROP or LIFE_TIME), so mac80211 counts dropped frames as sent, and it also sets IEEE80211_TX_STAT_ACK on RTW89_TX_DONE.
Only set NOACK_TRANSMITTED on RTW89_TX_DONE or RTW89_TX_RETRY_LIMIT, skip the TX failure debug log in that case, and do not set IEEE80211_TX_STAT_ACK for NO_ACK frames.
--- drivers/net/wireless/realtek/rtw89/pci.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/pci.c +8 -4
@@ -470,13 +470,17 @@ static void rtw89_pci_tx_status(struct rtw89_dev *rtwdev, info =IEEE80211_SKB_CB (skb);ieee80211_tx_info_clear_status (info); -if (info->flags &IEEE80211_TX_CTL_NO_ACK ) - info->flags |=IEEE80211_TX_STAT_NOACK_TRANSMITTED ;if (tx_status ==RTW89_TX_DONE ) { - info->flags |=IEEE80211_TX_STAT_ACK ; +if (info->flags &IEEE80211_TX_CTL_NO_ACK ) + info->flags |=IEEE80211_TX_STAT_NOACK_TRANSMITTED ; +else + info->flags |=IEEE80211_TX_STAT_ACK ; tx_ring->tx_acked++; }else { -if (info->flags &IEEE80211_TX_CTL_REQ_TX_STATUS ) +if (info->flags &IEEE80211_TX_CTL_NO_ACK && + tx_status ==RTW89_TX_RETRY_LIMIT ) + info->flags |=IEEE80211_TX_STAT_NOACK_TRANSMITTED ; +else if (info->flags &IEEE80211_TX_CTL_REQ_TX_STATUS )rtw89_debug (rtwdev,RTW89_DBG_FW ,"failed to TX of status %x\n" , tx_status);switch (tx_status) {
Signature · 1 line
2.53.0
RE: [PATCH rtw-next v2 2/2] wifi: rtw89: pci: fix NO_ACK TX status reporting
Quoted 11 lines · Enver Ikromov
PCIe devices report TX status via
rtw89_pci_tx_status()rather thanrtw89_tx_rpt_tx_status(). Currently it setsIEEE80211_TX_STAT_NOACK_TRANSMITTEDeven when aNO_ACKskb was dropped (MACID_DROPorLIFE_TIME), so mac80211 counts dropped frames as sent, and it also setsIEEE80211_TX_STAT_ACKonRTW89_TX_DONE.Only set
NOACK_TRANSMITTEDonRTW89_TX_DONEorRTW89_TX_RETRY_LIMIT, skip the TX failure debug log in that case, and do not setIEEE80211_TX_STAT_ACKforNO_ACKframes.Signed-off-by Enver Ikromov <[email protected]>