Commit 37dd5755 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt7915: move tx amsdu stats in mib_stats

Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 81811173
...@@ -199,7 +199,8 @@ mt7915_tx_stats_show(struct seq_file *file, void *data) ...@@ -199,7 +199,8 @@ mt7915_tx_stats_show(struct seq_file *file, void *data)
{ {
struct mt7915_phy *phy = file->private; struct mt7915_phy *phy = file->private;
struct mt7915_dev *dev = phy->dev; struct mt7915_dev *dev = phy->dev;
int stat[8], i, n; struct mib_stats *mib = &phy->mib;
int i;
mutex_lock(&dev->mt76.mutex); mutex_lock(&dev->mt76.mutex);
...@@ -209,16 +210,12 @@ mt7915_tx_stats_show(struct seq_file *file, void *data) ...@@ -209,16 +210,12 @@ mt7915_tx_stats_show(struct seq_file *file, void *data)
/* Tx amsdu info */ /* Tx amsdu info */
seq_puts(file, "Tx MSDU statistics:\n"); seq_puts(file, "Tx MSDU statistics:\n");
for (i = 0, n = 0; i < ARRAY_SIZE(stat); i++) { for (i = 0; i < ARRAY_SIZE(mib->tx_amsdu); i++) {
stat[i] = mt76_rr(dev, MT_PLE_AMSDU_PACK_MSDU_CNT(i)); seq_printf(file, "AMSDU pack count of %d MSDU in TXD: %8d ",
n += stat[i]; i + 1, mib->tx_amsdu[i]);
} if (mib->tx_amsdu_cnt)
seq_printf(file, "(%3d%%)\n",
for (i = 0; i < ARRAY_SIZE(stat); i++) { mib->tx_amsdu[i] * 100 / mib->tx_amsdu_cnt);
seq_printf(file, "AMSDU pack count of %d MSDU in TXD: 0x%x ",
i + 1, stat[i]);
if (n != 0)
seq_printf(file, "(%d%%)\n", stat[i] * 100 / n);
else else
seq_puts(file, "\n"); seq_puts(file, "\n");
} }
......
...@@ -2023,6 +2023,12 @@ void mt7915_mac_update_stats(struct mt7915_phy *phy) ...@@ -2023,6 +2023,12 @@ void mt7915_mac_update_stats(struct mt7915_phy *phy)
mib->tx_bf_fb_cpl_cnt += FIELD_GET(MT_ETBF_TX_FB_CPL, cnt); mib->tx_bf_fb_cpl_cnt += FIELD_GET(MT_ETBF_TX_FB_CPL, cnt);
mib->tx_bf_fb_trig_cnt += FIELD_GET(MT_ETBF_TX_FB_TRI, cnt); mib->tx_bf_fb_trig_cnt += FIELD_GET(MT_ETBF_TX_FB_TRI, cnt);
for (i = 0; i < ARRAY_SIZE(mib->tx_amsdu); i++) {
cnt = mt76_rr(dev, MT_PLE_AMSDU_PACK_MSDU_CNT(i));
mib->tx_amsdu[i] += cnt;
mib->tx_amsdu_cnt += cnt;
}
aggr0 = ext_phy ? ARRAY_SIZE(dev->mt76.aggr_stats) / 2 : 0; aggr0 = ext_phy ? ARRAY_SIZE(dev->mt76.aggr_stats) / 2 : 0;
for (i = 0, aggr1 = aggr0 + 4; i < 4; i++) { for (i = 0, aggr1 = aggr0 + 4; i < 4; i++) {
u32 val; u32 val;
......
...@@ -1260,8 +1260,8 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw, ...@@ -1260,8 +1260,8 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw,
data[ei++] = mib->tx_su_acked_mpdu_cnt; data[ei++] = mib->tx_su_acked_mpdu_cnt;
/* Tx amsdu info (pack-count histogram) */ /* Tx amsdu info (pack-count histogram) */
for (i = 0; i < 8; i++) for (i = 0; i < ARRAY_SIZE(mib->tx_amsdu); i++)
data[ei++] = mt76_rr(dev, MT_PLE_AMSDU_PACK_MSDU_CNT(i)); data[ei++] = mib->tx_amsdu[i];
/* rx counters */ /* rx counters */
data[ei++] = mib->rx_fifo_full_cnt; data[ei++] = mib->rx_fifo_full_cnt;
......
...@@ -183,6 +183,9 @@ struct mib_stats { ...@@ -183,6 +183,9 @@ struct mib_stats {
u32 rx_pfdrop_cnt; u32 rx_pfdrop_cnt;
u32 rx_vec_queue_overflow_drop_cnt; u32 rx_vec_queue_overflow_drop_cnt;
u32 rx_ba_cnt; u32 rx_ba_cnt;
u32 tx_amsdu[8];
u32 tx_amsdu_cnt;
}; };
struct mt7915_hif { struct mt7915_hif {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment