diff mbox series

wifi: mac80211: read ethtool's sta_stats from sinfo

Message ID ccfce8848c7bf7199ab90ccf3b4b14e1c7633385.1659060644.git.ryder.lee@mediatek.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series wifi: mac80211: read ethtool's sta_stats from sinfo | expand

Commit Message

Ryder Lee July 29, 2022, 2:15 a.m. UTC
Driver may update sinfo directly through .sta_statistics, so this
patch makes sure that ethool gets the correct statistics.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 net/mac80211/ethtool.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Johannes Berg Aug. 25, 2022, 8:52 a.m. UTC | #1
On Fri, 2022-07-29 at 10:15 +0800, Ryder Lee wrote:
> Driver may update sinfo directly through .sta_statistics, so this
> patch makes sure that ethool gets the correct statistics.
> 

This doesn't apply, please rebase on wireless-next.

johannes
diff mbox series

Patch

diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index 31cd3c1ac07f..26d7a967f10a 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -83,17 +83,17 @@  static void ieee80211_get_stats(struct net_device *dev,
 
 #define ADD_STA_STATS(sta)					\
 	do {							\
-		data[i++] += sta->rx_stats.packets;		\
-		data[i++] += sta->rx_stats.bytes;		\
+		data[i++] += sinfo.rx_packets;			\
+		data[i++] += sinfo.rx_bytes;			\
 		data[i++] += sta->rx_stats.num_duplicates;	\
 		data[i++] += sta->rx_stats.fragments;		\
-		data[i++] += sta->rx_stats.dropped;		\
+		data[i++] += sinfo.rx_dropped_misc;		\
 								\
 		data[i++] += sinfo.tx_packets;			\
 		data[i++] += sinfo.tx_bytes;			\
 		data[i++] += sta->status_stats.filtered;	\
-		data[i++] += sta->status_stats.retry_failed;	\
-		data[i++] += sta->status_stats.retry_count;	\
+		data[i++] += sinfo.tx_failed;			\
+		data[i++] += sinfo.tx_retries;			\
 	} while (0)
 
 	/* For Managed stations, find the single station based on BSSID