From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <timlee@realtek.com>, <phhuang@realtek.com>, <kevin_yang@realtek.com>
Subject: [PATCH rtw-next 12/13] wifi: rtw89: Recalculate station aggregates when AMSDU length changes for MLO links
Date: Tue, 10 Mar 2026 16:01:45 +0800 [thread overview]
Message-ID: <20260310080146.31113-13-pkshih@realtek.com> (raw)
In-Reply-To: <20260310080146.31113-1-pkshih@realtek.com>
From: Po-Hao Huang <phhuang@realtek.com>
Currently, AMSDU length is updated per-link for MLO but not propagated
to the station aggregates, causing suboptimal TX throughput. This change
ensures station aggregates are recalculated when any link's AMSDU length
changes.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/phy.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index 0fa4d8d791f1..3a241738ac06 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -3213,7 +3213,8 @@ struct rtw89_phy_iter_ra_data {
static void __rtw89_phy_c2h_ra_rpt_iter(struct rtw89_sta_link *rtwsta_link,
struct ieee80211_link_sta *link_sta,
- struct rtw89_phy_iter_ra_data *ra_data)
+ struct rtw89_phy_iter_ra_data *ra_data,
+ bool *changed)
{
struct rtw89_dev *rtwdev = ra_data->rtwdev;
const struct rtw89_c2h_ra_rpt *c2h =
@@ -3222,7 +3223,7 @@ static void __rtw89_phy_c2h_ra_rpt_iter(struct rtw89_sta_link *rtwsta_link,
const struct rtw89_chip_info *chip = rtwdev->chip;
bool format_v1 = chip->chip_gen == RTW89_CHIP_BE;
u8 mode, rate, bw, giltf, mac_id;
- u16 legacy_bitrate;
+ u16 legacy_bitrate, amsdu_len;
bool valid;
u8 mcs = 0;
u8 t;
@@ -3319,7 +3320,13 @@ static void __rtw89_phy_c2h_ra_rpt_iter(struct rtw89_sta_link *rtwsta_link,
u16_encode_bits(mode, RTW89_HW_RATE_MASK_MOD) |
u16_encode_bits(rate, RTW89_HW_RATE_MASK_VAL);
ra_report->might_fallback_legacy = mcs <= 2;
- link_sta->agg.max_rc_amsdu_len = get_max_amsdu_len(rtwdev, ra_report);
+
+ amsdu_len = get_max_amsdu_len(rtwdev, ra_report);
+ if (link_sta->agg.max_rc_amsdu_len != amsdu_len) {
+ link_sta->agg.max_rc_amsdu_len = amsdu_len;
+ *changed = true;
+ }
+
rtwsta_link->max_agg_wait = link_sta->agg.max_rc_amsdu_len / 1500 - 1;
}
@@ -3330,14 +3337,18 @@ static void rtw89_phy_c2h_ra_rpt_iter(void *data, struct ieee80211_sta *sta)
struct rtw89_sta_link *rtwsta_link;
struct ieee80211_link_sta *link_sta;
unsigned int link_id;
+ bool changed = false;
rcu_read_lock();
rtw89_sta_for_each_link(rtwsta, rtwsta_link, link_id) {
link_sta = rtw89_sta_rcu_dereference_link(rtwsta_link, false);
- __rtw89_phy_c2h_ra_rpt_iter(rtwsta_link, link_sta, ra_data);
+ __rtw89_phy_c2h_ra_rpt_iter(rtwsta_link, link_sta, ra_data, &changed);
}
+ if (changed)
+ ieee80211_sta_recalc_aggregates(sta);
+
rcu_read_unlock();
}
--
2.25.1
next prev parent reply other threads:[~2026-03-10 8:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 8:01 [PATCH rtw-next 00/13] wifi: rtw89: update hardware settings and tweak for MLO Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 01/13] wifi: rtw89: mac: finish active TX immediately without waiting for DMAC Ping-Ke Shih
2026-03-12 3:00 ` Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 02/13] wifi: rtw89: pci: update SER parameters for suspend/resume Ping-Ke Shih
2026-03-16 6:53 ` Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 03/13] wifi: rtw89: mac: remove A-die off setting for RTL8852C and RTL8922A Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 04/13] wifi: rtw89: phy: limit AMPDU number for RA try rate Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 05/13] wifi: rtw89: move disabling dynamic mechanism functions to core Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 06/13] wifi: rtw89: tweak settings of TX power and channel for Wi-Fi 7 Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 07/13] wifi: rtw89: chan: simplify link handling related to ROC Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 08/13] wifi: rtw89: chan: recalc MLO DBCC mode based on current entity mode Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 09/13] wifi: rtw89: wow: add retry for ensuring packet are processed Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 10/13] wifi: rtw89: replace RF mutex with wiphy lock assertion Ping-Ke Shih
2026-03-10 8:01 ` [PATCH rtw-next 11/13] wifi: rtw89: Drop malformed AMPDU frames with abnormal PN Ping-Ke Shih
2026-03-10 8:01 ` Ping-Ke Shih [this message]
2026-03-10 8:01 ` [PATCH rtw-next 13/13] wifi: rtw89: debug: simulate Wi-Fi 7 SER L0/L1 without PS mode Ping-Ke Shih
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=20260310080146.31113-13-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=phhuang@realtek.com \
--cc=timlee@realtek.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