From patchwork Fri Feb 22 07:20:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10825343 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 1BECB139A for ; Fri, 22 Feb 2019 07:20:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 032B630F21 for ; Fri, 22 Feb 2019 07:20:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBF0830F64; Fri, 22 Feb 2019 07:20:53 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8498130F22 for ; Fri, 22 Feb 2019 07:20:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbfBVHUx (ORCPT ); Fri, 22 Feb 2019 02:20:53 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:58252 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbfBVHUw (ORCPT ); Fri, 22 Feb 2019 02:20:52 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DA89C6098B; Fri, 22 Feb 2019 07:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820051; bh=++IYFAlbfKwciaSgrWgxoEraMzpZpznMm9fRjnPKgOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fno/SZ06Oh/JXsaFN4C3UJA4bG0h+WVeSrg0Z/aLgLI+GFMrbUrxYQIJWTaWlKzJD NXvMU1Sl80Qr94yPua+r3o5amJEW4fqjdqdBq0sYdV/8mISI8jwTkcVT4OBkJXyxgn 7y/qhCKQ6K1c88V4mPbS76/whAw68ahPIidBV6jI= 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 B8A55607EF; Fri, 22 Feb 2019 07:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820051; bh=++IYFAlbfKwciaSgrWgxoEraMzpZpznMm9fRjnPKgOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fno/SZ06Oh/JXsaFN4C3UJA4bG0h+WVeSrg0Z/aLgLI+GFMrbUrxYQIJWTaWlKzJD NXvMU1Sl80Qr94yPua+r3o5amJEW4fqjdqdBq0sYdV/8mISI8jwTkcVT4OBkJXyxgn 7y/qhCKQ6K1c88V4mPbS76/whAw68ahPIidBV6jI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B8A55607EF 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 Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi Subject: [PATCH 1/4] ath10k: Fix the incorrect updation of NSS data in tx stats Date: Fri, 22 Feb 2019 12:50:31 +0530 Message-Id: <1550820034-18603-2-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> References: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 d5c666c..3a02a76 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2980,7 +2980,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; @@ -2988,7 +2988,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; @@ -3000,27 +3000,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 Fri Feb 22 07:20:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10825347 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 8154B922 for ; Fri, 22 Feb 2019 07:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69FFD30F22 for ; Fri, 22 Feb 2019 07:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E79230F72; Fri, 22 Feb 2019 07:20:59 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 030DF30F22 for ; Fri, 22 Feb 2019 07:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbfBVHU6 (ORCPT ); Fri, 22 Feb 2019 02:20:58 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:58362 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726272AbfBVHU6 (ORCPT ); Fri, 22 Feb 2019 02:20:58 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 02A71607EF; Fri, 22 Feb 2019 07:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820057; bh=pt1WkFPlBl2dAXeIc31nXbM9kqPjTzEPqko1Zunb3I8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=muPnrCfZlagni/k2gA3hQ29f7AQoVHDmu/acEp7HUxX2RiLTJbNHz6x0QqWgQlu0t h47qYQiV4KThokHOnXGYiefZspsFPl72jypeJLtDA6h+z0RGbZvM7wrrn2uQPYLQYy NKsetdSCiSxak3TizK6HoxdkLfEtmsMZfcYEbKHM= 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 1DE80609C1; Fri, 22 Feb 2019 07:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820055; bh=pt1WkFPlBl2dAXeIc31nXbM9kqPjTzEPqko1Zunb3I8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qb0dtp8+wVartUjO/kdcN0+6cmZXcpqwuFWLOxltAfKhqVWmxJ4/3yTMAN4wKufM7 zhTsGq80kH01SYMzaKQQhJSCebM0rk3pP13oJWh8KJqAIcSomGniDH3OGiN21CH46Y mE3zSF2KcqRKJXyNhw0IssWDh8nqFZWK24zbVmdM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1DE80609C1 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 Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi Subject: [PATCH 2/4] ath10k: Fix the wrong updation of BW in tx_stats debugfs entry Date: Fri, 22 Feb 2019 12:50:32 +0530 Message-Id: <1550820034-18603-3-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> References: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 | 8 +++++--- drivers/net/wireless/ath/ath10k/wmi.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 4778a45..645ba9c 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -696,11 +696,13 @@ 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 0e27878..7053db4 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -5056,7 +5056,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 Fri Feb 22 07:20:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10825351 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 9BCEC1823 for ; Fri, 22 Feb 2019 07:21:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 831B430F20 for ; Fri, 22 Feb 2019 07:21:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 778D230F64; Fri, 22 Feb 2019 07:21:02 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DFCE30F22 for ; Fri, 22 Feb 2019 07:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726314AbfBVHVB (ORCPT ); Fri, 22 Feb 2019 02:21:01 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:58502 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfBVHVB (ORCPT ); Fri, 22 Feb 2019 02:21:01 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DA99860A5F; Fri, 22 Feb 2019 07:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820060; bh=ZoCengWbElX2M6EjafFC20lVt92p4OFtqidaUF/E16Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NJzGWT5pvATcRfbMK5zMXE2onMsbumE5NOT7KrJFBoTGXGyfqdO21n7shjsXoLgne yctL8fs1cnd0r3QrXPCmURWg0l2S4gTfRYtIkyBqKJF9wkiArfzqRAsCayT/Dddz0c 80Cm6CUqIvcspponAE2lp9XAhztxHwTfweJYqe5g= 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 ECE09609BD; Fri, 22 Feb 2019 07:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820058; bh=ZoCengWbElX2M6EjafFC20lVt92p4OFtqidaUF/E16Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ggDmQ7XudoQVmwwAfIP3x0HEWZdnwSneHIUtLeQdoIBVEBwfT6uRN+9OFlt6WAbj3 O57AGOosuAzywsNyU+8odPiEYoH/qE0mPXqWzPqJigqNyeqtfZF4sA6mvOsRc6lNny dDB6va2FylMHLqTc9cjJpc+ZGjwIYo5qZFdcy6og= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org ECE09609BD 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 Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi Subject: [PATCH 3/4] ath10k: Fix the wrong updation of SGI in tx_stats debugfs Date: Fri, 22 Feb 2019 12:50:33 +0530 Message-Id: <1550820034-18603-4-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> References: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 | 3 ++- drivers/net/wireless/ath/ath10k/wmi.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 3a02a76..5b1dd58 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2924,12 +2924,13 @@ 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); + 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 7053db4..b727232 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -5062,6 +5062,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 Fri Feb 22 07:20:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10825353 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 0D51B922 for ; Fri, 22 Feb 2019 07:21:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E967530F20 for ; Fri, 22 Feb 2019 07:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDC3330F64; Fri, 22 Feb 2019 07:21:04 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 895D330F20 for ; Fri, 22 Feb 2019 07:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726320AbfBVHVD (ORCPT ); Fri, 22 Feb 2019 02:21:03 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:58724 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfBVHVD (ORCPT ); Fri, 22 Feb 2019 02:21:03 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id ED98D60A60; Fri, 22 Feb 2019 07:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820063; bh=gEF2fQEw8jM7N+HFLRvkOQD2tq7g9xMuGJjPHD7PM5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XoM0G1LEnYjb8MK+10mzP8p264zWUQ0B8Mgij5beg8Ea1EAiL/gWd1xIl9wgOGFNo t5otwP+chTxb1wV2krKXKHgtDuRdph/mrsabPEgIcjz9tZWYaqvyrY/1JV6h7UOSfl MgPohIMEgklTHBfHGVxydnK0EdehQ6wyNP2q2CLo= 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 EE77760A61; Fri, 22 Feb 2019 07:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550820061; bh=gEF2fQEw8jM7N+HFLRvkOQD2tq7g9xMuGJjPHD7PM5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iy59QkC25VVVqM2uXh/Oh6EWKWMpsLv3KLFvn2Vi7o5kqo4oaaoDlHnA9nb+nwfSf it5FKpv8JfSLy0A7UwYHeHvlijPL+6vHuIuBcCVFF2t1IyUwJIjNiQstwtK4zu9hI6 p9gbargp1CLcmnrLyuAoS4x3RPKknE33mWvlSXdo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EE77760A61 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 Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi Subject: [PATCH 4/4] ath10k: Fix the wrong calculation ht_idx and idx of rate table for tx_stats Date: Fri, 22 Feb 2019 12:50:34 +0530 Message-Id: <1550820034-18603-5-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> References: <1550820034-18603-1-git-send-email-svishnoi@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 5b1dd58..b504c4f 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2931,11 +2931,11 @@ static inline s8 ath10k_get_legacy_rate_idx(struct ath10k *ar, u8 rate) tx_stats = arsta->tx_stats; 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]