All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: Rajkumar Manoharan <rmanohar@codeaurora.org>
Cc: linux-wireless-owner@vger.kernel.org,
	linux-wireless@vger.kernel.org, ath10k@lists.infradead.org,
	kvalo@codeaurora.org, ath11k@lists.infradead.org
Subject: Re: [PATCH 2/2] ath11k: use cumulative survey statistics
Date: Tue, 5 May 2020 08:53:24 +0200	[thread overview]
Message-ID: <c786e982-fcd6-2368-6b2f-f09b265654d6@tu-ilmenau.de> (raw)
In-Reply-To: <85fa2d5f9183b3a12c5283b800f3750f@codeaurora.org>

Am 05.05.2020 um 01:37 schrieb Rajkumar Manoharan:
> On 2020-05-04 08:41, Markus Theil wrote:
>> ath11k currently reports survey results for the last interval between 
>> each
>> invocation of NL80211_CMD_GET_SURVEY. For concurrent invocations, this
>> can lead to unexpectedly small results, e.g. when hostapd uses survey
>> data and iw survey dump is invoked in parallel. Fix this by returning
>> cumulative results, that don't depend on the last invocation. Other
>> drivers, e.g. ath9k or mt76 also use this behavior.
>>
>> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
>> ---
>>  drivers/net/wireless/ath/ath11k/wmi.c | 20 ++++++++++----------
>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/wmi.c
>> b/drivers/net/wireless/ath/ath11k/wmi.c
>> index c2a972377687..322ddfda5bfd 100644
>> --- a/drivers/net/wireless/ath/ath11k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath11k/wmi.c
>> @@ -5610,16 +5610,16 @@ ath11k_pdev_bss_chan_info_event(struct
>> ath11k_base *ab, struct sk_buff *skb)
>>
>>      survey = &ar->survey[idx];
>>
>> -    survey->noise     = bss_ch_info_ev.noise_floor;
>> -    survey->time      = div_u64(total, cc_freq_hz);
>> -    survey->time_busy = div_u64(busy, cc_freq_hz);
>> -    survey->time_rx   = div_u64(rx_bss, cc_freq_hz);
>> -    survey->time_tx   = div_u64(tx, cc_freq_hz);
>> -    survey->filled   |= (SURVEY_INFO_NOISE_DBM |
>> -                 SURVEY_INFO_TIME |
>> -                 SURVEY_INFO_TIME_BUSY |
>> -                 SURVEY_INFO_TIME_RX |
>> -                 SURVEY_INFO_TIME_TX);
>> +    survey->noise      = bss_ch_info_ev.noise_floor;
>> +    survey->time      += div_u64(total, cc_freq_hz);
>> +    survey->time_busy += div_u64(busy, cc_freq_hz);
>> +    survey->time_rx   += div_u64(rx_bss, cc_freq_hz);
>> +    survey->time_tx   += div_u64(tx, cc_freq_hz);
>> +    survey->filled    |= (SURVEY_INFO_NOISE_DBM |
>> +                  SURVEY_INFO_TIME |
>> +                  SURVEY_INFO_TIME_BUSY |
>> +                  SURVEY_INFO_TIME_RX |
>> +                  SURVEY_INFO_TIME_TX);
>
> Markus,
>
> It depends on type of survey request is given to firmware. In ath11k, 
> firmware reports
> accumulated values. So the above addition is wrong and report double 
> value. Have you
> tested this change?
>
> -Rajkumar
Ok, so please drop both of my patches. My assumptions were incomplete 
and too humble. I just assumed, ath10k and ath11k both use incremental 
surveys.

WARNING: multiple messages have this Message-ID (diff)
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: Rajkumar Manoharan <rmanohar@codeaurora.org>
Cc: linux-wireless-owner@vger.kernel.org,
	linux-wireless@vger.kernel.org, kvalo@codeaurora.org,
	ath10k@lists.infradead.org, ath11k@lists.infradead.org
Subject: Re: [PATCH 2/2] ath11k: use cumulative survey statistics
Date: Tue, 5 May 2020 08:53:24 +0200	[thread overview]
Message-ID: <c786e982-fcd6-2368-6b2f-f09b265654d6@tu-ilmenau.de> (raw)
In-Reply-To: <85fa2d5f9183b3a12c5283b800f3750f@codeaurora.org>

