From c1e6ef488f6b61156164ea4fe0328e9e36a305aa Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 28 Jan 2016 22:42:10 +0000 Subject: mac80211: merge a bunch of pending fixes Signed-off-by: Felix Fietkau SVN-Revision: 48536 --- ...ix-unnecessary-frame-drops-in-mesh-fwding.patch | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch (limited to 'package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch') diff --git a/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch b/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch new file mode 100644 index 0000000000..844d43bfc7 --- /dev/null +++ b/package/kernel/mac80211/patches/313-mac80211-fix-unnecessary-frame-drops-in-mesh-fwding.patch @@ -0,0 +1,57 @@ +From: Michal Kazior +Date: Mon, 25 Jan 2016 14:43:24 +0100 +Subject: [PATCH] mac80211: fix unnecessary frame drops in mesh fwding + +The ieee80211_queue_stopped() expects hw queue +number but it was given raw WMM AC number instead. + +This could cause frame drops and problems with +traffic in some cases - most notably if driver +doesn't map AC numbers to queue numbers 1:1 and +uses ieee80211_stop_queues() and +ieee80211_wake_queue() only without ever calling +ieee80211_wake_queues(). + +On ath10k it was possible to hit this problem in +the following case: + + 1. wlan0 uses queue 0 + (ath10k maps queues per vif) + 2. offchannel uses queue 15 + 3. queues 1-14 are unused + 4. ieee80211_stop_queues() + 5. ieee80211_wake_queue(q=0) + 6. ieee80211_wake_queue(q=15) + (other queues are not woken up because both + driver and mac80211 know other queues are + unused) + 7. ieee80211_rx_h_mesh_fwding() + 8. ieee80211_select_queue_80211() returns 2 + 9. ieee80211_queue_stopped(q=2) returns true + 10. frame is dropped (oops!) + +Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping") +Signed-off-by: Michal Kazior +--- + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2235,7 +2235,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + struct ieee80211_local *local = rx->local; + struct ieee80211_sub_if_data *sdata = rx->sdata; + struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; +- u16 q, hdrlen; ++ u16 ac, q, hdrlen; + + hdr = (struct ieee80211_hdr *) skb->data; + hdrlen = ieee80211_hdrlen(hdr->frame_control); +@@ -2304,7 +2304,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + ether_addr_equal(sdata->vif.addr, hdr->addr3)) + return RX_CONTINUE; + +- q = ieee80211_select_queue_80211(sdata, skb, hdr); ++ ac = ieee80211_select_queue_80211(sdata, skb, hdr); ++ q = sdata->vif.hw_queue[ac]; + if (ieee80211_queue_stopped(&local->hw, q)) { + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion); + return RX_DROP_MONITOR; -- cgit v1.2.3