@@ -389,7 +389,7 @@ struct ath11k_per_peer_tx_stats {
u16 succ_pkts;
u16 retry_pkts;
u16 failed_pkts;
- u16 duration;
+ u32 duration;
u8 ba_fails;
bool is_ampdu;
};
@@ -138,6 +138,8 @@ ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
STATS_OP_FMT(RETRY).bw[1][bw] += peer_stats->retry_pkts;
STATS_OP_FMT(RETRY).nss[1][nss] += peer_stats->retry_pkts;
STATS_OP_FMT(RETRY).gi[1][gi] += peer_stats->retry_pkts;
+
+ tx_stats->tx_duration += peer_stats->duration;
}
void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
@@ -1030,7 +1030,7 @@ static u32 ath11k_bw_to_mac80211_bwflags(u8 bw)
static void
ath11k_update_per_peer_tx_stats(struct ath11k *ar,
- struct htt_ppdu_user_stats *usr_stats)
+ struct htt_ppdu_stats *ppdu_stats, u8 user)
{
struct ath11k_base *ab = ar->ab;
struct ath11k_peer *peer;
@@ -1039,10 +1039,13 @@ ath11k_update_per_peer_tx_stats(struct ath11k *ar,
struct htt_ppdu_stats_user_rate *user_rate;
struct ieee80211_chanctx_conf *conf = NULL;
struct ath11k_per_peer_tx_stats *peer_stats = &ar->peer_tx_stats;
+ struct htt_ppdu_user_stats *usr_stats = &ppdu_stats->user_stats[user];
+ struct htt_ppdu_stats_common *common = &ppdu_stats->common;
int ret;
u8 flags, mcs, nss, bw, sgi, rate_idx = 0;
u32 succ_bytes = 0;
u16 rate = 0, succ_pkts = 0;
+ u32 tx_duration = 0;
bool is_ampdu = false;
if (!usr_stats)
@@ -1062,6 +1065,9 @@ ath11k_update_per_peer_tx_stats(struct ath11k *ar,
usr_stats->ack_ba.info);
}
+ if (common->fes_duration_us)
+ tx_duration = common->fes_duration_us;
+
user_rate = &usr_stats->rate;
flags = HTT_USR_RATE_PREAMBLE(user_rate->rate_flags);
bw = HTT_USR_RATE_BW(user_rate->rate_flags) - 2;
@@ -1167,6 +1173,7 @@ ath11k_update_per_peer_tx_stats(struct ath11k *ar,
peer_stats->succ_pkts = succ_pkts;
peer_stats->succ_bytes = succ_bytes;
peer_stats->is_ampdu = is_ampdu;
+ peer_stats->duration = tx_duration;
peer_stats->ba_fails =
HTT_USR_CMPLTN_LONG_RETRY(usr_stats->cmpltn_cmn.flags) +
HTT_USR_CMPLTN_SHORT_RETRY(usr_stats->cmpltn_cmn.flags);
@@ -1182,13 +1189,10 @@ ath11k_update_per_peer_tx_stats(struct ath11k *ar,
static void ath11k_htt_update_ppdu_stats(struct ath11k *ar,
struct htt_ppdu_stats *ppdu_stats)
{
- struct htt_ppdu_user_stats *usr_stats;
u8 user;
- for (user = 0; user < HTT_PPDU_STATS_MAX_USERS - 1; user++) {
- usr_stats = &ppdu_stats->user_stats[user];
- ath11k_update_per_peer_tx_stats(ar, usr_stats);
- }
+ for (user = 0; user < HTT_PPDU_STATS_MAX_USERS - 1; user++)
+ ath11k_update_per_peer_tx_stats(ar, ppdu_stats, user);
}
static
Update the tx duraion in peer stats from ppdu stats. Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org> --- drivers/net/wireless/ath/ath11k/core.h | 2 +- drivers/net/wireless/ath/ath11k/debugfs_sta.c | 2 ++ drivers/net/wireless/ath/ath11k/dp_rx.c | 16 ++++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-)