Am 05.05.2020 um 01:37 schrieb Rajkumar Manoharan:
> On 2020-05-04 08:41, Markus Theil wrote:
>> ath11k currently reports survey results for the last interval between 
>> each
>> invocation of NL80211_CMD_GET_SURVEY. For concurrent invocations, this
>> can lead to unexpectedly small results, e.g. when hostapd uses survey
>> data and iw survey dump is invoked in parallel. Fix this by returning
>> cumulative results, that don't depend on the last invocation. Other
>> drivers, e.g. ath9k or mt76 also use this behavior.
>>
>> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
>> ---
>>  drivers/net/wireless/ath/ath11k/wmi.c | 20 ++++++++++----------
>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/wmi.c
>> b/drivers/net/wireless/ath/ath11k/wmi.c
>> index c2a972377687..322ddfda5bfd 100644
>> --- a/drivers/net/wireless/ath/ath11k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath11k/wmi.c
>> @@ -5610,16 +5610,16 @@ ath11k_pdev_bss_chan_info_event(struct
>> ath11k_base *ab, struct sk_buff *skb)
>>
>>      survey = &ar->survey[idx];
>>
>> -    survey->noise     = bss_ch_info_ev.noise_floor;
>> -    survey->time      = div_u64(total, cc_freq_hz);
>> -    survey->time_busy = div_u64(busy, cc_freq_hz);
>> -    survey->time_rx   = div_u64(rx_bss, cc_freq_hz);
>> -    survey->time_tx   = div_u64(tx, cc_freq_hz);
>> -    survey->filled   |= (SURVEY_INFO_NOISE_DBM |
>> -                 SURVEY_INFO_TIME |
>> -                 SURVEY_INFO_TIME_BUSY |
>> -                 SURVEY_INFO_TIME_RX |
>> -                 SURVEY_INFO_TIME_TX);
>> +    survey->noise      = bss_ch_info_ev.noise_floor;
>> +    survey->time      += div_u64(total, cc_freq_hz);
>> +    survey->time_busy += div_u64(busy, cc_freq_hz);
>> +    survey->time_rx   += div_u64(rx_bss, cc_freq_hz);
>> +    survey->time_tx   += div_u64(tx, cc_freq_hz);
>> +    survey->filled    |= (SURVEY_INFO_NOISE_DBM |
>> +                  SURVEY_INFO_TIME |
>> +                  SURVEY_INFO_TIME_BUSY |
>> +                  SURVEY_INFO_TIME_RX |
>> +                  SURVEY_INFO_TIME_TX);
>
> Markus,
>
> It depends on type of survey request is given to firmware. In ath11k, 
> firmware reports
> accumulated values. So the above addition is wrong and report double 
> value. Have you
> tested this change?
>
> -Rajkumar
Ok, so please drop both of my patches. My assumptions were incomplete 
and too humble. I just assumed, ath10k and ath11k both use incremental 
surveys.

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

WARNING: multiple messages have this Message-ID (diff)
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: Rajkumar Manoharan <rmanohar@codeaurora.org>
Cc: linux-wireless-owner@vger.kernel.org,
	linux-wireless@vger.kernel.org, kvalo@codeaurora.org,
	ath10k@lists.infradead.org, ath11k@lists.infradead.org
Subject: Re: [PATCH 2/2] ath11k: use cumulative survey statistics
Date: Tue, 5 May 2020 08:53:24 +0200	[thread overview]
Message-ID: <c786e982-fcd6-2368-6b2f-f09b265654d6@tu-ilmenau.de> (raw)
In-Reply-To: <85fa2d5f9183b3a12c5283b800f3750f@codeaurora.org>

