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]