aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2014-05-27 07:45:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-05-29 13:10:32 -0400
commitcf42c4e5d3019d801ec6d033b63de5446a53af5c (patch)
tree012cf18eb22e33250c74eff31a55eabccf2fbc66
parent39c52ee8cb6d473dda6c33431339ca2bc984d66d (diff)
wil6210: optimize wil_release_reorder_frames
In case of receiving frame with sequence number far greater than current, wil_release_reorder_frames() will iterate many times over empty buffer. Optimize this case by checking buffer emptiness and simply update head_seq_num without iterating. Suggested-by: Vladimir Shulman <Vladimir.Shulman@Wilocity.com> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/wil6210/rx_reorder.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/rx_reorder.c b/drivers/net/wireless/ath/wil6210/rx_reorder.c
index ec29954bd44d..747ae1275877 100644
--- a/drivers/net/wireless/ath/wil6210/rx_reorder.c
+++ b/drivers/net/wireless/ath/wil6210/rx_reorder.c
@@ -49,10 +49,17 @@ static void wil_release_reorder_frames(struct wil6210_priv *wil,
49{ 49{
50 int index; 50 int index;
51 51
52 while (seq_less(r->head_seq_num, hseq)) { 52 /* note: this function is never called with
53 * hseq preceding r->head_seq_num, i.e it is always true
54 * !seq_less(hseq, r->head_seq_num)
55 * and thus on loop exit it should be
56 * r->head_seq_num == hseq
57 */
58 while (seq_less(r->head_seq_num, hseq) && r->stored_mpdu_num) {
53 index = reorder_index(r, r->head_seq_num); 59 index = reorder_index(r, r->head_seq_num);
54 wil_release_reorder_frame(wil, r, index); 60 wil_release_reorder_frame(wil, r, index);
55 } 61 }
62 r->head_seq_num = hseq;
56} 63}
57 64
58static void wil_reorder_release(struct wil6210_priv *wil, 65static void wil_reorder_release(struct wil6210_priv *wil,