* [PATCH] wifi: rtw88: remove rtw_txq_dequeue
@ 2026-05-02 13:15 Martin Kaiser
2026-05-06 8:44 ` Ping-Ke Shih
0 siblings, 1 reply; 2+ messages in thread
From: Martin Kaiser @ 2026-05-02 13:15 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Bitterblue Smith, linux-wireless, linux-kernel, Martin Kaiser
Remove the rtw_txq_dequeue helper. It's a wrapper around
ieee80211_tx_dequeue with just one caller.
Call ieee80211_tx_dequeue directly in rtw_txq_push. There's no need to
fetch txq for every frame, we can do this once outside of the rcu lock.
Make the loop variable i unsigned long, it should have the same type as
frames.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/net/wireless/realtek/rtw88/tx.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
index 3106edb84fb4..ea2dc9bda1b6 100644
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -619,31 +619,19 @@ static int rtw_txq_push_skb(struct rtw_dev *rtwdev,
return 0;
}
-static struct sk_buff *rtw_txq_dequeue(struct rtw_dev *rtwdev,
- struct rtw_txq *rtwtxq)
-{
- struct ieee80211_txq *txq = rtwtxq_to_txq(rtwtxq);
- struct sk_buff *skb;
-
- skb = ieee80211_tx_dequeue(rtwdev->hw, txq);
- if (!skb)
- return NULL;
-
- return skb;
-}
-
static void rtw_txq_push(struct rtw_dev *rtwdev,
struct rtw_txq *rtwtxq,
unsigned long frames)
{
+ struct ieee80211_txq *txq = rtwtxq_to_txq(rtwtxq);
struct sk_buff *skb;
int ret;
- int i;
+ unsigned long i;
rcu_read_lock();
for (i = 0; i < frames; i++) {
- skb = rtw_txq_dequeue(rtwdev, rtwtxq);
+ skb = ieee80211_tx_dequeue(rtwdev->hw, txq);
if (!skb)
break;
--
2.43.7
^ permalink raw reply related [flat|nested] 2+ messages in thread* RE: [PATCH] wifi: rtw88: remove rtw_txq_dequeue
2026-05-02 13:15 [PATCH] wifi: rtw88: remove rtw_txq_dequeue Martin Kaiser
@ 2026-05-06 8:44 ` Ping-Ke Shih
0 siblings, 0 replies; 2+ messages in thread
From: Ping-Ke Shih @ 2026-05-06 8:44 UTC (permalink / raw)
To: Martin Kaiser
Cc: Bitterblue Smith, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Martin Kaiser <martin@kaiser.cx> wrote:
> Remove the rtw_txq_dequeue helper. It's a wrapper around
> ieee80211_tx_dequeue with just one caller.
>
> Call ieee80211_tx_dequeue directly in rtw_txq_push. There's no need to
> fetch txq for every frame, we can do this once outside of the rcu lock.
>
> Make the loop variable i unsigned long, it should have the same type as
> frames.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> drivers/net/wireless/realtek/rtw88/tx.c | 18 +++---------------
> 1 file changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
> index 3106edb84fb4..ea2dc9bda1b6 100644
> --- a/drivers/net/wireless/realtek/rtw88/tx.c
> +++ b/drivers/net/wireless/realtek/rtw88/tx.c
> @@ -619,31 +619,19 @@ static int rtw_txq_push_skb(struct rtw_dev *rtwdev,
> return 0;
> }
>
> -static struct sk_buff *rtw_txq_dequeue(struct rtw_dev *rtwdev,
> - struct rtw_txq *rtwtxq)
> -{
> - struct ieee80211_txq *txq = rtwtxq_to_txq(rtwtxq);
> - struct sk_buff *skb;
> -
> - skb = ieee80211_tx_dequeue(rtwdev->hw, txq);
> - if (!skb)
> - return NULL;
> -
> - return skb;
> -}
> -
> static void rtw_txq_push(struct rtw_dev *rtwdev,
> struct rtw_txq *rtwtxq,
> unsigned long frames)
> {
> + struct ieee80211_txq *txq = rtwtxq_to_txq(rtwtxq);
> struct sk_buff *skb;
> int ret;
> - int i;
> + unsigned long i;
In reverse X'mas order.
>
> rcu_read_lock();
>
> for (i = 0; i < frames; i++) {
> - skb = rtw_txq_dequeue(rtwdev, rtwtxq);
> + skb = ieee80211_tx_dequeue(rtwdev->hw, txq);
> if (!skb)
> break;
>
> --
> 2.43.7
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-06 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-02 13:15 [PATCH] wifi: rtw88: remove rtw_txq_dequeue Martin Kaiser
2026-05-06 8:44 ` Ping-Ke Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox