All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] mac80211: minstrel_ht: fix where rate stats are stored (fixes debugfs output)
@ 2022-04-04 16:54 Peter Seiderer
  2022-04-04 21:33 ` Peter Seiderer
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Seiderer @ 2022-04-04 16:54 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, David S . Miller, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel

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 <ps.report@gmx.net>
---
 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;
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] mac80211: minstrel_ht: fix where rate stats are stored (fixes debugfs output)
  2022-04-04 16:54 [PATCH v1] mac80211: minstrel_ht: fix where rate stats are stored (fixes debugfs output) Peter Seiderer
@ 2022-04-04 21:33 ` Peter Seiderer
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Seiderer @ 2022-04-04 21:33 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, David S . Miller, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel, Felix Fietkau


+ CC: Felix Fietkau

On Mon,  4 Apr 2022 18:54:14 +0200, Peter Seiderer <ps.report@gmx.net> wrote:

> 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 <ps.report@gmx.net>
> ---
>  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;
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-04 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 16:54 [PATCH v1] mac80211: minstrel_ht: fix where rate stats are stored (fixes debugfs output) Peter Seiderer
2022-04-04 21:33 ` Peter Seiderer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.