From: Ping-Ke Shih <pkshih@realtek.com>
To: Fedor Pchelkin <pchelkin@ispras.ru>
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
Zong-Zhe Yang <kevin_yang@realtek.com>,
Bernie Huang <phhuang@realtek.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>
Subject: RE: [PATCH rtw-next v2 6/7] wifi: rtw89: handle IEEE80211_TX_CTL_REQ_TX_STATUS frames for USB
Date: Thu, 16 Oct 2025 00:54:11 +0000 [thread overview]
Message-ID: <164d3319d29e4a9aa3658726ee098092@realtek.com> (raw)
In-Reply-To: <20251015103403-08f19f981c70546d56ebd07a-pchelkin@ispras>
Fedor Pchelkin <pchelkin@ispras.ru> wrote:
> On Wed, 15. Oct 01:43, Ping-Ke Shih wrote:
> > > > > +
> > > > > + if (sw_define != skb_data->tx_rpt_sn)
> > > > > + continue;
> > > > > + if (tx_status != RTW89_TX_DONE &&
> > > > > + data_txcnt != skb_data->tx_pkt_cnt_lmt)
> > > >
> > > > As commit message of previous patch, "When there is a failed
> > > > TX status reported by the firmware, the report is ignored until the limit
> > > > is reached or success status appears."
> > > >
> > > > Do you still need to check data_txcnt for failed cases?
> > >
> > > The question also concerns
> > >
> > > tx_req->desc_info.tx_cnt_lmt = 8;
> > >
> > > line in rtw89_tx_rpt_enable(). 'tx_cnt_lmt' is written to TX descriptor
> > > and processed by firmware. The value defines how many times the firmware
> > > will retry transmission attempts, it will not retry more times than that.
> > >
> > > 'data_txcnt' C2H field determines the retry attempt counter for the frame
> > > returned by the firmware. If it reaches the limit, this means we got
> > > the last report from the firmware and there would be no other firmware
> > > reports for the sent frame. So a final tx_status should be taken
> > > uncondionally in this case.
> > >
> > > E.g. if 'tx_cnt_lmt' is set to 1, the firmware will try only once,
> > > 'data_txcnt' will be 1, too. The limit is reached and we should take
> > > tx_status immediately as is. So there's a higher chance of getting a
> > > failed status eventually.
> > >
> > > I set it currently to 8 as the vendor driver does. In local testing it
> > > looks more than enough. I've seen maximum of 5 retry attempts for the
> > > same frame (usually there are no retries at all) though my network radio
> > > environment is quite noisy.
> > >
> > > I'll add the tx_cnt_lmt related info to commit message for clarity.
> > >
> >
> > Thanks for the detail.
> >
> > 1 2 3 4 5 6 7 8
> > (a) x x x x x x x x ==> retry 8 times, but all failure. Report at 8th C2H.
> > (b) x x x o ==> retry 3 times, and 4th done. Report at 4th C2H.
> > (c) o ==> just done at first one. Report at first C2H.
> >
> > For every attempt, firmware reports a C2H with tx_status, right?
>
> Yes.
>
> > Can I say (a) case is why we should check data_txcnt?
> > For cases (b)/(c), they rely on 'tx_status == RTW89_TX_DONE'.
>
> We should somehow determine in case (a) when those 8 attempts for the
> frame have passed and then promptly give the report with a failed status
> up to the wireless stack. To my mind, without checking data_txcnt
> rtw89_mac_c2h_tx_rpt() can't determine the time when to do an actual
> report if every retry attempt has failed.
>
> Otherwise skb would remain in the queue being unreported until HCI reset
> takes place, though we already had a chance to report it as failed.
Got it.
By the way, I'd list case (d) which TX done at 8th retry and can be handled
properly as well.
1 2 3 4 5 6 7 8
(d) x x x x x x x o ==> retry 8 times, and finally done. Report at 8th C2H.
next prev parent reply other threads:[~2025-10-16 0:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 20:08 [PATCH rtw-next v2 0/7] wifi: rtw89: improvements for USB part Fedor Pchelkin
2025-10-02 20:08 ` [PATCH rtw-next v2 1/7] wifi: rtw89: usb: use common error path for skbs in rtw89_usb_rx_handler() Fedor Pchelkin
2025-10-07 2:46 ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 2/7] wifi: rtw89: usb: fix leak in rtw89_usb_write_port() Fedor Pchelkin
2025-10-02 20:08 ` [PATCH rtw-next v2 3/7] wifi: rtw89: usb: use ieee80211_free_txskb() where appropriate Fedor Pchelkin
2025-10-07 2:51 ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 4/7] wifi: rtw89: refine rtw89_core_tx_wait_complete() Fedor Pchelkin
2025-10-07 2:54 ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 5/7] wifi: rtw89: implement C2H TX report handler Fedor Pchelkin
2025-10-07 3:13 ` Ping-Ke Shih
2025-10-02 20:08 ` [PATCH rtw-next v2 6/7] wifi: rtw89: handle IEEE80211_TX_CTL_REQ_TX_STATUS frames for USB Fedor Pchelkin
2025-10-07 6:31 ` Ping-Ke Shih
2025-10-14 21:23 ` Fedor Pchelkin
2025-10-15 1:43 ` Ping-Ke Shih
2025-10-15 7:51 ` Fedor Pchelkin
2025-10-16 0:54 ` Ping-Ke Shih [this message]
2025-10-17 10:06 ` Fedor Pchelkin
2025-10-02 20:08 ` [PATCH rtw-next v2 7/7] wifi: rtw89: process TX wait skbs for USB via C2H handler Fedor Pchelkin
2025-10-03 2:23 ` Zong-Zhe Yang
2025-10-07 8:07 ` Ping-Ke Shih
2025-10-11 16:06 ` Fedor Pchelkin
2025-10-13 0:59 ` Ping-Ke Shih
2025-10-04 17:37 ` [PATCH rtw-next v2 0/7] wifi: rtw89: improvements for USB part Bitterblue Smith
2025-10-11 14:57 ` Fedor Pchelkin
2025-10-11 22:49 ` Bitterblue Smith
2025-10-14 21:33 ` Fedor Pchelkin
2025-10-20 13:52 ` Bitterblue Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=164d3319d29e4a9aa3658726ee098092@realtek.com \
--to=pkshih@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=pchelkin@ispras.ru \
--cc=phhuang@realtek.com \
--cc=rtl8821cerfe2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox