From patchwork Mon Apr 4 16:54:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 12800712 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 802ADC3527B for ; Mon, 4 Apr 2022 21:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379112AbiDDVSq (ORCPT ); Mon, 4 Apr 2022 17:18:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379297AbiDDQ4Z (ORCPT ); Mon, 4 Apr 2022 12:56:25 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF9212081; Mon, 4 Apr 2022 09:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649091255; bh=nur5FiBoKG2Pk6zBljtUKrk0goAt0qFlO1FhNGRQ2nE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=X9sIb5rMoRA9kieSYsMtEeU75Xm1kZ//kgFg5Ym2XDxXcG9MrvCo1jNRG1O+pAyfw rjtIT1tzV38E1+hzJDX/AAKlTs/9WYxKeSYOoQfFdSDoh1yTdyA2g9KauQbA3ewdca b5Sy/CiREGPgdU+w5lVsy4nCANfn76FltwZynzEI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.fritz.box ([62.216.209.4]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MS3mt-1nPdTI2WfD-00TVKV; Mon, 04 Apr 2022 18:54:15 +0200 From: Peter Seiderer To: linux-wireless@vger.kernel.org Cc: Johannes Berg , "David S . Miller" , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] mac80211: minstrel_ht: fix where rate stats are stored (fixes debugfs output) Date: Mon, 4 Apr 2022 18:54:14 +0200 Message-Id: <20220404165414.1036-1-ps.report@gmx.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:yjgNxi1rZbrb0NCnjBsXoUVVAnaAq81oGLhKNqApsk0+4Fs0xh2 k5kM2NPZRtEYpSNXhVVsSa9lg0VVT71xPp9jhhErbTjI5Kj8ecItb2FOpHegCffBiFDFuOz NT+NUojEKYaxp7Q1Mvw9IBTRPsa+6JOReOe73ZpB6ct1Uvu8xEkEhgty5xl8396hcfvrT+3 JMOEYp3lqr8Mjt5J2YgXA== X-UI-Out-Filterresults: notjunk:1;V03:K0:913oNBO2RCY=:MGT2G5GLF3Udxoyd8KwCcO M4iWEVWnK389nsc6/s4djCwDbL0Ub/gbwp8ivDemJjuWL7fUqJL2b2udF919+KHbzU8HQh3Gw Tczw8IAVZeMa/roNkUTpF/sxstOwy3P1HElNs1St5qVMZxhlxl6mJWCyQkP4Xjq7LMh0AgWoG dsSFcosdWMnwAWQoF6nu01eaE4ELwdiLcBVmbxMldWE9QkNpaEVRDLNsQGrUlyZGonIDpdCTH 2hCmWoNtKSv4e6x46njAvpDlpE0A5zoaEo1wBZ4izr6WTojwP5+1ut38IirLTeLuwHNeEiOgB b4NC3FtTO+Xk/IM6f3WlZtWmO78xeUdRpaEWrVZ+aUy9NlAFhkUTO/Y64BCOpoIp4oNZnCNwl CGBOcVaILwlVWMqgqo/45HerBRA/HZkCgCFzQYsCs65rU+S4QIHeVEhx5FyjQ3ykPY/qdqsMC lHE+VgkHo8+MvH1+7xIy/NtWzhA1usJl12ulm3EkztF9rGihYUZ7pb7fIvyZL0d3AmXCb0Zr2 HB8JucDPak5OO/4Gu9c+YRXF5tSUgVJZb7NP/vHtaSbUv4sld8Tv4B9klEvAlZbwVkRQzEt+u 2+cPvVBJuffgxmEpP7W5drGA0KvepbD4dFqQxqAdIaVbNuZ31PUYQgjea/6gnLVNVUq89kGhQ 1QsOVGO6dB24biF2ssR7TRPhEtQHYFD8zzmzXysyGM6f0dyH1hIBj7kqfUyNX3pJVK8Y1/Xqx yBuxNQyY81xW5aNYYl2iXjftHf0ma4ohOwARy0F7E0ufQCLAMY4B+sDmU2lPtu1dUW4oBx7Ga rvrPnB5a+9YTca1hYlKzNlq4jJWN4zB/vXsL+r1bvKwdLKyWcsd94aMdD+ZE6uSjyfJDJts0E 5rETye3Zu7kJj6oNCiP5pxUv4IysO3forqow9TKwcDBlf7fzogqwRymaHhfQVZPjmQYAWSrI8 iKhNj0ZoN7/RNNwFCKmBoHvv6JMgLWjvSatp3P8KD4S1iUnBjiV08KuO+91d3dOuj1TT+3zcP QpklQ2bnpiJA07KQFW1TW0nW02FQUmyWXthhz/6NXX6NCzgPSwVOMR82YrM+8HHvMGqYuxBsZ SHPlnYd891Hqhs= Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Using an ath9k card the debugfs output of minstrel_ht looks like the following (note the zero values for the first four rates sum-of success/attempts): best ____________rate__________ ____statistics___ _____last____ ______sum-of________ mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts] OFDM 1 DP 6.0M 272 1640 5.2 3.1 53.8 3 0 0 0 0 OFDM 1 C 9.0M 273 1104 7.7 4.6 53.8 4 0 0 0 0 OFDM 1 B 12.0M 274 836 10.0 6.0 53.8 4 0 0 0 0 OFDM 1 A S 18.0M 275 568 14.3 8.5 53.8 5 0 0 0 0 OFDM 1 S 24.0M 276 436 18.1 0.0 0.0 5 0 1 80 1778 OFDM 1 36.0M 277 300 24.9 0.0 0.0 0 0 1 0 107 OFDM 1 S 48.0M 278 236 30.4 0.0 0.0 0 0 0 0 75 OFDM 1 54.0M 279 212 33.0 0.0 0.0 0 0 0 0 72 Total packet count:: ideal 16582 lookaround 885 Average # of aggregated frames per A-MPDU: 1.0 Debugging showed that the rate statistics for the first four rates where stored in the MINSTREL_CCK_GROUP instead of the MINSTREL_OFDM_GROUP because in minstrel_ht_get_stats() the supported check was not honoured as done in various other places, e.g net/mac80211/rc80211_minstrel_ht_debugfs.c: 74 if (!(mi->supported[i] & BIT(j))) 75 continue; With the patch applied the output looks good: best ____________rate__________ ____statistics___ _____last____ ______sum-of________ mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts] OFDM 1 D 6.0M 272 1640 5.2 5.2 100.0 3 0 0 1 1 OFDM 1 C 9.0M 273 1104 7.7 7.7 100.0 4 0 0 38 38 OFDM 1 B 12.0M 274 836 10.0 9.9 89.5 4 2 2 372 395 OFDM 1 A P 18.0M 275 568 14.3 14.3 97.2 5 52 53 6956 7181 OFDM 1 S 24.0M 276 436 18.1 0.0 0.0 0 0 1 6 163 OFDM 1 36.0M 277 300 24.9 0.0 0.0 0 0 1 0 35 OFDM 1 S 48.0M 278 236 30.4 0.0 0.0 0 0 0 0 38 OFDM 1 S 54.0M 279 212 33.0 0.0 0.0 0 0 0 0 38 Total packet count:: ideal 7097 lookaround 287 Average # of aggregated frames per A-MPDU: 1.0 Signed-off-by: Peter Seiderer --- net/mac80211/rc80211_minstrel_ht.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 9c6ace858107..5a6bf46a4248 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -362,6 +362,9 @@ minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, group = MINSTREL_CCK_GROUP; for (idx = 0; idx < ARRAY_SIZE(mp->cck_rates); idx++) { + if (!(mi->supported[group] & BIT(idx))) + continue; + if (rate->idx != mp->cck_rates[idx]) continue;