diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-02-27 17:41:31 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-02-28 06:25:09 -0500 |
commit | 49c9cd26445aa8bc8348c384c943b758c57c47a9 (patch) | |
tree | fe65c0be371e34bb08d45a3ddebf51e794e7da48 /drivers/net/wireless | |
parent | 6246ca003f2560e30b9696757efc271284b809f6 (diff) |
wl12xx: avoid starving the system hlid
Re-factor the Tx scheduler so that the system_hlid is taken into account
before restarting an iteration over the wlvifs. Previously this
hlid had a lower priority and would starve if some wlvif had many
packets.
In addition avoid iterating over wlvifs past last_wlvif when performing
the a second pass. If we had packets in those wlvifs they would have
been found earlier.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index 8f5ab047aec8..6640c3975cfb 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -572,6 +572,7 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl) | |||
572 | struct wl12xx_vif *wlvif = wl->last_wlvif; | 572 | struct wl12xx_vif *wlvif = wl->last_wlvif; |
573 | struct sk_buff *skb = NULL; | 573 | struct sk_buff *skb = NULL; |
574 | 574 | ||
575 | /* continue from last wlvif (round robin) */ | ||
575 | if (wlvif) { | 576 | if (wlvif) { |
576 | wl12xx_for_each_wlvif_continue(wl, wlvif) { | 577 | wl12xx_for_each_wlvif_continue(wl, wlvif) { |
577 | skb = wl12xx_vif_skb_dequeue(wl, wlvif); | 578 | skb = wl12xx_vif_skb_dequeue(wl, wlvif); |
@@ -582,7 +583,11 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl) | |||
582 | } | 583 | } |
583 | } | 584 | } |
584 | 585 | ||
585 | /* do another pass */ | 586 | /* dequeue from the system HLID before the restarting wlvif list */ |
587 | if (!skb) | ||
588 | skb = wl12xx_lnk_skb_dequeue(wl, &wl->links[wl->system_hlid]); | ||
589 | |||
590 | /* do a new pass over the wlvif list */ | ||
586 | if (!skb) { | 591 | if (!skb) { |
587 | wl12xx_for_each_wlvif(wl, wlvif) { | 592 | wl12xx_for_each_wlvif(wl, wlvif) { |
588 | skb = wl12xx_vif_skb_dequeue(wl, wlvif); | 593 | skb = wl12xx_vif_skb_dequeue(wl, wlvif); |
@@ -590,12 +595,16 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl) | |||
590 | wl->last_wlvif = wlvif; | 595 | wl->last_wlvif = wlvif; |
591 | break; | 596 | break; |
592 | } | 597 | } |
598 | |||
599 | /* | ||
600 | * No need to continue after last_wlvif. The previous | ||
601 | * pass should have found it. | ||
602 | */ | ||
603 | if (wlvif == wl->last_wlvif) | ||
604 | break; | ||
593 | } | 605 | } |
594 | } | 606 | } |
595 | 607 | ||
596 | if (!skb) | ||
597 | skb = wl12xx_lnk_skb_dequeue(wl, &wl->links[wl->system_hlid]); | ||
598 | |||
599 | if (!skb && | 608 | if (!skb && |
600 | test_and_clear_bit(WL1271_FLAG_DUMMY_PACKET_PENDING, &wl->flags)) { | 609 | test_and_clear_bit(WL1271_FLAG_DUMMY_PACKET_PENDING, &wl->flags)) { |
601 | int q; | 610 | int q; |