Re: [PATCH v2 1/2] wifi: cfg80211/mac80211: Add support to rx retry stats

Jeff Johnson
2024-03-27T15:02:43Z

On 3/27/2024 3:32 AM, Johannes Berg wrote:
> On Wed, 2024-03-27 at 15:39 +0530, Hari Chandrakanthan wrote:
>
>> Fields such packet count, retries etc can be summed up for the MLD
>> representation and the existing NL attribute can be used for exposing
>> the summed up value.
>
> I think the existing attributes can also be used for per-link STA?
>
> I'm kind of imagining that - once we actually do all of this properly -
> the representation in nl80211 would be something like
>
>
> STA 00:00:00:00:00:00
> - TX bytes: 123456
> - RX bytes: 654321
> - signal avg: -60 dBm // picking the best of all links?
> ...
> - LINK 00:00:00:00:00:01
> - link ID: 10
> - TX bytes: 100000
> - RX bytes: 600000
> - signal avg: -60 dBm
> - LINK 00:00:00:00:00:02
> - link ID: 11
> - TX bytes: 23456
> - RX bytes: 54321
> - signal avg: -70 dBm
>
> etc.
>
>> But there are fields such as signal avg, bitrate etc which cannot be
>> summed up.
>
> Right, but I guess we can pick 'best' for those, to at least have a
> value? Or we could just not emit those attributes I guess, but not sure
> if that's then all that useful?
>
>> Should we expose such fields of each link STA through NL?
>
> All of them, I guess?
>
> I'm also imagining that we change the API from cfg80211 to the drivers
> to get the *link* STA information, and do the summing up and/or "best"
> selection there in cfg80211 itself. However, I am prepared to accept the
> possibility that we may do _both_ in the API, if not all drivers can
> even do all of the statistics per link. We should probably still have
> the link STAs in the statistics in nl80211, but then they may not be
> populated?

First remember that there are a lot of statistics, and each driver is free to
return as many or as few as they support, indicating the ones they are
returning using the "filled" bitmap. I would expect MLO-capable drivers to
provide the same information on a per-link basis that they previously provided
on a per-interface basis, but the "filled" bitmap leaves that to the drivers.

But I think a fundamental question needs to be answered: To what extent do we
need to support legacy userspace applications that are not MLO-aware?

My expectation is that MLO-aware applications only need the per-link
information, and from that they can derive their own "aggregate" of the
per-link information. So to support that we'd need per-link nesting of the
associated attributes. And if we don't need to support legacy userspace we
could completely remove populating the top-level statistic attributes. Non-MLO
interfaces would have a single link nest that contains the same information
that is now in the top-level of the NL message.

But if we need to support legacy userspace then we would indeed need to
continue to populate those top-level attributes with some form of aggregate data.

And even for the MLO-aware case there is the issue of how do we want to handle
the case that links may come and go, and hence aggregate counters would appear
to have huge fluctuations in values when links are added or removed if the
aggregate values are only calculated by adding the values from the
currently-attached links.

/jeff