Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4866097rwr; Sun, 23 Apr 2023 15:27:54 -0700 (PDT) X-Google-Smtp-Source: AKy350Zj7g0UX/muURg1xyhxWEGycNIYF4xZmuxjTsl0qI18B6StATaxJOc72hallCL6hc+CKREC X-Received: by 2002:a05:6a20:9387:b0:f5:8681:14d9 with SMTP id x7-20020a056a20938700b000f5868114d9mr393253pzh.39.1682288873792; Sun, 23 Apr 2023 15:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682288873; cv=none; d=google.com; s=arc-20160816; b=nq/r6gUwsDjLOVSkc76oMzjhUwcoxBLHIxP0pgEreQRkI40GmFl4esCQGspwQA8zNU g87tfOzKq2Rj5IbCrmcF+VH2FBrgLBn8RxyKBnHWOwk9U47ahIE7BUaRDiYamNUPKZp0 RcnPrKphbhbCKpfFaFGVBIPJ/ogaH1igfsLVw67fwcqUqQrb7SECszwPcUHsddcgWLGo SgAB8Aaf3mUhwz/QGWJ+qIMA7aoPbsywRdTDkTeFiJLIOe8lzqRLHfocNP5SO41tAu4i PEZdo0qSigRqSQToz6/ocdj/SGieCu9L49fshKHSBAqS5Uq/mgWYh1RSS7D3dbCoCOL0 3nrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BBn3QEzegzb0p42nF9E4XKquKjHmcytH4/jiephNRUc=; b=YxGQHWLDqX0wiSzvEt87Y4u/MeAlTXBc2GV5wHuDkqRzRFFEVkoGxcx2uBcKotfdaH F5MWihDuKsOO/Q5Wii0pWbqzVuRoHi6wndSqRtAL+6HLEUaZviIQyD0J5dkf1JwOrMsp u/FSvy6CWv1gLYJZgZIImGtwt1F5J/EepMhta33nSkXRw1f2DsgR9tedz9KFpsysmBzo eYZUEMFZXyJUb3qOXKdBKIfJNHqK6coiSlrex9i9oH8+MjrYf4WVDU8b3vJ0ec/yFXKO vrDduaS574/PTOT9KxLj1+/DRil0feBrexqwURj7Le/sn9GT9bP3OT80/6MgTY7MEf55 IKYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=MrZHj8NR; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a6540cb000000b0051b25fd77absi8976509pgp.887.2023.04.23.15.27.46; Sun, 23 Apr 2023 15:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=MrZHj8NR; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbjDWVjZ (ORCPT + 62 others); Sun, 23 Apr 2023 17:39:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbjDWVjX (ORCPT ); Sun, 23 Apr 2023 17:39:23 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D00AEB for ; Sun, 23 Apr 2023 14:39:15 -0700 (PDT) X-UUID: 47bc074ae21f11edb6b9f13eb10bd0fe-20230424 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=BBn3QEzegzb0p42nF9E4XKquKjHmcytH4/jiephNRUc=; b=MrZHj8NRSFQ2rbnk46R1PKjS6CbsOfPXOQs9znxkKD/FAZ4oaROM8xY8YqLaKlVRkPXghwh+Qsbsn0OVywSIArcbNfWZ5400JiitIv6qZGC7+1YP5OfCvNY4UQd7hj5IOaP1+vqrVpgOV3ETZaFit+Oxzgnk65unCaYPRgHEGHw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:31d95215-a288-45b5-a1c8-5f6c077a3833,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:51dff684-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 47bc074ae21f11edb6b9f13eb10bd0fe-20230424 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1187963085; Mon, 24 Apr 2023 05:39:09 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 24 Apr 2023 05:39:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Mon, 24 Apr 2023 05:39:08 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Ryder Lee Subject: [PATCH 2/2] wifi: mt76: connac: fix stats->tx_bytes calculation Date: Mon, 24 Apr 2023 05:39:06 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: <16fa938373e3b145cb07a2c98d2428fea2abadba.1682285873.git.ryder.lee@mediatek.com> References: <16fa938373e3b145cb07a2c98d2428fea2abadba.1682285873.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_MSPIKE_H2,RDNS_NONE,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The stats->tx_bytes shall subtract retry byte from tx byte. Fixes: 43eaa3689507 (wifi: mt76: add PPDU based TxS support for WED device) Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h | 2 +- drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h index a5ec0f631385..fabf637bdf7f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h @@ -173,7 +173,7 @@ enum { #define MT_TXS5_MPDU_TX_CNT GENMASK(31, 23) #define MT_TXS6_MPDU_FAIL_CNT GENMASK(31, 23) - +#define MT_TXS7_MPDU_RETRY_BYTE GENMASK(22, 0) #define MT_TXS7_MPDU_RETRY_CNT GENMASK(31, 23) /* RXD DW0 */ diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c index ee0fbfcd07d6..d39a3cc5e381 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c @@ -608,7 +608,8 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid, /* PPDU based reporting */ if (FIELD_GET(MT_TXS0_TXS_FORMAT, txs) > 1) { stats->tx_bytes += - le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE); + le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE) - + le32_get_bits(txs_data[7], MT_TXS7_MPDU_RETRY_BYTE); stats->tx_packets += le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_CNT); stats->tx_failed += -- 2.18.0