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: 10825359 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 CCBA9922 for ; Fri, 22 Feb 2019 07:21:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2B6A30F20 for ; Fri, 22 Feb 2019 07:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6D5F30F22; Fri, 22 Feb 2019 07:21:09 +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 4FDF530F20 for ; Fri, 22 Feb 2019 07:21:09 +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=UZVQ7bxUUJZovke0h+3isxY/D6PH2NJ4uJ64+FwBsHQ=; b=NN43TN30YFBr3m5yGNlH9B8QK7 fYVCCeUFEzhFw63u0SVGrc6Jienj072Tzbhz4NCCWsSi3JUW47IMN5dEbJeijWXm1w0xSW7KYX1mm bJP8wB8ioQZBE1G3lu/YL52ozGXsx5XGv35T+2FDX0Okc9x9Tiqt2gDCuOeD8wVtKCSiyeiAkZbZV g5nM4t16D29nkMm/jCT63pNYgqxlC0hGCektPd+Kv1erHATVNTF5ANr8U6fpczdX7orkkh+oVtomP xZFtbQ5NYUAlqRnY4IvlJ8ZnTdWj1Bt5ZVFuP20E6zHnwFivn9dBYk3G1g884mg7A4FxO9cf/PWzh wrOGl0VQ==; 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 1gx58u-0000BZ-Ga; Fri, 22 Feb 2019 07:21:08 +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 1gx58p-0008T2-Pt for ath10k@lists.infradead.org; Fri, 22 Feb 2019 07:21:05 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 30BE460A7E; 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_232103_880873_CA1A48E0 X-CRM114-Status: GOOD ( 11.11 ) 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 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]