Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6670214rwr; Tue, 25 Apr 2023 01:47:20 -0700 (PDT) X-Google-Smtp-Source: AKy350bot3EWKKb5AF7qt4PBT5jE2QeRCW3/elMx96M2PoueOyUfuKnz9o2eyHPMjo/I/XPnEYRF X-Received: by 2002:a05:6a00:2383:b0:63f:1a1e:3000 with SMTP id f3-20020a056a00238300b0063f1a1e3000mr17917578pfc.6.1682412440309; Tue, 25 Apr 2023 01:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682412440; cv=none; d=google.com; s=arc-20160816; b=k6VSCTfXnSc+jibMcg4U1EA4dYvwSlGqUoerztOPo1w5O7S3c3nc/KmOI4sfpPnI+m UDiHrBAbOHbeSjv3y/K3ucuA1x6tJDKdTeT2nIGdO0eiPIsOSaiv/GJyaS4b4C0HdQki Y8x2NUJxGKA1+zqWUHeFODZYV7PgKGdXm97UFBQBS8wiEYQqn+Z9rJOl7W5BZQM3LsJf d6xfDA5vhVwmCjj/bKC2RE3zA4uRF452h4z+Xbb6u/YJcSEtk7nJWL7sR9C7Hh8Y5bjr UH4O9KXe7HyDz5LcWLjZtjrYBYMOThBvKc3Q7qa8M+G3AOlJh/EHriAl3BDb4qZU1QWK Ip0A== 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=GKEBBk8I8E0Ib+tKnKPBklCRbMe9hUzeTsEMpA7lmoI=; b=IIT69ehHm/Bp7HZEfDSUroqz9pI5J0Ona801iX/Gfb8iX04lEtxhfsslplXjsoGBu8 jWJojtCYcTZWsPVoJU4Vp2XHSsPpYi2ETviil/K2Avc5SL1HkSqXtDgTRGR12XhkMkfP ob/SP/eZbJkPJ8XzKE3HKew6sSKZTg4Fg46L10kUee3QKGHPacZzHXtSrclO3EJAg/1X ihb892m9/Ux/erx+SZs4ETvMnOcCN/OIrOl+pxu2WJwq8vSztk5/325EHNrcmJYg8WfX RYF88OiHiAxyw9l8ZmsIriVZ0y7W9MkjF2Wl4J6a1gSVNa6d0JDde5KQwzWRMM+FCohG 0CUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=g3iePMoa; 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 135-20020a63018d000000b0050fa589bc92si13528942pgb.815.2023.04.25.01.47.08; Tue, 25 Apr 2023 01:47:20 -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=g3iePMoa; 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 S233440AbjDYIlN (ORCPT + 63 others); Tue, 25 Apr 2023 04:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234203AbjDYIk3 (ORCPT ); Tue, 25 Apr 2023 04:40:29 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6EFA161B6 for ; Tue, 25 Apr 2023 01:38:39 -0700 (PDT) X-UUID: 7cdd6308e34411edb6b9f13eb10bd0fe-20230425 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=GKEBBk8I8E0Ib+tKnKPBklCRbMe9hUzeTsEMpA7lmoI=; b=g3iePMoaltjvtkkWPCAr4J88XAXxEW9mIlZlMwBHpeDR/y1XpxKJvEeFBr+eJi2PpPLlaI7jt/kBRFgDeG6vjPAEFxt3RaF9Ifys6dXFH97FTzuC0Rr7bqzwGTMxAeTXiSOiasRg9tNWjqd78KfoLQrZRsA08Orh0VuiN1vNS44=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:90503540-7b1b-4de9-b1ac-24b86e3527d7,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:acd32b85-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 7cdd6308e34411edb6b9f13eb10bd0fe-20230425 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 332730307; Tue, 25 Apr 2023 16:38:01 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Tue, 25 Apr 2023 16:38:00 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 25 Apr 2023 16:38:00 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Peter Chiu , Ryder Lee Subject: [PATCH 2/2] mt76: report non-binding skb tx rate wehn WED is active Date: Tue, 25 Apr 2023 16:37:46 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY, URIBL_BLOCKED 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 From: Peter Chiu AQL requires tx rate for accurate counting, but it can't work well without non-binding skb rate reporting when WED is enabled. Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Peter Chiu --- drivers/net/wireless/mediatek/mt76/tx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 99d395bd1bba..37337595c65d 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -269,8 +269,22 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff * #endif if (cb->pktid < MT_PACKET_ID_FIRST) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_rate_status rs = {}; + hw = mt76_tx_status_get_hw(dev, skb); status.sta = wcid_to_sta(wcid); + if (mtk_wed_device_active(&dev->mmio.wed) && + (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) { + info->status.rates[0].idx = -1; + if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { + rs.rate_idx = wcid->rate; + status.rates = &rs; + status.n_rates = 1; + } else { + status.n_rates = 0; + } + } spin_lock_bh(&dev->rx_lock); ieee80211_tx_status_ext(hw, &status); spin_unlock_bh(&dev->rx_lock); -- 2.18.0