From patchwork Mon Mar 11 15:53:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10847739 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 A991F17EF for ; Mon, 11 Mar 2019 15:53:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9110C291BF for ; Mon, 11 Mar 2019 15:53:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 856BE291D4; Mon, 11 Mar 2019 15:53:37 +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 3807B291BF for ; Mon, 11 Mar 2019 15:53:37 +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=i4s03B2uqlV3JDUSVEWWzwdAsE5/yk7ZIFpm3jAiRAQ=; b=eC0Pm+MLWP+zNambn9EfTNITIr J5uWvAFvc+e20xLKTHrz7Xh/H8fAEYIXNzRz4reUIkSeGzplJzBAqI1nNofoiI6FfNIPhBTfMZKOy JxXJyUvzmZwtzLTjgxvMGU1C1rAWFjhO2LdGq0hR53kHaX4AH21Gp8m1QRvVS4FqaJUrad5iHu0XO zkeea2CoWIwCibvmzjx9w+uz0OKnviSgk+iyVcHVvrV5Isz1e8uOXlANpzMtltK6ZQjd0/nsIU1Sx 9qlEXT8IRbqYcCe6Nlh1ppV0L9kEN5bwGPl9EoLJdtvJKIyQJxe+EXh5aXii5ZIH9SOfZ/Y34gboC 850E5gNg==; 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 1h3NFA-0006EK-Gf; Mon, 11 Mar 2019 15:53:36 +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 1h3NF7-0006Bh-0t for ath10k@lists.infradead.org; Mon, 11 Mar 2019 15:53:34 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C1D896016D; Mon, 11 Mar 2019 15:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552319612; bh=CM0hDcRbyJ64utIMdr4YIxwB0GNq2WuY2iplAD3XbpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UgxifJd4X76VRpNAScvfTVZc1C0sI1+sJeYECb7W3fRSj6BW/bdGLhplT8tMuTHlZ d6WW7TRVhOdRWK9ARxDBCwy4zX68H3kSEQjNUt1576GIwROujJOfo8rPgNjmBsOffC IGZF0LpNJ6xa+JmWlReEDOQbzGew48VFG1lgip3A= Received: from pillair-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: pillair@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D4260608CE; Mon, 11 Mar 2019 15:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552319612; bh=CM0hDcRbyJ64utIMdr4YIxwB0GNq2WuY2iplAD3XbpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UgxifJd4X76VRpNAScvfTVZc1C0sI1+sJeYECb7W3fRSj6BW/bdGLhplT8tMuTHlZ d6WW7TRVhOdRWK9ARxDBCwy4zX68H3kSEQjNUt1576GIwROujJOfo8rPgNjmBsOffC IGZF0LpNJ6xa+JmWlReEDOQbzGew48VFG1lgip3A= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D4260608CE 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=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Subject: [PATCH 1/2] ath10k: Fix rate table updation in tx stats Date: Mon, 11 Mar 2019 21:23:21 +0530 Message-Id: <1552319602-17795-2-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1552319602-17795-1-git-send-email-pillair@codeaurora.org> References: <1552319602-17795-1-git-send-email-pillair@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_085333_080822_36C3C2F3 X-CRM114-Status: UNSURE ( 9.37 ) 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: Rakesh Pillai , linux-wireless@vger.kernel.org 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 index for updating rate table, which is displayed in the tx stats via debugfs, is calculated using the bandwidth value. The bandwidth values do not map correctly with the bandwidth values shown in the rate table. Correct the bandwidth value calculation which is used to calculate the index for rate table updation for tx stats. 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: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 +++- 1 file 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 a20ea27..8c3c940 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2922,6 +2922,7 @@ ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar, struct ath10k_htt_tx_stats *tx_stats; int idx, ht_idx, gi, mcs, bw, nss; unsigned long flags; + int rtable_bw; if (!arsta->tx_stats) return; @@ -2930,11 +2931,12 @@ ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar, flags = txrate->flags; gi = test_bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT, &flags); mcs = ATH10K_HW_MCS_RATE(pstats->ratecode); + rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags); bw = txrate->bw; nss = txrate->nss; ht_idx = mcs + (nss - 1) * 8; idx = mcs * 8 + 8 * 10 * (nss - 1); - idx += bw * 2 + gi; + idx += rtable_bw * 2 + gi; #define STATS_OP_FMT(name) tx_stats->stats[ATH10K_STATS_TYPE_##name] From patchwork Mon Mar 11 15:53:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10847741 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 BCB3E17EF for ; Mon, 11 Mar 2019 15:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5096291A5 for ; Mon, 11 Mar 2019 15:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99155291C6; Mon, 11 Mar 2019 15:53:42 +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 41D03291A5 for ; Mon, 11 Mar 2019 15:53:42 +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=K6nrO8srYMFDuPlVaiF1fr4b8jF/DHnXMfCBUXEy+Jg=; b=ig7QBBXFUQNcUnAWm/coxxFoth MMGW+mDljDMlwwsiHfUPA1b7VAlMLfhMcZoJWqi/UtcmetPZyDQOSGZSUXH4175SHGlAuD0HWDUrO ji8Z1gIcI8yc0MC3as6Bc1az6ng+V+C8MolphyXsfqIAWFkiWB8KTiYCj+5Yj/8ThPqR7XeDCRHz1 W22fkwblNyd1SaAbOrANYg7fLfP+21h4h4FUfS3xPAMhq11uTL5MhOOvU1xTXa2uZqhERuXJeFylD jBhmGTtHLiJ4Zk4ilUNTpN0R0rLNGaGQkR3fBKh1RWWP+qzjNSkZSxQaCscWYGYkX5jt7nyBvOjml DAwVTfTg==; 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 1h3NFF-0006KL-Fi; Mon, 11 Mar 2019 15:53:41 +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 1h3NF8-0006DE-RI for ath10k@lists.infradead.org; Mon, 11 Mar 2019 15:53:40 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 86715609F3; Mon, 11 Mar 2019 15:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552319614; bh=IjIB6eVkGQGxszUBdficAYOpdpqvf88+WIaGrLXfnPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tkw3+A+ioAF3x06jAwN3tXxQ65u6lMnzsupi4QMu8EuYezHy3W8fRI4/0tx0UD8Gq en38+62glG3RDSsETo3nTNw/GaiUYX5+sy/I8KS/hhVoqagI5X9WDMege+5eW3raKD HJ9jY0wAM/XdAU5BS6XSJdDYi+m9t6GFaxT6F5oI= Received: from pillair-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: pillair@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C8BB460A05; Mon, 11 Mar 2019 15:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552319614; bh=IjIB6eVkGQGxszUBdficAYOpdpqvf88+WIaGrLXfnPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tkw3+A+ioAF3x06jAwN3tXxQ65u6lMnzsupi4QMu8EuYezHy3W8fRI4/0tx0UD8Gq en38+62glG3RDSsETo3nTNw/GaiUYX5+sy/I8KS/hhVoqagI5X9WDMege+5eW3raKD HJ9jY0wAM/XdAU5BS6XSJdDYi+m9t6GFaxT6F5oI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C8BB460A05 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=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: Fix NSS tx stats for legacy rates Date: Mon, 11 Mar 2019 21:23:22 +0530 Message-Id: <1552319602-17795-3-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1552319602-17795-1-git-send-email-pillair@codeaurora.org> References: <1552319602-17795-1-git-send-email-pillair@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_085335_105554_EFE13F23 X-CRM114-Status: UNSURE ( 9.29 ) 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: Rakesh Pillai , linux-wireless@vger.kernel.org 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 ratecode field given by firmware in the tx stats gives the details of NSS and MCS, if the preamble specifies that it is HT/VHT. In case of OFDM/CCK, as specified by the preamble, the ratecode indicates the legacy rate instead of NSS/MCS data. For OFDM/CCK cases, the NSS should always be 1, i.e. 1x1 mode for 11g and 11b. Currently the legacy rate is misinterpreted as NSS & MCS, leading to incorrect updation of tx stats corresponding to NSS, which is displayed in the tx stats via debugfs. Fix the nss value to 1 for 11b and 11g modes by checking the preamble indication in the ratecode provided by the firmware. 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: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 8c3c940..c1308a6 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2955,6 +2955,8 @@ ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar, STATS_OP_FMT(RETRY).ht[0][ht_idx] += pstats->retry_bytes; STATS_OP_FMT(RETRY).ht[1][ht_idx] += pstats->retry_pkts; } else { + /* For 11g and 11b, NSS is 1x1 */ + nss = 1; mcs = legacy_rate_idx; STATS_OP_FMT(SUCC).legacy[0][mcs] += pstats->succ_bytes;