提交 2e3049b7 编写于 作者: K Karl Beldan 提交者: Johannes Berg

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: NKarl Beldan <karl.beldan@rivierawaves.com>
[rewrite commit message]
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 8fe02e16
...@@ -729,9 +729,7 @@ static void ieee80211_release_reorder_frames(struct ieee80211_sub_if_data *sdata ...@@ -729,9 +729,7 @@ static void ieee80211_release_reorder_frames(struct ieee80211_sub_if_data *sdata
lockdep_assert_held(&tid_agg_rx->reorder_lock); lockdep_assert_held(&tid_agg_rx->reorder_lock);
while (ieee80211_sn_less(tid_agg_rx->head_seq_num, head_seq_num)) { while (ieee80211_sn_less(tid_agg_rx->head_seq_num, head_seq_num)) {
index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
tid_agg_rx->ssn) %
tid_agg_rx->buf_size;
ieee80211_release_reorder_frame(sdata, tid_agg_rx, index, ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
frames); frames);
} }
...@@ -757,8 +755,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata, ...@@ -757,8 +755,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
lockdep_assert_held(&tid_agg_rx->reorder_lock); lockdep_assert_held(&tid_agg_rx->reorder_lock);
/* release the buffer until next missing frame */ /* release the buffer until next missing frame */
index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
tid_agg_rx->ssn) % tid_agg_rx->buf_size;
if (!tid_agg_rx->reorder_buf[index] && if (!tid_agg_rx->reorder_buf[index] &&
tid_agg_rx->stored_mpdu_num) { tid_agg_rx->stored_mpdu_num) {
/* /*
...@@ -793,15 +790,11 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata, ...@@ -793,15 +790,11 @@ static void ieee80211_sta_reorder_release(struct ieee80211_sub_if_data *sdata,
} else while (tid_agg_rx->reorder_buf[index]) { } else while (tid_agg_rx->reorder_buf[index]) {
ieee80211_release_reorder_frame(sdata, tid_agg_rx, index, ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
frames); frames);
index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
tid_agg_rx->ssn) %
tid_agg_rx->buf_size;
} }
if (tid_agg_rx->stored_mpdu_num) { if (tid_agg_rx->stored_mpdu_num) {
j = index = ieee80211_sn_sub(tid_agg_rx->head_seq_num, j = index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
tid_agg_rx->ssn) %
tid_agg_rx->buf_size;
for (; j != (index - 1) % tid_agg_rx->buf_size; for (; j != (index - 1) % tid_agg_rx->buf_size;
j = (j + 1) % tid_agg_rx->buf_size) { 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,8 +854,7 @@ static bool ieee80211_sta_manage_reorder_buf(struct ieee80211_sub_if_data *sdata
/* Now the new frame is always in the range of the reordering buffer */ /* Now the new frame is always in the range of the reordering buffer */
index = ieee80211_sn_sub(mpdu_seq_num, index = mpdu_seq_num % tid_agg_rx->buf_size;
tid_agg_rx->ssn) % tid_agg_rx->buf_size;
/* check if we already stored this frame */ /* check if we already stored this frame */
if (tid_agg_rx->reorder_buf[index]) { if (tid_agg_rx->reorder_buf[index]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册