From patchwork Tue Feb 26 09:27:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10829767 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 044F41805 for ; Tue, 26 Feb 2019 09:28:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2AEC2B050 for ; Tue, 26 Feb 2019 09:28:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D70952B35A; Tue, 26 Feb 2019 09:28:18 +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=unavailable 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 8001B2B050 for ; Tue, 26 Feb 2019 09:28:18 +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:References: In-Reply-To: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:List-Owner; bh=HvVJgvVnFCebCJghi3Oj56/4pHgX/asZ3yXcyWTIbu8=; b=XM63vb2houDwUHOlZiwVuCjWH/ JSKvEr/zxc4+oo5qo1Lfj4wP95cWINWYnl6TV7LoFEB+msbFdfkNTSWc/bYRYFk76sAPh3f60HxPE GBdY0OfRWXwGPiuwXNzStpiAf/AEX6EqDYbffMAJCK5870iC2dkFzNCFUwjMg1b/laHLYLjxTheyO JIY8yvLKxMDmoZ4HoxHsBFxPfmoyMCJrAdgSbIXR672it2CrFq51seqCQYlYzKprd8+E6UXw+62Ke ekOPgOBFd1AxWCnzICCN2xwY1RVcNmW0tX0CM1HSJEmV9KIbPDOZ9RLvPgbvSPzpjFvDyEg3Fgn2V q0Ua/m3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ29-0001Oz-Iz; Tue, 26 Feb 2019 09:28:17 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ26-0001M4-67 for ath10k@lists.infradead.org; Tue, 26 Feb 2019 09:28:15 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8368260EA5; Tue, 26 Feb 2019 09:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173293; bh=vw+elNqJjfUBBnZAczL2MNp6P57GMfrEe2KptbySGek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jg8vMltF/TSqWz6d1QpDioaVeK0PSZUwr+OGUTpsR8xwnSyG/Jdyz0RG6hQD+Gn+q 8qNNsOST1rd9XokM2FWX2WSWi0hMDxPNaexoKkC9PhyFBfzbH96vzJEARtFLHYFb1I vzCeF8L4zLveORCWrdgGB3MtRGEXWItPm9/QEI94= Received: from svishnoi-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: svishnoi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 95CC960E59; Tue, 26 Feb 2019 09:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173292; bh=vw+elNqJjfUBBnZAczL2MNp6P57GMfrEe2KptbySGek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hZMl2ac/9Xsf49LUQstbtO7ZUziqSpaFxcb3UofRpjLjGS1xqvNrz8IuDD35xiu9u wSajbrxIogaF/Oc2P2BBdS6xJtydw/uEYdLcSYTMKJbH0shnrHYK9ovOFRlyHzMXM1 lc66sbSCkW7gTq3EGX6DzH/BlDiW5KdyE9XFvAKY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 95CC960E59 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=svishnoi@codeaurora.org From: Surabhi Vishnoi To: ath10k@lists.infradead.org Subject: [PATCH v2 1/4] ath10k: Fix the incorrect updation of NSS data in tx stats Date: Tue, 26 Feb 2019 14:57:55 +0530 Message-Id: <1551173278-20926-2-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> References: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190226_012814_267769_72D9A067 X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: a904417fc876 ("ath10k: add extended per sta tx statistics support") Signed-off-by: Surabhi Vishnoi --- drivers/net/wireless/ath/ath10k/htt_rx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 4fc8856..941ae20 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -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) { From patchwork Tue Feb 26 09:27:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10829771 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 EAAE617E6 for ; Tue, 26 Feb 2019 09:28:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D70332B3B0 for ; Tue, 26 Feb 2019 09:28:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C99212B3D2; Tue, 26 Feb 2019 09:28:23 +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=unavailable 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 7AE722B3B2 for ; Tue, 26 Feb 2019 09:28:23 +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:References: In-Reply-To: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:List-Owner; bh=T5Pxchdi58Ae9IplfQZkAZYF5wG3t4wkrIkxPcAFAjY=; b=sg9k6QqKpsoOUjr/PSYgSJgmyY nMmG6tgeNPZirjSm4sUPAXGvyOt4dIkqITsUpF8c68y5NG2o7mSOYNQ0r6V2FSVR0XCqZUFyWCZsH lnZu7aWM5FmxhnTsD53pbHbLwfAC2NivRsMKfJxshAfo4NU6TS4qPZeMIyMulB7uCp7Dw0Jv3DX51 PZx9bkk3Sp3VST/KDk36HmypYyj5gLA6x8xlmgdUJteMPSBDYaqmIKPN3Z9XnP0olVmI7JL7DI0dO A/XgRqf9WlH8AVCsMpf3HNtnsqjJqo0HR8t5Bx6nKW5sprZX3Opb6ABzvM0EN9/D1O9s4dD8iRIe4 s5hFojAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ2E-0001U6-9W; Tue, 26 Feb 2019 09:28:22 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ2A-0001QH-IU for ath10k@lists.infradead.org; Tue, 26 Feb 2019 09:28:20 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1D81C60F3F; Tue, 26 Feb 2019 09:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173298; bh=VQBFLR4B6N44fYtcmoGaYtecKS2NTMTCfmSqBXoZLVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y0LrYLA6ozaal+Y/N74ZR2/6QTbTZXlemvgcNSCeJXNeZYYdOCyHqBuHUKfDCsPUC ng5A9mLEKn8X9tXUmoo844vT7hclhimebUyCDlgcQpDbpT2/dpLwJQ+zAraI4txewl SoBDf4sKSv+u51wEEUOFw2mrH8KOBnM5t4ijH+dw= Received: from svishnoi-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: svishnoi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3FA8360767; Tue, 26 Feb 2019 09:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173295; bh=VQBFLR4B6N44fYtcmoGaYtecKS2NTMTCfmSqBXoZLVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7N3ab1cWMp9pmdNq6Sc8mFfLYvezeDXicNaquvPzPYew661SDREvqiAFIg+3WGXA osser4DiBeQkkgotuxSEuqSRVzGezQ/DSiRYUn9hTjOHDIOdZw6pnIkv8lgaBA+QVK JQeWxMTPiYBmnVP7JlOnQoALFgR2H0ELOCgI4PpU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3FA8360767 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=svishnoi@codeaurora.org From: Surabhi Vishnoi To: ath10k@lists.infradead.org Subject: [PATCH v2 2/4] ath10k: Fix the wrong updation of BW in tx_stats debugfs entry Date: Tue, 26 Feb 2019 14:57:56 +0530 Message-Id: <1551173278-20926-3-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> References: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190226_012819_423220_F6D0C7D1 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, 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 Fixes: a904417fc876 ("ath10k: add extended per sta tx statistics support") Signed-off-by: Surabhi Vishnoi --- drivers/net/wireless/ath/ath10k/debugfs_sta.c | 7 ++++--- drivers/net/wireless/ath/ath10k/wmi.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 8331d8b..c704ae3 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -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, diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index d9b646f..d915942 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -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 From patchwork Tue Feb 26 09:27:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10829777 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 710851399 for ; Tue, 26 Feb 2019 09:28:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58D912B3AE for ; Tue, 26 Feb 2019 09:28:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D4082B3B1; Tue, 26 Feb 2019 09:28:29 +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 E0FCB2B3AE for ; Tue, 26 Feb 2019 09:28:28 +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:References: In-Reply-To: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:List-Owner; bh=AsLWtQkIEm1hufUPGI5dTChQcudAsF43D9cob1oINQg=; b=b8SPyBrAiFGCjrvNsXeOrTExtL UaMyBtfJZ80rMuylsgyrChZjgngDnVcNKyLb1tys53fa4IOPtrByCOD7usF6909GpbhWWljuTKTZ5 GE28XkCELgwuGV45hLfxDc6zoP64K7UyLO+1f4OwJCoIYI4bme0eJsBSOqYoCGkZ5Owx4HE9R0qEX yt/u5m6xv4Puwg5FVA266faGNKkBIGS0JjJ3HZBjM8F+ZD3iunSkfviCesRRFg4WTjo7B4L2wRZ+5 3J7vZHbPwDpbueWDC2cP1yAfJB3LeAZ0LbVs/dg+1Ghjim6w0i1CPtvzxiT3CLp5AAKZkJ0DqOfHp WvY58UDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ2J-0001eO-49; Tue, 26 Feb 2019 09:28:27 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ2E-0001U8-Cy for ath10k@lists.infradead.org; Tue, 26 Feb 2019 09:28:25 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1C4A360208; Tue, 26 Feb 2019 09:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173302; bh=nhfSGt53PoSUjTSlgnj135k6pqYFOY0ku36KxQsUAfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QCvpaFVeWKtHiYPA+VuFA7oeWSA4y82cPoL11id2mtuW+CTRLhicjeTlatlqcyu6F lYWu9HV6pJ+wBASwlc1fx7qU+KiejdeQK1U9QgLuTbflsTy0EVbXwkV6jVDfQfKO7J cUeJKK+qNEBKSe3yttbYiPUB9eUti2OZ6630o4Ys= Received: from svishnoi-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: svishnoi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3346160F3E; Tue, 26 Feb 2019 09:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173299; bh=nhfSGt53PoSUjTSlgnj135k6pqYFOY0ku36KxQsUAfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XThtv9zRgYUnbuXrLV3kLdg1INyFQpoRkqhnAP/grMV0hqOI8dbIt9MKDTPv0Nm7D TZ90yJ5IPRmAL06CyZoqXcDxHd1P+4v9ruu15F68tzu6TsMvJ1JaZJuXqdQ3nIbjF1 lmE9G+AIb08T1o8xgJFt6trOxdg79Gt8Sz2YD/tM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3346160F3E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=svishnoi@codeaurora.org From: Surabhi Vishnoi To: ath10k@lists.infradead.org Subject: [PATCH v2 3/4] ath10k: Fix the wrong updation of SGI in tx_stats debugfs Date: Tue, 26 Feb 2019 14:57:57 +0530 Message-Id: <1551173278-20926-4-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> References: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190226_012822_629707_88B02886 X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The 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 Fixes: a904417fc876 ("ath10k: add extended per sta tx statistics support") Signed-off-by: Surabhi Vishnoi --- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 +++- drivers/net/wireless/ath/ath10k/wmi.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 941ae20..2394a47 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -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; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index d915942..6df9a59 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -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) From patchwork Tue Feb 26 09:27:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10829779 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 C9E281399 for ; Tue, 26 Feb 2019 09:28:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B64EC2B260 for ; Tue, 26 Feb 2019 09:28:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAA5D2B395; Tue, 26 Feb 2019 09:28:34 +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 485D82B35B for ; Tue, 26 Feb 2019 09:28:34 +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:References: In-Reply-To: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:List-Owner; bh=zOlf9aUKald1D4O9EfL401taEO11yDh6NPwztZz/T1o=; b=neC03U8vs6VJBdtHaOvwFOpJuH vXPKp9WXWpAeQ1yELR59Pw00LTdW4kLBJrmm35LzFCbUhlU+QPveZOm40Rg8rdknifJGVhQkG/LvF cP/HWtbwmweSg4FRZFtXk+dSP8BhZ8byMsQp/1cDdhLj3XSMYAdJxQ+kfbfC7Dx6v79xMg9rs3zU4 lcwqiEoF7LAYfbaOr2YL0he9FwmUfoYJh0TIOZJNZS/1rFzTSyTQpT8lu7k+ChZn3WeFtmFqYU+QQ qJVk+Lqrb/beTDXvsBXBFWqr2fm2NxYcVU15BHt2ASAIdjLiwPozv9J+pjax3Y3gZqSHmFl3euX/K hfX68acg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ2P-0001kR-1q; Tue, 26 Feb 2019 09:28:33 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyZ2H-0001bh-B7 for ath10k@lists.infradead.org; Tue, 26 Feb 2019 09:28:31 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 184D56118F; Tue, 26 Feb 2019 09:28:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173304; bh=DTgSUigAa+16wNRwYpKJnzAJHhs31S5eJ+7IIDYgJe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTC6h4rbqpVC91W3dCvy3zWl4AWBQdskeIoM0Y9mnzGgxni1aD/NCTIp1CAG0bwGt 5+7adJfR7lmcewdRbwRKf5Tr97WzRYtWCOdOT/m2CZxUogSsxu34pEyn2FeZ64js7Q VMGgd6Qd3grqEv8QGW8fAHXEkCuGgzHXt8NeKkmI= Received: from svishnoi-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: svishnoi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B87A460FEE; Tue, 26 Feb 2019 09:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551173303; bh=DTgSUigAa+16wNRwYpKJnzAJHhs31S5eJ+7IIDYgJe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bET0Tt901f++gZgKg/BOQM/WpmerLeCRBLBnpKJ09T3FOGXla3wQFr4SjW3PUuA5i 41GInr/re4q0O9J81EwLzaCm7fc3FZJFkWU1DQtC7yMYTB59OxYR4NiEaBMdSdU2Yn yYyR99w+NvkZkh34IBi0kZD9EAibOL8DyTNLkZ3I= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B87A460FEE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=svishnoi@codeaurora.org From: Surabhi Vishnoi To: ath10k@lists.infradead.org Subject: [PATCH v2 4/4] ath10k: Fix the wrong calculation ht_idx and idx of rate table for tx_stats Date: Tue, 26 Feb 2019 14:57:58 +0530 Message-Id: <1551173278-20926-5-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> References: <1551173278-20926-1-git-send-email-svishnoi@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190226_012825_674297_F6F863CE X-CRM114-Status: GOOD ( 11.49 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ht_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 Fixes: e88975ca37d1 ("ath10k: dump tx stats in rate table format") Signed-off-by: Surabhi Vishnoi --- drivers/net/wireless/ath/ath10k/htt_rx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 2394a47..d34c76f 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -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]