All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Kalle Valo <kvalo@qca.qualcomm.com>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH] ath10k: fix printing of peer stats in non-AP firmware
Date: Tue, 25 Mar 2014 09:09:24 -0700	[thread overview]
Message-ID: <5331AA34.7060700@candelatech.com> (raw)
In-Reply-To: <CA+BoTQmVw1fiDU_Pu_fowRfFdme-AZ1-qLmxhCHuxFPSK831rw@mail.gmail.com>

On 03/25/2014 01:11 AM, Michal Kazior wrote:
> On 25 March 2014 08:55, Chun-Yeow Yeoh <yeohchunyeow@gmail.com> wrote:
>> This patch is intended to fix the problem if we use the
>> firmware 999.999.0.636 to get peer stats when the number
>> of peer is more than 3. The WMI_UPDATE_STATS_EVENTID may
>> trigger more than 1 time if the number of peers is more
>> than 3. So this patch allows us to do the checking on this
>> and make sure that we print the peer stats correctly.
>>
>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/debug.c |    9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
>> index 7be284c..4a4072e 100644
>> --- a/drivers/net/wireless/ath/ath10k/debug.c
>> +++ b/drivers/net/wireless/ath/ath10k/debug.c
>> @@ -245,10 +245,17 @@ void ath10k_debug_read_target_stats(struct ath10k *ar,
>>         if (num_peer_stats) {
>>                 struct wmi_peer_stats_10x *peer_stats;
>>                 struct ath10k_peer_stat *s;
>> +               int j = 0;
>> +
>> +               if (!test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features) &&
>> +                   !num_pdev_stats) {
>> +                       j = 3;
>> +                       num_peer_stats += 3;
>> +               }
>>
>>                 stats->peers = num_peer_stats;
>>
>> -               for (i = 0; i < num_peer_stats; i++) {
>> +               for (i = j; i < num_peer_stats; i++) {
>>                         peer_stats = (struct wmi_peer_stats_10x *)tmp;
>>                         s = &stats->peer_stat[i];
> 
> I suppose there's a limit how much peer entries firmware is able to
> pack up into a single event. The second event you handle here is still
> going to have some sort of a limit and you'll end up dropping results
> again. The same probably goes with vdev stats (which aren't handled
> yet, but hey).

At least in my 10.x 389 firmware, the limit is 11 peers.  There is some
round-robin logic that means next request of stats gets the next set of peer
stats, so calling get-stats multiple times would get the entire list of peers.

I'm not sure how to deal with this in the driver.  In my case, my multiple
stations mostly connect to the same AP, so peer-mac is often the same.
This makes it difficult for me to know if the round-robin logic is working
properly, but I think we might as well assume it does until proven otherwise.
I may try to poke a station identifier into the 16 unused bits of the mac-addr
struct eventually, but unless upstream firmware does the same, that doesn't
help any general issue...

Thanks,
Ben



-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

WARNING: multiple messages have this Message-ID (diff)
From: Ben Greear <greearb@candelatech.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Kalle Valo <kvalo@qca.qualcomm.com>
Subject: Re: [PATCH] ath10k: fix printing of peer stats in non-AP firmware
Date: Tue, 25 Mar 2014 09:09:24 -0700	[thread overview]
Message-ID: <5331AA34.7060700@candelatech.com> (raw)
In-Reply-To: <CA+BoTQmVw1fiDU_Pu_fowRfFdme-AZ1-qLmxhCHuxFPSK831rw@mail.gmail.com>

On 03/25/2014 01:11 AM, Michal Kazior wrote:
> On 25 March 2014 08:55, Chun-Yeow Yeoh <yeohchunyeow@gmail.com> wrote:
>> This patch is intended to fix the problem if we use the
>> firmware 999.999.0.636 to get peer stats when the number
>> of peer is more than 3. The WMI_UPDATE_STATS_EVENTID may
>> trigger more than 1 time if the number of peers is more
>> than 3. So this patch allows us to do the checking on this
>> and make sure that we print the peer stats correctly.
>>
>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/debug.c |    9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
>> index 7be284c..4a4072e 100644
>> --- a/drivers/net/wireless/ath/ath10k/debug.c
>> +++ b/drivers/net/wireless/ath/ath10k/debug.c
>> @@ -245,10 +245,17 @@ void ath10k_debug_read_target_stats(struct ath10k *ar,
>>         if (num_peer_stats) {
>>                 struct wmi_peer_stats_10x *peer_stats;
>>                 struct ath10k_peer_stat *s;
>> +               int j = 0;
>> +
>> +               if (!test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features) &&
>> +                   !num_pdev_stats) {
>> +                       j = 3;
>> +                       num_peer_stats += 3;
>> +               }
>>
>>                 stats->peers = num_peer_stats;
>>
>> -               for (i = 0; i < num_peer_stats; i++) {
>> +               for (i = j; i < num_peer_stats; i++) {
>>                         peer_stats = (struct wmi_peer_stats_10x *)tmp;
>>                         s = &stats->peer_stat[i];
> 
> I suppose there's a limit how much peer entries firmware is able to
> pack up into a single event. The second event you handle here is still
> going to have some sort of a limit and you'll end up dropping results
> again. The same probably goes with vdev stats (which aren't handled
> yet, but hey).

At least in my 10.x 389 firmware, the limit is 11 peers.  There is some
round-robin logic that means next request of stats gets the next set of peer
stats, so calling get-stats multiple times would get the entire list of peers.

I'm not sure how to deal with this in the driver.  In my case, my multiple
stations mostly connect to the same AP, so peer-mac is often the same.
This makes it difficult for me to know if the round-robin logic is working
properly, but I think we might as well assume it does until proven otherwise.
I may try to poke a station identifier into the 16 unused bits of the mac-addr
struct eventually, but unless upstream firmware does the same, that doesn't
help any general issue...

Thanks,
Ben



-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  parent reply	other threads:[~2014-03-25 16:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  7:55 [PATCH] ath10k: fix printing of peer stats in non-AP firmware Chun-Yeow Yeoh
2014-03-25  7:55 ` Chun-Yeow Yeoh
2014-03-25  8:11 ` Michal Kazior
2014-03-25  8:11   ` Michal Kazior
2014-03-25  8:33   ` Yeoh Chun-Yeow
2014-03-25  8:33     ` Yeoh Chun-Yeow
2014-03-25  8:45     ` Michal Kazior
2014-03-25  8:45       ` Michal Kazior
2014-03-25  8:54       ` Yeoh Chun-Yeow
2014-03-25  8:54         ` Yeoh Chun-Yeow
2014-03-25  8:57         ` Michal Kazior
2014-03-25  8:57           ` Michal Kazior
2014-03-25  9:38           ` Yeoh Chun-Yeow
2014-03-25  9:38             ` Yeoh Chun-Yeow
2014-03-25  9:47             ` Michal Kazior
2014-03-25  9:47               ` Michal Kazior
2014-03-25 10:31               ` Yeoh Chun-Yeow
2014-03-25 10:31                 ` Yeoh Chun-Yeow
2014-03-25 16:09   ` Ben Greear [this message]
2014-03-25 16:09     ` Ben Greear
2014-03-28 12:47 ` Kalle Valo
2014-03-28 12:47   ` Kalle Valo

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=5331AA34.7060700@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=michal.kazior@tieto.com \
    --cc=yeohchunyeow@gmail.com \
    /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.