From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: Per MLO link TX stats
Date: Tue, 27 Aug 2024 11:17:10 -0700 [thread overview]
Message-ID: <dd2c0158-775f-f876-6962-dba30d0bd16c@candelatech.com> (raw)
In-Reply-To: <b00a52947670f45c0764d33ea093c90b825fcdab.camel@sipsolutions.net>
On 8/27/24 09:41, Johannes Berg wrote:
> On Tue, 2024-08-27 at 09:28 -0700, Ben Greear wrote:
>> On 8/27/24 09:20, Johannes Berg wrote:
>>> On Tue, 2024-08-27 at 09:12 -0700, Ben Greear wrote:
>>>>
>>>> When be200 goes into eMLSR mode, both 5 and 6Ghz links are shown as active, so at least
>>>> you cannot use 'active link' to reliably update stats.
>>>
>>> Sure, not active link - but there's an LMAC bit somewhere ... Ah, it's
>>> not documented, it's actually documented *differently*, but it should be
>>> bit 31 in len_n_flags in struct iwl_rx_packet.
>>>
>>> Given the LMAC ID on the TX response notification we should know which
>>> LMAC transmitted it, and then I think it's a simple mapping to the
>>> active link. But I haven't actually really tried it.
>>
>> If you can share a patch that documents this bit (like 0 means 5Ghz and 1 means 6Ghz??)
>> then we can try it out.
>
> I think yes, 5 GHz should be on LMAC 0 and 6 GHz on LMAC 1, and that's
> the only case where we can have two active links simultaneously.
>
> There's still a race though, when we change the active links while
> transmitting, not sure how to handle that.
>
> Oh wait, it's simpler than that - we have the STA pointer in there
> already (see iwl_mvm_rx_tx_cmd_single and iwl_mvm_rx_tx_cmd_agg), but
> since we get that from the FW STA ID, we obviously also know the *link*
> STA since the FW STA IDs are per link, so we can just go from there to
> the link ID directly.
>
> link_sta = rcu_dereference(mvm->fw_id_to_link_sta[notif->sta_id]);
>
> link_sta->link_id
>
>> And maybe your idea for how to report it in tx-status too since that will touch
>> mac80211?
>
> I hadn't really thought about that ... I guess we could use the
> IEEE80211_TX_CTRL_MLO_LINK space also for status? It's already filled to
> the link ID by mac80211 for TX if the frame must go out on a specific
> link (or 0xF otherwise which is an invalid link ID anyway.)
So, something like this (compile tested only at this point)?
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index e7cb6dcde182..92f7d0d34421 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -1963,6 +1963,9 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
u8 lq_color;
u16 next_reclaimed, seq_ctl;
bool is_ndp = false;
+ struct ieee80211_link_sta *link_sta;
+
+ link_sta = rcu_dereference(mvm->fw_id_to_link_sta[sta_id]);
__skb_queue_head_init(&skbs);
@@ -1989,6 +1992,10 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
memset(&info->status, 0, sizeof(info->status));
info->flags &= ~(IEEE80211_TX_STAT_ACK | IEEE80211_TX_STAT_TX_FILTERED);
+ if (link_sta) {
+ info->control.flags &= ~(u32_encode_bits(0xF, IEEE80211_TX_CTRL_MLO_LINK));
+ info->control.flags |= u32_encode_bits(link_sta->link_id, IEEE80211_TX_CTRL_MLO_LINK);
+ }
/* inform mac80211 about what happened with the frame */
switch (status & TX_STATUS_MSK) {
And something similar for the agg path....
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2024-08-27 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 17:52 Per MLO link TX stats Ben Greear
2024-08-27 15:56 ` Johannes Berg
2024-08-27 16:12 ` Ben Greear
2024-08-27 16:20 ` Johannes Berg
2024-08-27 16:28 ` Ben Greear
2024-08-27 16:41 ` Johannes Berg
2024-08-27 18:17 ` Ben Greear [this message]
2024-08-28 12:50 ` Johannes Berg
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=dd2c0158-775f-f876-6962-dba30d0bd16c@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).