diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2023-01-17 14:53:17 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-02-03 14:47:17 +0100 |
commit | 192ad4066065ef67cbcaae557e4412871fa8d369 (patch) | |
tree | 449023e98f6ed66ba264b0566a82f1c644d9cb8c /drivers/net/wireless/mediatek/mt76/mt7915 | |
parent | 2f5c3c77fc9b6a34b68b97231bfa970e1194ec28 (diff) | |
download | linux-stable-192ad4066065ef67cbcaae557e4412871fa8d369.tar.gz linux-stable-192ad4066065ef67cbcaae557e4412871fa8d369.tar.bz2 linux-stable-192ad4066065ef67cbcaae557e4412871fa8d369.zip |
wifi: mt76: enable page_pool stats
Enable page_pool ethtool statistics for mt7915 and mt7921 chipsets.
Tested-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7915')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/main.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 7589af4b3dab..a54921fc73ab 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -1291,19 +1291,22 @@ void mt7915_get_et_strings(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 sset, u8 *data) { - if (sset == ETH_SS_STATS) - memcpy(data, *mt7915_gstrings_stats, - sizeof(mt7915_gstrings_stats)); + if (sset != ETH_SS_STATS) + return; + + memcpy(data, *mt7915_gstrings_stats, sizeof(mt7915_gstrings_stats)); + data += sizeof(mt7915_gstrings_stats); + page_pool_ethtool_stats_get_strings(data); } static int mt7915_get_et_sset_count(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int sset) { - if (sset == ETH_SS_STATS) - return MT7915_SSTATS_LEN; + if (sset != ETH_SS_STATS) + return 0; - return 0; + return MT7915_SSTATS_LEN + page_pool_ethtool_stats_get_count(); } static void mt7915_ethtool_worker(void *wi_data, struct ieee80211_sta *sta) @@ -1331,7 +1334,7 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw, }; struct mib_stats *mib = &phy->mib; /* See mt7915_ampdu_stat_read_phy, etc */ - int i, ei = 0; + int i, ei = 0, stats_size; mutex_lock(&dev->mt76.mutex); @@ -1412,9 +1415,12 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw, return; ei += wi.worker_stat_count; - if (ei != MT7915_SSTATS_LEN) - dev_err(dev->mt76.dev, "ei: %d MT7915_SSTATS_LEN: %d", - ei, (int)MT7915_SSTATS_LEN); + + mt76_ethtool_page_pool_stats(&dev->mt76, &data[ei], &ei); + + stats_size = MT7915_SSTATS_LEN + page_pool_ethtool_stats_get_count(); + if (ei != stats_size) + dev_err(dev->mt76.dev, "ei: %d size: %d", ei, stats_size); } static void |