Am 05.05.2020 um 01:37 schrieb Rajkumar Manoharan:
> On 2020-05-04 08:41, Markus Theil wrote:
>> ath11k currently reports survey results for the last interval between 
>> each
>> invocation of NL80211_CMD_GET_SURVEY. For concurrent invocations, this
>> can lead to unexpectedly small results, e.g. when hostapd uses survey
>> data and iw survey dump is invoked in parallel. Fix this by returning
>> cumulative results, that don't depend on the last invocation. Other
>> drivers, e.g. ath9k or mt76 also use this behavior.
>>
>> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
>> ---
>>  drivers/net/wireless/ath/ath11k/wmi.c | 20 ++++++++++----------
>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/wmi.c
>> b/drivers/net/wireless/ath/ath11k/wmi.c
>> index c2a972377687..322ddfda5bfd 100644
>> --- a/drivers/net/wireless/ath/ath11k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath11k/wmi.c
>> @@ -5610,16 +5610,16 @@ ath11k_pdev_bss_chan_info_event(struct
>> ath11k_base *ab, struct sk_buff *skb)
>>
>>      survey = &ar->survey[idx];
>>
>> -    survey->noise     = bss_ch_info_ev.noise_floor;
>> -    survey->time      = div_u64(total, cc_freq_hz);
>> -    survey->time_busy = div_u64(busy, cc_freq_hz);
>> -    survey->time_rx   = div_u64(rx_bss, cc_freq_hz);
>> -    survey->time_tx   = div_u64(tx, cc_freq_hz);
>> -    survey->filled   |= (SURVEY_INFO_NOISE_DBM |
>> -                 SURVEY_INFO_TIME |
>> -                 SURVEY_INFO_TIME_BUSY |
>> -                 SURVEY_INFO_TIME_RX |
>> -                 SURVEY_INFO_TIME_TX);
>> +    survey->noise      = bss_ch_info_ev.noise_floor;
>> +    survey->time      += div_u64(total, cc_freq_hz);
>> +    survey->time_busy += div_u64(busy, cc_freq_hz);
>> +    survey->time_rx   += div_u64(rx_bss, cc_freq_hz);
>> +    survey->time_tx   += div_u64(tx, cc_freq_hz);
>> +    survey->filled    |= (SURVEY_INFO_NOISE_DBM |
>> +                  SURVEY_INFO_TIME |
>> +                  SURVEY_INFO_TIME_BUSY |
>> +                  SURVEY_INFO_TIME_RX |
>> +                  SURVEY_INFO_TIME_TX);
>
> Markus,
>
> It depends on type of survey request is given to firmware. In ath11k, 
> firmware reports
> accumulated values. So the above addition is wrong and report double 
> value. Have you
> tested this change?
>
> -Rajkumar
Ok, so please drop both of my patches. My assumptions were incomplete 
and too humble. I just assumed, ath10k and ath11k both use incremental 
surveys.

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2020-05-05  6:53 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 15:41 [PATCH 1/2] ath10k: use cumulative survey statistics Markus Theil
2020-05-04 15:41 ` Markus Theil
2020-05-04 15:41 ` Markus Theil
2020-05-04 15:41 ` [PATCH 2/2] ath11k: " Markus Theil
2020-05-04 15:41   ` Markus Theil
2020-05-04 15:41   ` Markus Theil
2020-05-04 16:36   ` Sven Eckelmann
2020-05-04 16:36     ` Sven Eckelmann
2020-05-04 16:36     ` Sven Eckelmann
2020-05-04 23:37   ` Rajkumar Manoharan
2020-05-04 23:37     ` Rajkumar Manoharan
2020-05-04 23:37     ` Rajkumar Manoharan
2020-05-05  6:53     ` Markus Theil [this message]
2020-05-05  6:53       ` Markus Theil
2020-05-05  6:53       ` Markus Theil
2020-05-05 17:31       ` Rajkumar Manoharan
2020-05-05 17:31         ` Rajkumar Manoharan
2020-05-05 17:31         ` Rajkumar Manoharan
2020-05-04 16:29 ` [PATCH 1/2] ath10k: " Sven Eckelmann
2020-05-04 16:29   ` Sven Eckelmann
2020-05-04 16:29   ` Sven Eckelmann
2020-05-04 16:33   ` Markus Theil
2020-05-04 16:33     ` Markus Theil
2020-05-04 16:33     ` Markus Theil
2020-05-04 23:46 ` Rajkumar Manoharan
2020-05-04 23:46   ` Rajkumar Manoharan
2020-05-04 23:46   ` Rajkumar Manoharan
2020-05-04 23:49   ` Ben Greear
2020-05-04 23:49     ` Ben Greear
2020-05-04 23:49     ` Ben Greear
2020-05-04 23:52     ` Rajkumar Manoharan
2020-05-04 23:52       ` Rajkumar Manoharan
2020-05-04 23:52       ` Rajkumar Manoharan
2020-05-05  0:02       ` Ben Greear
2020-05-05  0:02         ` Ben Greear
2020-05-05  0:02         ` Ben Greear
2020-05-05  7:01   ` Sven Eckelmann
2020-05-05  7:01     ` Sven Eckelmann
2020-05-05  7:01     ` Sven Eckelmann
2020-05-05  7:49     ` Sven Eckelmann
2020-05-05  7:49       ` Sven Eckelmann
2020-05-05  7:49       ` Sven Eckelmann
2020-05-05  7:55       ` Sven Eckelmann
2020-05-05  7:55         ` Sven Eckelmann
2020-05-05  7:55         ` Sven Eckelmann
2020-05-05 18:45         ` Rajkumar Manoharan
2020-05-05 18:45           ` Rajkumar Manoharan
2020-05-05 18:45           ` Rajkumar Manoharan
2020-05-05 15:37       ` Markus Theil
2020-05-05 15:37         ` Markus Theil
2020-05-05 15:37         ` Markus Theil
2020-05-05 18:32         ` Rajkumar Manoharan
2020-05-05 18:32           ` Rajkumar Manoharan
2020-05-05 18:32           ` Rajkumar Manoharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c786e982-fcd6-2368-6b2f-f09b265654d6@tu-ilmenau.de \
    --to=markus.theil@tu-ilmenau.de \
    --cc=ath10k@lists.infradead.org \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless-owner@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rmanohar@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.