On 5/15/2025 5:11 PM, Johannes Berg wrote:
Also,
On Thu, 2025-05-15 at 11:19 +0530, Sarika Sharma wrote:
+static void sta_accumulate_removed_link_stats(struct sta_info *sta, int link_id)
+{
+ struct link_sta_info *link_sta = wiphy_dereference(sta->local->hw.wiphy,
+ sta->link[link_id]);
+ int ac;
+
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
+ sta->rem_link_stats.tx_packets +=
+ link_sta->tx_stats.packets[ac];
+ sta->rem_link_stats.tx_bytes += link_sta->tx_stats.bytes[ac];
It seems odd to take per-AC values and flatten them in this case? How do
they even get reported, as overall values only? Then you get the same
inconsistency again on per-AC values since those are (or at least
could/should be) summed up over all links, but aren't kept post removal?
Looks like we can flatten them. In existing code as well we have
flattened and use, during sta_set_sinfo()
"if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_PACKETS))) {
sinfo->tx_packets = 0;
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
sinfo->tx_packets +=
sta->deflink.tx_stats.packets[ac];
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_PACKETS);
} "
johannes