57f4ca64a5bbc819ef1f003dfddf5aed0a757232
[openwrt/staging/hauke.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 28 Nov 2018 22:36:06 +0100
3 Subject: [PATCH] mac80211: fix reordering of buffered broadcast packets
4
5 If the buffered broadcast queue contains packets, letting new packets bypass
6 that queue can lead to heavy reordering, since the driver is probably throttling
7 transmission of buffered multicast packets after beacons.
8
9 Keep buffering packets until the buffer has been cleared (and no client
10 is in powersave mode).
11
12 Cc: stable@vger.kernel.org
13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 ---
15
16 --- a/net/mac80211/tx.c
17 +++ b/net/mac80211/tx.c
18 @@ -435,8 +435,8 @@ ieee80211_tx_h_multicast_ps_buf(struct i
19 if (ieee80211_hw_check(&tx->local->hw, QUEUE_CONTROL))
20 info->hw_queue = tx->sdata->vif.cab_queue;
21
22 - /* no stations in PS mode */
23 - if (!atomic_read(&ps->num_sta_ps))
24 + /* no stations in PS mode and no buffered packets */
25 + if (!atomic_read(&ps->num_sta_ps) && skb_queue_empty(&ps->bc_buf))
26 return TX_CONTINUE;
27
28 info->flags |= IEEE80211_TX_CTL_SEND_AFTER_DTIM;