From patchwork Thu Jun 27 13:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkateswara Naralasetty X-Patchwork-Id: 11019741 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B07C6112C for ; Thu, 27 Jun 2019 13:37:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B1AC28B17 for ; Thu, 27 Jun 2019 13:37:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EBD328B37; Thu, 27 Jun 2019 13:37:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D3E3628B21 for ; Thu, 27 Jun 2019 13:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=UdByBKRy0UED/ERgk9PQqVQ7VluIUzDXdlzbPIrTOf0=; b=n0H jRHFDL3Qqw+rCkMyKmCXHdju5zITk2HMBvWHKanYqaWwDHZ7X3pk0FKLJAt2SDzW3QvbmyK0wRhps 5DnUJjMvACwSl/zFV3zlzPfeBO6LV82TABRmzqjksQyomxX3oaY4tvEskh4QiihEIaSwAyPzrm5Ee ZiTI8XFUQ8okIkkWkxkBd+JUBqzPQVwNCUg22eRigDOsqxU0djVKAMi3OpfCw+ywSqfdM/Qyk/Drd lQHVp0Uxo1PinKAluKhOomOhZyqpHbXVxpUg+ChW+eO4q9SMpNa3SB3Q3yEXA2QHFzfVxqc1lwzIJ jOQP4kzGe4PZCzBxf898FgW0QIy4XmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgUb0-00073H-0D; Thu, 27 Jun 2019 13:37:50 +0000 Received: from alexa-out-blr-01.qualcomm.com ([103.229.18.197]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgUaw-00072k-Us for ath11k@lists.infradead.org; Thu, 27 Jun 2019 13:37:48 +0000 Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by alexa-out-blr-01.qualcomm.com with ESMTP/TLS/AES256-SHA; 27 Jun 2019 19:06:43 +0530 X-IronPort-AV: E=McAfee;i="6000,8403,9300"; a="9955753" Received: from vnaralas-linux.qualcomm.com ([10.201.26.231]) by ironmsg02-blr.qualcomm.com with ESMTP; 27 Jun 2019 19:06:37 +0530 Received: by vnaralas-linux.qualcomm.com (Postfix, from userid 443942) id 04FB027AA; Thu, 27 Jun 2019 19:06:36 +0530 (IST) From: Venkateswara Naralasetty To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: update tx duration in peer stats Date: Thu, 27 Jun 2019 19:06:35 +0530 Message-Id: <1561642595-16359-1-git-send-email-vnaralas@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_063747_425670_A6A2C4C2 X-CRM114-Status: UNSURE ( 8.00 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Venkateswara Naralasetty MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Update the tx duraion in peer stats from ppdu stats. Signed-off-by: Venkateswara Naralasetty --- 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(-) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index af5c66f..da39610 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -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; }; diff --git a/drivers/net/wireless/ath/ath11k/debugfs_sta.c b/drivers/net/wireless/ath/ath11k/debugfs_sta.c index 4a30293..c270e6c 100644 --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c @@ -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, diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 14a20f3..692c301 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -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