diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2009-05-05 13:35:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:15:04 -0400 |
commit | 4d050f1daed3babf6fcc337f862a245d31af4452 (patch) | |
tree | ea684e5168772b822fdb0bd162378fd252227f3c /net/mac80211/agg-rx.c | |
parent | 2d3babd11f91501f49c6af212e6795bd8954f4d4 (diff) |
mac80211: Add a timeout for frames in the RX reorder buffer
This patch allows skbs to be released from the RX reorder buffer in
case they have been there for an unexpectedly long time without us
having received the missing frames before them. Previously, these
frames were only released when the reorder window moved and that could
take very long time unless new frames were received constantly (e.g.,
TCP connections could be killed more or less indefinitely).
This situation should not happen very frequently, but it looks like
there are some scenarious that trigger it for some reason. As such,
this should be considered mostly a workaround to speed up recovery
from unexpected siutation that could result in connections hanging for
long periods of time.
The changes here will only check for timeout situation when adding new
RX frames to the reorder buffer. It does not handle all possible
cases, but seems to help for most cases that could result from common
network usage (e.g., TCP retrying at least couple of times). For more
completely coverage, a timer could be used to periodically check
whether there are any frames remaining in the reorder buffer if no new
frames are received.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/agg-rx.c')
-rw-r--r-- | net/mac80211/agg-rx.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index fff24c3d6460..bc064d7933ff 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c | |||
@@ -68,6 +68,7 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, | |||
68 | spin_lock_bh(&sta->lock); | 68 | spin_lock_bh(&sta->lock); |
69 | /* free resources */ | 69 | /* free resources */ |
70 | kfree(sta->ampdu_mlme.tid_rx[tid]->reorder_buf); | 70 | kfree(sta->ampdu_mlme.tid_rx[tid]->reorder_buf); |
71 | kfree(sta->ampdu_mlme.tid_rx[tid]->reorder_time); | ||
71 | 72 | ||
72 | if (!sta->ampdu_mlme.tid_rx[tid]->shutdown) { | 73 | if (!sta->ampdu_mlme.tid_rx[tid]->shutdown) { |
73 | kfree(sta->ampdu_mlme.tid_rx[tid]); | 74 | kfree(sta->ampdu_mlme.tid_rx[tid]); |
@@ -268,13 +269,18 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, | |||
268 | /* prepare reordering buffer */ | 269 | /* prepare reordering buffer */ |
269 | tid_agg_rx->reorder_buf = | 270 | tid_agg_rx->reorder_buf = |
270 | kcalloc(buf_size, sizeof(struct sk_buff *), GFP_ATOMIC); | 271 | kcalloc(buf_size, sizeof(struct sk_buff *), GFP_ATOMIC); |
271 | if (!tid_agg_rx->reorder_buf) { | 272 | tid_agg_rx->reorder_time = |
273 | kcalloc(buf_size, sizeof(unsigned long), GFP_ATOMIC); | ||
274 | if (!tid_agg_rx->reorder_buf || !tid_agg_rx->reorder_time) { | ||
272 | #ifdef CONFIG_MAC80211_HT_DEBUG | 275 | #ifdef CONFIG_MAC80211_HT_DEBUG |
273 | if (net_ratelimit()) | 276 | if (net_ratelimit()) |
274 | printk(KERN_ERR "can not allocate reordering buffer " | 277 | printk(KERN_ERR "can not allocate reordering buffer " |
275 | "to tid %d\n", tid); | 278 | "to tid %d\n", tid); |
276 | #endif | 279 | #endif |
280 | kfree(tid_agg_rx->reorder_buf); | ||
281 | kfree(tid_agg_rx->reorder_time); | ||
277 | kfree(sta->ampdu_mlme.tid_rx[tid]); | 282 | kfree(sta->ampdu_mlme.tid_rx[tid]); |
283 | sta->ampdu_mlme.tid_rx[tid] = NULL; | ||
278 | goto end; | 284 | goto end; |
279 | } | 285 | } |
280 | 286 | ||