wifi: ath11k: firmware airtime fairness, BSS color while disabled
cover wifi: ath11k: firmware airtime fairness, BSS color while disabled
Two ath11k patches that need the mac80211 changes in "[PATCH wireless-next 0/2] wifi: mac80211: airtime weight op, BSS color during a color change" (<[email protected]>):
1. Firmware airtime fairness (ATF) on the QCN9074 and IPQ5018, using Felix Fietkau's sta_set_airtime_weight op. Changes since v2: the command ID and TLV tags sit in their enums; a radio whose firmware refuses ATF keeps working without it; the commit message says the 122 Mbit/s cap was measured with the firmware's strict scheduling set, which the patch does not do.
2. Keep the BSS color in the vdev parameter while the color is disabled during a color change (IEEE Std 802.11-2024, 26.11.4); with mac80211 now keeping the color, the firmware gets it instead of 0.
They are based on ath-next with that series applied, and can wait for it to reach ath-next.
The patches by me were written with an AI coding assistant (Claude Code), which also drafted the changelogs; the testing described was done on the hardware.
v2 also carried beacon protection, now dropped: with the firmware signing beacons, a client that enforces beacon protection (Intel BE200, iwlmld) lost every beacon on QCN9074 and IPQ5018, with either BIGTK index and with or without a host-built MME. Until it is known what the firmware needs, BIP stays in software and the feature is not advertised.
v2: https://lore.kernel.org/all/[email protected]/
Andrei-Alexandru Bleortu (2):
wifi: ath11k: support firmware airtime fairness
wifi: ath11k: keep the BSS color while it is disabled
drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 116 +++++++++++++++++++++++-- drivers/net/wireless/ath/ath11k/wmi.c | 97 +++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.h | 51 +++++++++++ 4 files changed, 260 insertions(+), 5 deletions(-)
base-commit: f49defea7668d8c68ec19fa085ef3da6075561c7
prerequisite-patch-id: 0ce384d8e432a5ffedf43b8e02dd2576a52fb3fb
prerequisite-patch-id: f606f9dee7c5cdf33bf5f06e985885fd9deaf90a
Signature · 1 line
2.47.3
PATCH 1/2 wifi: ath11k: support firmware airtime fairness
Firmware with WMI_TLV_SERVICE_ATF schedules airtime between stations itself, in proportion to per-station shares the host gives it in parts per thousand. Enable it at init (resource config flag) and on each radio, advertise NL80211_EXT_FEATURE_AIRTIME_FAIRNESS, and send the shares of all AP stations of the radio, derived from their airtime weights (sta_set_airtime_weight), whenever a station associates or leaves or user space changes a weight. A radio whose firmware refuses to enable it keeps working, without ATF.
The firmware schedules a station only within the share of its ATF group, so group 0, which every station belongs to, first gets the whole radio (WMI_ATF_SSID_GROUPING_REQUEST_CMDID, fair policy). Without the group, the firmware passes no data at all to a station that has a share.
Both are needed: without the resource config flag the firmware takes the shares but does not enforce them. With them, in a test that also set the firmware's strict scheduling for the station (which this patch does not do), a station capped at 100/1000 fell from 885 to 122 Mbit/s downlink and recovered once uncapped; at its fair share a lone station runs at full rate.
This matters most where the data path does not pass mac80211's queues, such as NSS offload, where mac80211's own airtime scheduler never sees the frames.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/mac.c | 104 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.c | 97 +++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.h | 51 ++++++++++++ 4 files changed, 253 insertions(+)
drivers/net/wireless/ath/ath11k/core.h +1 -0
@@ -541,6 +541,7 @@ struct ath11k_per_peer_cfr_capture {struct ath11k_sta {struct ath11k_vif *arvif; +u16 airtime_weight;/* the following are protected by ar->data_lock */ u32 changed;/* IEEE80211_RC_* */
drivers/net/wireless/ath/ath11k/mac.c +104 -0
146 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.c +97 -0
109 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.h +51 -0
87 lines not on this page · raw message
Signature · 1 line
2.47.3
PATCH 2/2 wifi: ath11k: keep the BSS color while it is disabled
In reply to Andrei-Alexandru BleortuWhile the BSS Color Disabled subfield is 1, an HE STA shall keep advertising its nonzero BSS color in the TXVECTOR of the HE PPDUs it transmits (IEEE Std 802.11-2024, 26.11.4). hostapd disables the color while it counts down to a color change, and ath11k then set the vdev's BSS color parameter to "disabled" with color 0.
Keep the color in the parameter and add the disabled flag to it.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath11k/mac.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +7 -5
@@ -3812,12 +3812,14 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,ath11k_warn (ar->ab,"failed to set bss color collision on vdev %i: %d\n" , arvif->vdev_id, ret); +/* A disabled color stays in the PPDUs the AP transmits +* (IEEE Std 802.11-2024, 26.11.4) +*/ param_id =WMI_VDEV_PARAM_BSS_COLOR ; -if (info->he_bss_color.enabled) - param_value = info->he_bss_color.color << -IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET ; -else - param_value =IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED ; + param_value = info->he_bss_color.color << +IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET ; +if (!info->he_bss_color.enabled) + param_value |=IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED ; ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param_id,
Signature · 1 line
2.47.3