wifi: mt76: mt7996: use own MAC as BSS BSSID for mesh interfaces - #1132
Open
outbackdingo wants to merge 1 commit into
Open
outbackdingo wants to merge 1 commit into
outbackdingo wants to merge 1 commit into
Conversation
mac80211 deliberately leaves bss_conf.bssid as zero_addr for mesh interfaces, because an MBSS has no BSSID in the infrastructure sense: net/mac80211/mesh.c: sdata->vif.bss_conf.bssid = zero_addr; mt7996_mcu_bss_basic_tlv() copies that value into the hardware BSS entry, and the hardware stamps the programmed BSS BSSID into Address 3 of the management frames it transmits. Every Mesh Peering Management frame (Self-Protected Action, category 15) therefore leaves the radio with addr3 = 00:00:00:00:00:00. That value is wrong for the wire. mac80211's own kernel MPM puts the transmitter's MAC in addr3 (net/mac80211/mesh_plink.c: memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN)), and hostapd does the same for user-space MPM. bss_conf.bssid == zero is a "no associated BSS" marker, not a value to transmit. This breaks 802.11s interoperability with peers that filter received management frames on BSSID. Measured against an ath11k (QCN9074) peer over a 35 s window: 217 Mesh Peering Open and 194 Peering Confirm frames were transmitted and ACKed at the MAC layer, and none were delivered to the peer's host, while 108 of 400 SAE Authentication frames from the same radio -- which carry a correct addr3 -- were delivered normally. SAE therefore completes and MPM never does; the peer closes with reason 56 (MESH_MAX_RETRIES) reporting our link ID as 0. Instrumenting mt7996_tx() confirms the header is correct on entry to the driver and zeroed on air (same 25 s window: 1035 frames with addr3 = own MAC at mt7996_tx(), 915 frames with addr3 = 0 on air, captured by an independent monitor-mode station). mld=0 on every sample, so the MLD address rewrite in mt7996_tx() is not involved. With this change addr3 is correct on air and a BPI-R4 joins a three-node ath11k 802.11s/batman-adv mesh: all four nodes reach plink ESTAB and exchange batman-adv originators. Signed-off-by: outbackdingo <outbackdingo@gmail.com>
|
Shouldn't this patch get sent to upstream kernel mail list? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mt7996 transmits 802.11s Mesh Peering Management frames with
Address 3 = 00:00:00:00:00:00, which breaks mesh interoperability with peersthat filter received management frames on BSSID. A BPI-R4 (mt7996) could not
form a peering with ath11k (QCN9074) nodes.
Root cause
mac80211 deliberately leaves
bss_conf.bssidaszero_addrfor mesh interfaces,because an MBSS has no BSSID in the infrastructure sense:
mt7996_mcu_bss_basic_tlv()copies that into the hardware BSS entry(
memcpy(bss->bssid, link_conf->bssid, ETH_ALEN)), and the hardware stamps theprogrammed BSS BSSID into Address 3 of transmitted management frames.
That value is wrong for the wire. mac80211's own kernel MPM uses the
transmitter's MAC (
mesh_plink.c:memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN)),and hostapd does the same for user-space MPM.
bss_conf.bssid == zerois a"no associated BSS" marker, not something to transmit.
Measurements
Driver entry vs. air, same 25 s window (
pr_infoatmt7996_tx()entry, plus anindependent monitor-mode station):
mt7996_tx()entry02:0c:43:26:60:11(own MAC)00:00:00:00:00:00mld=0on every sample, so the MLD address rewrite inmt7996_tx()is notinvolved (it is gated on
ieee80211_vif_is_mld()and would also have rewrittenaddr2, which is intact).
Effect on the ath11k peer, same 35 s window:
The Authentication frames carry a correct addr3 and are delivered, so SAE
completes; the peering frames are ACKed at the MAC layer then silently dropped,
so MPM never completes. The peer closes with reason 56 (MESH_MAX_RETRIES),
reporting our link ID as 0.
Ruled out beforehand by measurement: hostapd/wpad version differences (sources
byte-identical), RF,
sae_pwe,rsn_overriding, the EHT elements mt7996 adds(suppressed and verified absent on air, still failed), PHY rate (all frames
legacy OFDM 6 Mbit/s), the Protected bit (clear both sides), and the QCA
firmware build (swapped to a QSDK build, no change).
Validation
With this patch, on the same hardware and configuration:
addr3 = 02:0c:43:26:60:11ESTABwith all three ath11k nodesestab=3and exchange batman-adv originatorsEnvironment
be5ce7910521492d4a2e4ce7ee3843680a46c047Note on other drivers
The same pattern appears in the shared helper, so other drivers are likely
affected. I only have mt7996 hardware, so these are unverified:
mt76_connac_mcu.c:2945—memcpy(bss->bssid, vif->bss_conf.bssid, ETH_ALEN);in
mt76_connac_mcu_bss_basic_tlv()(mt7615/mt7915/mt7921)mt7925/mcu.c:2736—memcpy(basic_req->bssid, link_conf->bssid, ETH_ALEN);In both, the mesh case falls through the iftype switch without special handling,
so the zero
bss_conf.bssidis what gets programmed.