linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath6kl: pass only unicast frames for aggregation
@ 2011-09-19 18:38 Kalle Valo
  2011-09-19 19:40 ` Dave Taht
  2011-09-23  7:45 ` Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Kalle Valo @ 2011-09-19 18:38 UTC (permalink / raw)
  To: linux-wireless

When pinging form ar6003 to the AP RTT was high even when power save was
disabled:

100 packets transmitted, 97 received, 3% packet loss, time 99125ms
rtt min/avg/max/mdev = 1.875/46.733/795.506/139.181 ms

After some investigation one reason for this was that received
multicast traffic confused the aggrecation logic and caused 400 ms
timeouts when receiving multicast frames from AP.

A simple way to fix is to pass only unicast frames for aggregation. This
improves RTT:

100 packets transmitted, 99 received, 1% packet loss, time 99144ms
rtt min/avg/max/mdev = 2.083/13.084/403.390/56.794 ms

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/txrx.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index fffd929..348c646 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -1230,9 +1230,15 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
 			ath6kl_data_tx(skb1, ar->net_dev);
 	}
 
-	if (!aggr_process_recv_frm(ar->aggr_cntxt, tid, seq_no,
-				   is_amsdu, skb))
-		ath6kl_deliver_frames_to_nw_stack(ar->net_dev, skb);
+	datap = (struct ethhdr *) skb->data;
+
+	if (is_unicast_ether_addr(datap->h_dest) &&
+	    aggr_process_recv_frm(ar->aggr_cntxt, tid, seq_no,
+				  is_amsdu, skb))
+		/* aggregation code will handle the skb */
+		return;
+
+	ath6kl_deliver_frames_to_nw_stack(ar->net_dev, skb);
 }
 
 static void aggr_timeout(unsigned long arg)
@@ -1249,10 +1255,6 @@ static void aggr_timeout(unsigned long arg)
 		if (!rxtid->aggr || !rxtid->timer_mon || rxtid->progress)
 			continue;
 
