Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6672875rwr; Tue, 25 Apr 2023 01:50:40 -0700 (PDT) X-Google-Smtp-Source: AKy350YqLqA6gV4N6RhHCtKxfD2waoaH9Z5RUXmz791Zjfi2PcyLaxnfvsoK/aNH+jTtqm3xc7PK X-Received: by 2002:a05:6a00:1301:b0:63d:2b95:5476 with SMTP id j1-20020a056a00130100b0063d2b955476mr24238594pfu.23.1682412640379; Tue, 25 Apr 2023 01:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682412640; cv=none; d=google.com; s=arc-20160816; b=0Mn62vX1HwBP6i9oBi6ZLNwYdCoglS1GLHzeMjiKUix3TW0Oi5aFeJ2pxDZEN63eYz 6QVKfZfKGrA3+o4mRySowKi1JiDIbBSMSuYE6/4Kln+l5ypi64X1WlziZJkkAdMiLWYr 7LIGxYP0XiNN+KbBVQYHm0VW3s666auxJAKrq54HSxuv/eCE/YTKQJWWo4MAhbPd/Uhv rXC+ZVuseVb/3u7Q1m7RPzAFCmXkp0T3fHyG5jN3gtF+OBRPcaDM2K6RBScssuf0xYlE erxFiv0fX8eJyOzj+g8I/3SeD3exnhC0EEOFUVP1mzZPjtIbQip9ABXjRw+lcQTGdRQb ArkQ== 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=L4AaNdx6DgMeGcSw1isGPWwITB80/UsSWmR+7RWh66qfK2Aa0C9rtP7QXrzh7PlbYt abpQSNfhxU9dQo5sznDRmdV52Hft+zk/eZKB+3gpYb+U2njOV64h5rZnqeYskZYHs2et eSIujKBJxUmnrRhuVH8awLWP0r4yi1abYh7MFlePY6YCsTqyfYyR0MG/+iqnyi5d0GSP Wh9PtF4YrdBU5fQypqURxwHBT+A5starmbJFz0R3bK5TaaV+af9Ss+Okkwz2vbo9tHXn FL2wuImwbZzkQ40xhmumS4T4lepcbaFfFdceZxL+rRiICnrw/kutilBH0HVK2H2IwQWn SkRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=drew8+YS; 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 d1-20020aa797a1000000b00639b0f72b5esi13201545pfq.55.2023.04.25.01.50.31; Tue, 25 Apr 2023 01:50:40 -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=drew8+YS; 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 S233748AbjDYIqb (ORCPT + 62 others); Tue, 25 Apr 2023 04:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233506AbjDYIqM (ORCPT ); Tue, 25 Apr 2023 04:46:12 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C6D2146C0 for ; Tue, 25 Apr 2023 01:43:59 -0700 (PDT) X-UUID: 4e6f20aae34511edb6b9f13eb10bd0fe-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=drew8+YS/GWDXqZxzzcCmPjPXo853iA5KH3w4VcLEcBQgcq6wz8TxGjJPsDa/JFbEIF2521+r38bHnmbYdeEH46CS7aKbLe++RK3lM6bZft6u5yK4zusHSc68xdFKqBMygs/nYIA0tIk4fsrTtSynYMxou21FuT01BcolRBGDpA=; X-CID-CACHE: Type:Local,Time:202304251638+08,HitQuantity:1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:4a319755-7633-4875-9401-833badce7cd3,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: 4e6f20aae34511edb6b9f13eb10bd0fe-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 1938865880; Tue, 25 Apr 2023 16:43:52 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) 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; Tue, 25 Apr 2023 16:43:52 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Tue, 25 Apr 2023 16:43:52 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Peter Chiu , Ryder Lee Subject: [PATCH 2/2] wifi: mt76: report non-binding skb tx rate when WED is active Date: Tue, 25 Apr 2023 16:43:51 +0800 Message-ID: <04be3a596ebf25136ab2e7d9abc602b8f061a9c8.1682412180.git.ryder.lee@mediatek.com> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham 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