Fix inconsistencies observed in population of tx_stats in debugfs
v2 cover Fix inconsistencies observed in population of tx_stats in debugfs
There are some inconsistencies observed while filling various peer tx stats in tx_stats debugfs entry per sta.
This patchset fixes the wrong updation of NSS, SGI, Bandwidth and rate_table in tx_stats debugfs entry per sta.
Changes from v1:
-Initialized the uninitialized variable flags in [Patch 3/4]
Surabhi Vishnoi (4):
ath10k: Fix the incorrect updation of NSS data in tx stats
ath10k: Fix the wrong updation of BW in tx_stats debugfs entry
ath10k: Fix the wrong updation of SGI in tx_stats debugfs
ath10k: Fix the wrong calculation ht_idx and idx of rate table for
tx_stats
drivers/net/wireless/ath/ath10k/debugfs_sta.c | 7 ++++--- drivers/net/wireless/ath/ath10k/htt_rx.c | 26 ++++++++++++++------------ drivers/net/wireless/ath/ath10k/wmi.h | 3 ++- 3 files changed, 20 insertions(+), 16 deletions(-)
Signature · 7 lines
1.9.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH v2 1/4 ath10k: Fix the incorrect updation of NSS data in tx stats
The NSS data is updated incorrectly in the tx stats as the array indexing starts from zero.
Fix the incorrect updation of NSS data in tx_stats by taking into consideration the array index starting from zero.
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +8 -8
@@ -2969,7 +2969,7 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate) }STATS_OP_FMT (AMPDU ).bw[0 ][bw] += pstats->succ_bytes + pstats->retry_bytes; -STATS_OP_FMT (AMPDU ).nss[0 ][nss] += +STATS_OP_FMT (AMPDU ).nss[0 ][nss -1 ] += pstats->succ_bytes + pstats->retry_bytes;STATS_OP_FMT (AMPDU ).gi[0 ][gi] += pstats->succ_bytes + pstats->retry_bytes;
@@ -2977,7 +2977,7 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate) pstats->succ_bytes + pstats->retry_bytes;STATS_OP_FMT (AMPDU ).bw[1 ][bw] += pstats->succ_pkts + pstats->retry_pkts; -STATS_OP_FMT (AMPDU ).nss[1 ][nss] += +STATS_OP_FMT (AMPDU ).nss[1 ][nss -1 ] += pstats->succ_pkts + pstats->retry_pkts;STATS_OP_FMT (AMPDU ).gi[1 ][gi] += pstats->succ_pkts + pstats->retry_pkts;
@@ -2989,27 +2989,27 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate) }STATS_OP_FMT (SUCC ).bw[0 ][bw] += pstats->succ_bytes; -STATS_OP_FMT (SUCC ).nss[0 ][nss] += pstats->succ_bytes; +STATS_OP_FMT (SUCC ).nss[0 ][nss -1 ] += pstats->succ_bytes;STATS_OP_FMT (SUCC ).gi[0 ][gi] += pstats->succ_bytes;STATS_OP_FMT (SUCC ).bw[1 ][bw] += pstats->succ_pkts; -STATS_OP_FMT (SUCC ).nss[1 ][nss] += pstats->succ_pkts; +STATS_OP_FMT (SUCC ).nss[1 ][nss -1 ] += pstats->succ_pkts;STATS_OP_FMT (SUCC ).gi[1 ][gi] += pstats->succ_pkts;STATS_OP_FMT (FAIL ).bw[0 ][bw] += pstats->failed_bytes; -STATS_OP_FMT (FAIL ).nss[0 ][nss] += pstats->failed_bytes; +STATS_OP_FMT (FAIL ).nss[0 ][nss -1 ] += pstats->failed_bytes;STATS_OP_FMT (FAIL ).gi[0 ][gi] += pstats->failed_bytes;STATS_OP_FMT (FAIL ).bw[1 ][bw] += pstats->failed_pkts; -STATS_OP_FMT (FAIL ).nss[1 ][nss] += pstats->failed_pkts; +STATS_OP_FMT (FAIL ).nss[1 ][nss -1 ] += pstats->failed_pkts;STATS_OP_FMT (FAIL ).gi[1 ][gi] += pstats->failed_pkts;STATS_OP_FMT (RETRY ).bw[0 ][bw] += pstats->retry_bytes; -STATS_OP_FMT (RETRY ).nss[0 ][nss] += pstats->retry_bytes; +STATS_OP_FMT (RETRY ).nss[0 ][nss -1 ] += pstats->retry_bytes;STATS_OP_FMT (RETRY ).gi[0 ][gi] += pstats->retry_bytes;STATS_OP_FMT (RETRY ).bw[1 ][bw] += pstats->retry_pkts; -STATS_OP_FMT (RETRY ).nss[1 ][nss] += pstats->retry_pkts; +STATS_OP_FMT (RETRY ).nss[1 ][nss -1 ] += pstats->retry_pkts;STATS_OP_FMT (RETRY ).gi[1 ][gi] += pstats->retry_pkts;if (txrate->flags >=RATE_INFO_FLAGS_MCS ) {
Signature · 7 lines
1.9.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH v2 1/4] ath10k: Fix the incorrect updation of NSS data in tx stats
Quoted 6 lines · Surabhi Vishnoi
The NSS data is updated incorrectly in the tx stats as the array indexing starts from zero.
Fix the incorrect updation of NSS data in
tx_statsby taking into consideration the array index starting from zero.
Quoted 6 lines
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1Fixes a904417fc876 ("ath10k: add extended per sta tx statistics support")Signed-off-by Surabhi Vishnoi <[email protected]>Signed-off-by Kalle Valo <[email protected]>
4 patches applied to ath-next branch of ath.git, thanks.
3a08ac3e79e8 ath10k: Fix the incorrect updation of NSS data in tx stats ef9051c72ab7 ath10k: Fix the wrong updation of BW in tx_stats debugfs entry 8e55fdaa8ea7 ath10k: Fix the wrong updation of SGI in tx_stats debugfs d23c2cdaa013 ath10k: Fix the wrong calculation ht_idx and idx of rate table for tx_stats
Signature · 9 lines
https://patchwork.kernel.org/patch/10829765/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH v2 1/4] ath10k: Fix the incorrect updation of NSS data in tx stats
In reply to Surabhi VishnoiQuoted 6 lines · Surabhi Vishnoi
The NSS data is updated incorrectly in the tx stats as the array indexing starts from zero.
Fix the incorrect updation of NSS data in
tx_statsby taking into consideration the array index starting from zero.
Quoted 6 lines
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1Fixes a904417fc876 ("ath10k: add extended per sta tx statistics support")Signed-off-by Surabhi Vishnoi <[email protected]>Signed-off-by Kalle Valo <[email protected]>
4 patches applied to ath-next branch of ath.git, thanks.
3a08ac3e79e8 ath10k: Fix the incorrect updation of NSS data in tx stats ef9051c72ab7 ath10k: Fix the wrong updation of BW in tx_stats debugfs entry 8e55fdaa8ea7 ath10k: Fix the wrong updation of SGI in tx_stats debugfs d23c2cdaa013 ath10k: Fix the wrong calculation ht_idx and idx of rate table for tx_stats
Signature · 3 lines
https://patchwork.kernel.org/patch/10829765/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
PATCH v2 2/4 ath10k: Fix the wrong updation of BW in tx_stats debugfs entry
In reply to Surabhi VishnoiCurrently, the bandwidth is updated wrongly in BW table in tx_stats debugfs per sta as there is difference in number of bandwidth type in mac80211 and driver stats table. This leads to bandwidth getting updated at wrong index in bandwidth table in tx_stats.
Fix this index mismatch between mac80211 and driver stats table (BW table) by making the number of bandwidth type in driver compatible with mac80211.
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/debugfs_sta.c | 7 ++++--- drivers/net/wireless/ath/ath10k/wmi.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath10k/debugfs_sta.c +4 -3
@@ -685,11 +685,12 @@ static ssize_t ath10k_dbg_sta_dump_tx_stats(struct file *file, " %llu ", stats->ht[j][i]); len +=scnprintf (buf + len, size - len,"\n" ); len +=scnprintf (buf + len, size - len, -" BW %s (20,40,80,160 MHz)\n" , str[j]); +" BW %s (20,5,10,40,80,160 MHz)\n" , str[j]); len +=scnprintf (buf + len, size - len, -" %llu %llu %llu %llu\n" , +" %llu %llu %llu %llu %llu %llu\n" , stats->bw[j][0 ], stats->bw[j][1 ], - stats->bw[j][2 ], stats->bw[j][3 ]); + stats->bw[j][2 ], stats->bw[j][3 ], + stats->bw[j][4 ], stats->bw[j][5 ]); len +=scnprintf (buf + len, size - len," NSS %s (1x1,2x2,3x3,4x4)\n" , str[j]); len += scnprintf(buf + len, size - len,
drivers/net/wireless/ath/ath10k/wmi.h +1 -1
@@ -5045,7 +5045,7 @@ enum wmi_rate_preamble {#define ATH10K_FW_SKIPPED_RATE_CTRL (flags) (((flags) >> 6) & 0x1)#define ATH10K_VHT_MCS_NUM 10 -#define ATH10K_BW_NUM 4 +#define ATH10K_BW_NUM 6#define ATH10K_NSS_NUM 4#define ATH10K_LEGACY_NUM 12#define ATH10K_GI_NUM 2
Signature · 7 lines
1.9.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH v2 3/4 ath10k: Fix the wrong updation of SGI in tx_stats debugfs
In reply to Surabhi VishnoiThe SGI is updated wrongly in tx stats table in debugfs per sta entry. To know whether the packets/bytes are sent with SHORT GI, test whether the SGI bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT) is set or not in the txrate flags.
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 +++- drivers/net/wireless/ath/ath10k/wmi.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +3 -1
@@ -2913,12 +2913,14 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate)struct rate_info *txrate = &arsta->txrate;struct ath10k_htt_tx_stats *tx_stats;int idx, ht_idx, gi, mcs, bw, nss; +unsigned long flags;if (!arsta->tx_stats)return ; tx_stats = arsta->tx_stats; - gi = (arsta->txrate.flags &RATE_INFO_FLAGS_SHORT_GI ); + flags = txrate->flags; + gi =test_bit (ATH10K_RATE_INFO_FLAGS_SGI_BIT , &flags); ht_idx = txrate->mcs + txrate->nss *8 ; mcs = txrate->mcs; bw = txrate->bw;
drivers/net/wireless/ath/ath10k/wmi.h +1 -0
@@ -5051,6 +5051,7 @@ enum wmi_rate_preamble {#define ATH10K_GI_NUM 2#define ATH10K_HT_MCS_NUM 32#define ATH10K_RATE_TABLE_NUM 320 +#define ATH10K_RATE_INFO_FLAGS_SGI_BIT 2/* Value to disable fixed rate setting */ #define WMI_FIXED_RATE_NONE (0xff)
Signature · 1 line
1.9.1
PATCH v2 4/4 ath10k: Fix the wrong calculation ht_idx and idx of rate table for tx_stats
In reply to Surabhi Vishnoiht_idx (ht rate index) and idx (rate table index) are calculated based on mcs index. This mcs index used in the above calculation should be 0-9 for getting the correct ht_idx and idx.
Currently the mcs index used for the above calculations is mcs index which can be 0-31 (in case of HT), leading to incorrect rate index and ht index values.
Fix the issue by obtaining mcs value from the ratecode reported by firmware and use it for calculating ht_idx and idx (rate-table index).
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +3 -3
@@ -2921,11 +2921,11 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate) tx_stats = arsta->tx_stats; flags = txrate->flags; gi =test_bit (ATH10K_RATE_INFO_FLAGS_SGI_BIT , &flags); - ht_idx = txrate->mcs + txrate->nss *8 ; - mcs = txrate->mcs; + mcs =ATH10K_HW_MCS_RATE (pstats->ratecode); bw = txrate->bw; nss = txrate->nss; - idx = mcs *8 +8 *10 * nss; + ht_idx = mcs + (nss -1 ) *8 ; + idx = mcs *8 +8 *10 * (nss -1 ); idx += bw *2 + gi;#define STATS_OP_FMT (name) tx_stats->stats[ATH10K_STATS_TYPE_##name]
Signature · 1 line
1.9.1