-		/*
-		 * FIXME: these timeouts happen quite fruently, something
-		 * line once within 60 seconds. Investigate why.
-		 */
 		stats->num_timeouts++;
 		ath6kl_dbg(ATH6KL_DBG_AGGR,
 			   "aggr timeout (st %d end %d)\n",


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

* Re: [PATCH] ath6kl: pass only unicast frames for aggregation
  2011-09-19 18:38 [PATCH] ath6kl: pass only unicast frames for aggregation Kalle Valo
@ 2011-09-19 19:40 ` Dave Taht
  2011-09-20  8:49   ` Kalle Valo
  2011-09-23  7:45 ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Taht @ 2011-09-19 19:40 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On Mon, Sep 19, 2011 at 11:38 AM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> When pinging form ar6003 to the AP RTT was high even when power save was
> disabled:
>
> 100 packets transmitted, 97 received, 3% packet loss, time 99125ms
> rtt min/avg/max/mdev = 1.875/46.733/795.506/139.181 ms
>
> After some investigation one reason for this was that received
> multicast traffic confused the aggrecation logic and caused 400 ms
> timeouts when receiving multicast frames from AP.
>
> A simple way to fix is to pass only unicast frames for aggregation. This
> improves RTT:
>
> 100 packets transmitted, 99 received, 1% packet loss, time 99144ms
> rtt min/avg/max/mdev = 2.083/13.084/403.390/56.794 ms

I note that while the improvement above is enormous, a 403ms RTT for
a packet is the rough equivalent of a detour around all of planet Earth...
between your couch and the AP.

Can outliers of this sort be improved?

At what point are packets dropped?

>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath6kl/txrx.c |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
> index fffd929..348c646 100644
> --- a/drivers/net/wireless/ath/ath6kl/txrx.c
> +++ b/drivers/net/wireless/ath/ath6kl/txrx.c
> @@ -1230,9 +1230,15 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
>                        ath6kl_data_tx(skb1, ar->net_dev);
>        }
>
> -       if (!aggr_process_recv_frm(ar->aggr_cntxt, tid, seq_no,
> -                                  is_amsdu, skb))
> -               ath6kl_deliver_frames_to_nw_stack(ar->net_dev, skb);
> +       datap = (struct ethhdr *) skb->data;
> +
> +       if (is_unicast_ether_addr(datap->h_dest) &&
> +           aggr_process_recv_frm(ar->aggr_cntxt, tid, seq_no,
> +                                 is_amsdu, skb))
> +               /* aggregation code will handle the skb */
> +               return;
> +
> +       ath6kl_deliver_frames_to_nw_stack(ar->net_dev, skb);
>  }
>
>  static void aggr_timeout(unsigned long arg)
> @@ -1249,10 +1255,6 @@ static void aggr_timeout(unsigned long arg)
>                if (!rxtid->aggr || !rxtid->timer_mon || rxtid->progress)
>                        continue;
>
> -               /*
> -                * FIXME: these timeouts happen quite fruently, something
> -                * line once within 60 seconds. Investigate why.
> -                */
>                stats->num_timeouts++;
>                ath6kl_dbg(ATH6KL_DBG_AGGR,
>                           "aggr timeout (st %d end %d)\n",
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Dave Täht
SKYPE: davetaht
US Tel: 1-239-829-5608
http://the-edge.blogspot.com

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

* Re: [PATCH] ath6kl: pass only unicast frames for aggregation
  2011-09-19 19:40 ` Dave Taht
@ 2011-09-20  8:49   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2011-09-20  8:49 UTC (permalink / raw)
  To: Dave Taht; +Cc: linux-wireless

On 09/19/2011 10:40 PM, Dave Taht wrote:
> On Mon, Sep 19, 2011 at 11:38 AM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> When pinging form ar6003 to the AP RTT was high even when power save was
>> disabled:
>>
>> 100 packets transmitted, 97 received, 3% packet loss, time 99125ms
>> rtt min/avg/max/mdev = 1.875/46.733/795.506/139.181 ms
>>
>> After some investigation one reason for this was that received
>> multicast traffic confused the aggrecation logic and caused 400 ms
>> timeouts when receiving multicast frames from AP.
>>
>> A simple way to fix is to pass only unicast frames for aggregation. This
>> improves RTT:
>>
>> 100 packets transmitted, 99 received, 1% packet loss, time 99144ms
>> rtt min/avg/max/mdev = 2.083/13.084/403.390/56.794 ms
> 
> I note that while the improvement above is enormous, a 403ms RTT for
> a packet is the rough equivalent of a detour around all of planet Earth...
> between your couch and the AP.

That's because firmware doesn't disable 802.11 power save when I ping
with one second interval. Apparently it needs two frames within ~200 ms
to disable power save.

> Can outliers of this sort be improved?

Definitely. I just want to fix serious bugs first, like the one above.

> At what point are packets dropped?

I'm guessing that the power save has issues and drops packets
occasionally. I haven't investigated it yet.

Kalle

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

* Re: [PATCH] ath6kl: pass only unicast frames for aggregation
  2011-09-19 18:38 [PATCH] ath6kl: pass only unicast frames for aggregation Kalle Valo
  2011-09-19 19:40 ` Dave Taht
@ 2011-09-23  7:45 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2011-09-23  7:45 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On 09/19/2011 09:38 PM, Kalle Valo wrote:
> When pinging form ar6003 to the AP RTT was high even when power save was
> disabled:
> 
> 100 packets transmitted, 97 received, 3% packet loss, time 99125ms
> rtt min/avg/max/mdev = 1.875/46.733/795.506/139.181 ms
> 
> After some investigation one reason for this was that received
> multicast traffic confused the aggrecation logic and caused 400 ms
> timeouts when receiving multicast frames from AP.
> 
> A simple way to fix is to pass only unicast frames for aggregation. This
> improves RTT:
> 
> 100 packets transmitted, 99 received, 1% packet loss, time 99144ms
> rtt min/avg/max/mdev = 2.083/13.084/403.390/56.794 ms

Applied.

Kalle

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

end of thread, other threads:[~2011-09-23  7:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19 18:38 [PATCH] ath6kl: pass only unicast frames for aggregation Kalle Valo
2011-09-19 19:40 ` Dave Taht
2011-09-20  8:49   ` Kalle Valo
2011-09-23  7:45 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).