aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorKarl Beldan <karl.beldan@rivierawaves.com>2013-10-24 09:53:32 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:49:36 -0500
commit2e3049b79cb98018abc83383f9b737508240dd54 (patch)
treeb83e9e48ab8b041361ce358c9d823217ff018260 /net/mac80211/rx.c
parent8fe02e167efa8ed4a4503a5eedc0f49fcb7e3eb9 (diff)
mac80211: do not compute offset from ssn in Rx AMPDU reordering buffer
Currently, frames that go into the reordering buffer are stored at index ieee80211_sn_sub(sn, tid_rx->ssn) % tid_rx->buf_size. The offset calculation to the starting sequence number (SSN) is useless and just adds overhead so simply use sn % tid_rx->buf_size. This means the reordering buffer will start to be filled somewhere in the middle (at SSN % buf_size) and continue to get used from there, but there's no reason to start from the beginning. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [rewrite commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index caecef870c0e..401f3c26e707 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -729,9 +729,7 @@ static void ieee80211_release_reorder_frames(struct ieee80211_sub_if_data *sdata
729 lockdep_assert_held(&tid_agg_rx->reorder_lock); 729 lockdep_assert_held(&tid_agg_rx->reorder_lock);
730 730
731 while (ieee80211_sn_less(tid_agg_rx->head_seq_num, head_seq_num)) { 731 while (ieee80211_sn_less(tid_agg_rx->head_seq_num, head_seq_num)) {
732 index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, 732 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
733 tid_agg_rx->ssn) %
734 tid_agg_rx->buf_size;
735 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index, 733 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
736 frames); 734 frames);
737 } 735 }
@@ -757,8 +755,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
757 lockdep_assert_held(&tid_agg_rx->reorder_lock); 755 lockdep_assert_held(&tid_agg_rx->reorder_lock);
758 756
759 /* release the buffer until next missing frame */ 757 /* release the buffer until next missing frame */
760 index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, 758 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
761 tid_agg_rx->ssn) % tid_agg_rx->buf_size;
762 if (!tid_agg_rx->reorder_buf[index] && 759 if (!tid_agg_rx->reorder_buf[index] &&
763 tid_agg_rx->stored_mpdu_num) { 760 tid_agg_rx->stored_mpdu_num) {
764 /* 761 /*
@@ -793,15 +790,11 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
793 } else while (tid_agg_rx->reorder_buf[index]) { 790 } else while (tid_agg_rx->reorder_buf[index]) {
794 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index, 791 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
795 frames); 792 frames);
796 index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, 793 index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
797 tid_agg_rx->ssn) %
798 tid_agg_rx->buf_size;
799 } 794 }
800 795
801 if (tid_agg_rx->stored_mpdu_num) { 796 if (tid_agg_rx->stored_mpdu_num) {
802 j = index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, 797 j = index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
803 tid_agg_rx->ssn) %
804 tid_agg_rx->buf_size;
805 798
806 for (; j != (index - 1) % tid_agg_rx->buf_size; 799 for (; j != (index - 1) % tid_agg_rx->buf_size;
807 j = (j + 1) % tid_agg_rx->buf_size) { 800 j = (j + 1) % tid_agg_rx->buf_size) {
@@ -861,8 +854,7 @@ static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_sub_if_data *sdata
861 854
862 /* Now the new frame is always in the range of the reordering buffer */ 855 /* Now the new frame is always in the range of the reordering buffer */
863 856
864 index = ieee80211_sn_sub(mpdu_seq_num, 857 index = mpdu_seq_num % tid_agg_rx->buf_size;
865 tid_agg_rx->ssn) % tid_agg_rx->buf_size;
866 858
867 /* check if we already stored this frame */ 859 /* check if we already stored this frame */
868 if (tid_agg_rx->reorder_buf[index]) { 860 if (tid_agg_rx->reorder_buf[index]) {