mbox series

[v2,0/5] wifi: mac80211/ath12k: add support to fill link statistics of multi-link station

Message ID 20250213173206.1665731-1-quic_sarishar@quicinc.com
Headers show
Series wifi: mac80211/ath12k: add support to fill link statistics of multi-link station | expand

Message

Sarika Sharma Feb. 13, 2025, 5:32 p.m. UTC
Currently, station statistics are filled at deflink for both non-ML and
multi-link(ML) station.

Hence, add support to fill station statistics for the corresponding
link of station.

Depends-On: [RFC,v2,00/12] wifi: cfg80211/mac80211: add support to
            handle per link statistics of multi-link station
Link: https://patchwork.kernel.org/project/linux-wireless/cover/20250117124554.3719808-1-quic_sarishar@quicinc.com/

v2:
 - Convert RFC patch to actual PATCH with each patch bisectable.
 - Add new patch to update bw for ofdma packets.
 - Add new patch to fetch tx_retry and tx_failed packets.

Sarika Sharma (5):
  wifi: mac80211: correct RX stats packet increment for multi-link
  wifi: ath12k: add link support for multi-link in arsta
  wifi: ath12k: add EHT support for TX rate
  wifi: ath12k: correctly update bw for ofdma packets
  wifi: ath12k: fetch tx_retry and tx_failed from
    htt_ppdu_stats_user_cmpltn_common_tlv

 drivers/net/wireless/ath/ath12k/core.h   |  2 ++
 drivers/net/wireless/ath/ath12k/dp.h     |  2 ++
 drivers/net/wireless/ath/ath12k/dp_mon.c | 23 ++++++++----
 drivers/net/wireless/ath/ath12k/dp_rx.c  | 45 ++++++++++++++++++++----
 drivers/net/wireless/ath/ath12k/mac.c    |  5 +++
 drivers/net/wireless/ath/ath12k/peer.h   | 27 +++++++++++++-
 net/mac80211/rx.c                        | 15 ++++++--
 7 files changed, 102 insertions(+), 17 deletions(-)


base-commit: 704a2d7237043317ed1b0f8a08203e9ddde70097

Comments

Ben Greear Feb. 13, 2025, 8:17 p.m. UTC | #1
On 2/13/25 9:32 AM, Sarika Sharma wrote:
> Currently, RX stats packets are incremented for deflink member for
> non-ML and multi-link(ML) station case. However, for ML station,
> packets should be incremented based on the specific link.
> 
> Therefore, if a valid link_id is present, fetch the corresponding
> link station information and increment the RX packets for that link.
> For non-MLO stations, the deflink will still be used.
> 
> Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
> ---
>   net/mac80211/rx.c | 15 +++++++++++++--
>   1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 1e28efe4203c..eb3e2d550c8f 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -231,8 +231,19 @@ static void __ieee80211_queue_skb_to_iface(struct ieee80211_sub_if_data *sdata,
>   
>   	skb_queue_tail(&sdata->skb_queue, skb);
>   	wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
> -	if (sta)
> -		sta->deflink.rx_stats.packets++;
> +	if (sta) {
> +		struct link_sta_info *link_sta_info;
> +
> +		if (link_id >= 0) {
> +			link_sta_info = rcu_dereference(sta->link[link_id]);
> +			if (!link_sta_info)
> +				return;

I think if you cannot find the link_sta_info here, you should just use deflink
so the packet is still counted?

Thanks,
Ben

> +		} else {
> +			link_sta_info = &sta->deflink;
> +		}
> +
> +		link_sta_info->rx_stats.packets++;
> +	}
>   }
>   
>   static void ieee80211_queue_skb_to_iface(struct ieee80211_sub_if_data *sdata,
Sarika Sharma Feb. 17, 2025, 3:52 a.m. UTC | #2
On 2/14/2025 1:47 AM, Ben Greear wrote:
> On 2/13/25 9:32 AM, Sarika Sharma wrote:
>> Currently, RX stats packets are incremented for deflink member for
>> non-ML and multi-link(ML) station case. However, for ML station,
>> packets should be incremented based on the specific link.
>>
>> Therefore, if a valid link_id is present, fetch the corresponding
>> link station information and increment the RX packets for that link.
>> For non-MLO stations, the deflink will still be used.
>>
>> Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
>> ---
>>   net/mac80211/rx.c | 15 +++++++++++++--
>>   1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
>> index 1e28efe4203c..eb3e2d550c8f 100644
>> --- a/net/mac80211/rx.c
>> +++ b/net/mac80211/rx.c
>> @@ -231,8 +231,19 @@ static void __ieee80211_queue_skb_to_iface(struct 
>> ieee80211_sub_if_data *sdata,
>>       skb_queue_tail(&sdata->skb_queue, skb);
>>       wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
>> -    if (sta)
>> -        sta->deflink.rx_stats.packets++;
>> +    if (sta) {
>> +        struct link_sta_info *link_sta_info;
>> +
>> +        if (link_id >= 0) {
>> +            link_sta_info = rcu_dereference(sta->link[link_id]);
>> +            if (!link_sta_info)
>> +                return;
> 
> I think if you cannot find the link_sta_info here, you should just use 
> deflink
> so the packet is still counted?
> 
> Thanks,
> Ben

Currently, we are consistently searching for link_sta, and if link_sta 
is not found, we return. We are not utilizing deflink when the link of 
link_sta is NULL. Additionally, while populating stats in station_info 
structure, we are checking sta_link for link stats instead of deflink.

I believe that filling the stats in deflink is not beneficial for MLO 
link-level stats.

May be Johannes can comment on this, if still required I believe this 
could be taken as separate changes.