Search Linux Wireless

Re: [PATCH] nl80211: fix radio statistics in survey dump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, 29 October 2021 09:25:39 CEST Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
> 
> Even if userspace specifies the NL80211_ATTR_SURVEY_RADIO_STATS
> attribute, we cannot get the statistics because we're not really
> parsing the incoming attributes properly any more.
> 
> Fix this by passing the attrbuf to nl80211_prepare_wdev_dump()
> and filling it there, if given, and using a local version only
> if no output is desired.
> 
> Since I'm touching it anyway, make nl80211_prepare_wdev_dump()
> static.

Tested-by: Sven Eckelmann <sven@xxxxxxxxxxxxx>

Thanks for checking the problem. I've tested it together with 
https://patchwork.kernel.org/project/linux-wireless/patch/20211029072939.15767-1-johannes@xxxxxxxxxxxxxxxx/
on an AX200 and firmware version 59.601f3a66.0 cc-a0-59.ucode.

    $ sudo ./iw dev wlan0 survey dump --radio                                                                    
    Survey data from wlan0
            channel active time:            17205356 ms
            channel receive time:           653 ms
            channel transmit time:          74 ms

But you might have noticed that the channel active time is off by a lot. Just 
after a couple of seconds:

    sudo ./iw dev wlan0 survey dump --radio
    Survey data from wlan0
            channel active time:            38689859 ms
            channel receive time:           904 ms
            channel transmit time:          128 ms

Here are the times from a loop with a delay of roughly one second:

        channel active time:            47284414 ms
        channel active time:            47284455 ms
        channel active time:            47284496 ms
        channel active time:            47284637 ms
        channel active time:            47284742 ms
        channel active time:            47284788 ms
        channel active time:            47284860 ms
        channel active time:            47284871 ms
        channel active time:            47284883 ms
        channel active time:            47284911 ms
        channel active time:            47285040 ms
        channel active time:            47285280 ms
        channel active time:            47285449 ms
        channel active time:            47285745 ms
        channel active time:            47285886 ms
        channel active time:            47286074 ms
        channel active time:            47286108 ms
        channel active time:            47286120 ms
        channel active time:            47286154 ms
        channel active time:            47286235 ms
        channel active time:            47286247 ms
        channel active time:            47286405 ms
        channel active time:            47286418 ms
        channel active time:            51581468 ms
        channel active time:            51581569 ms
        channel active time:            51581765 ms
        channel active time:            51581795 ms
        channel active time:            51581807 ms
        channel active time:            51581818 ms
        channel active time:            51581836 ms
        channel active time:            51581877 ms
        channel active time:            51582130 ms
        channel active time:            51582205 ms
        channel active time:            51582219 ms
        channel active time:            51582269 ms
        channel active time:            51582319 ms
        channel active time:            51582379 ms
        channel active time:            51582430 ms
        channel active time:            51582491 ms
        channel active time:            51582694 ms
        channel active time:            51582870 ms
        channel active time:            51582926 ms
        channel active time:            51582946 ms
        channel active time:            51583078 ms
        channel active time:            51583111 ms
        channel active time:            51583120 ms
        channel active time:            51583129 ms
        channel active time:            51583142 ms
        channel active time:            51583172 ms
        channel active time:            51583186 ms
        channel active time:            51583331 ms
        channel active time:            51583449 ms
        channel active time:            51583649 ms
        channel active time:            51583776 ms
        channel active time:            51583789 ms
        channel active time:            51583801 ms
        channel active time:            51583821 ms
        channel active time:            55878795 ms
        channel active time:            55878828 ms
        channel active time:            55878853 ms
        channel active time:            55878863 ms
        channel active time:            55879005 ms
        channel active time:            55879051 ms
        channel active time:            55879114 ms
        channel active time:            55879144 ms
        channel active time:            55879169 ms
        channel active time:            55879313 ms
        channel active time:            55879610 ms
        channel active time:            55879626 ms
        channel active time:            55879641 ms
        channel active time:            55879786 ms
        channel active time:            55879931 ms
        channel active time:            55880082 ms
        channel active time:            55880114 ms
        channel active time:            55880145 ms
        channel active time:            55880304 ms
        channel active time:            55880342 ms
        channel active time:            55880397 ms
        channel active time:            55880407 ms
        channel active time:            55880595 ms
        channel active time:            55880653 ms
        channel active time:            60175670 ms
        channel active time:            60175702 ms
        channel active time:            60175714 ms
        channel active time:            60175863 ms
        channel active time:            60175876 ms
        channel active time:            60175887 ms
        channel active time:            60175925 ms
        channel active time:            60175935 ms
        channel active time:            60175950 ms
        channel active time:            60175957 ms
        channel active time:            60175968 ms
        channel active time:            60176020 ms

I haven't checked if these jumps are related to anything specific or not. But 
if you multiple the values by 1000 (msec -> usec) and then create a diff 
between the previous values then you see that these values are also all over
the place and not roughly ~1000000.

If you just read the mvm->radio_stats.on_time_rf (in usec) then you see following:

        channel active time:            2346292 us
        channel active time:            3357380 us
        channel active time:            4368516 us
        channel active time:            4567172 us
        channel active time:            126139 us
        channel active time:            196605 us
        channel active time:            214119 us
        channel active time:            234556 us
        channel active time:            293402 us
        channel active time:            311971 us
        channel active time:            322606 us
        channel active time:            368173 us
        channel active time:            382785 us
        channel active time:            420408 us
        channel active time:            430851 us
        channel active time:            442990 us
        channel active time:            458566 us
        channel active time:            54960 us
        channel active time:            67810 us
        channel active time:            187747 us
        channel active time:            4295188641 us
        channel active time:            4295229424 us
        channel active time:            16295 us
        channel active time:            160736 us
        channel active time:            330166 us
        channel active time:            340849 us
        channel active time:            356933 us
        channel active time:            562579 us
        channel active time:            628140 us
        channel active time:            678766 us
        channel active time:            736022 us
        channel active time:            751099 us
        channel active time:            769377 us
        channel active time:            787728 us
        channel active time:            822183 us
        channel active time:            832478 us
        channel active time:            863107 us
        channel active time:            915469 us
        channel active time:            52166 us
        channel active time:            201828 us
        channel active time:            364236 us
        channel active time:            387916 us
        channel active time:            422965 us
        channel active time:            8560 us
        channel active time:            4295006989 us
        channel active time:            4295020943 us
        channel active time:            4295051766 us
        channel active time:            4295086037 us
        channel active time:            4295119851 us
        channel active time:            4295157051 us
        channel active time:            4295193488 us
        channel active time:            4295247769 us
        channel active time:            4295302615 us
        channel active time:            4295315627 us
        channel active time:            4295352876 us
        channel active time:            45385 us
        channel active time:            121871 us
        channel active time:            142972 us
        channel active time:            262344 us
        channel active time:            418666 us

So it also jumps all over the place. This could be investigated further but I 
just wanted to mention it here.

Kind regards,
	Sven

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux