All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: synchronize_net() before flushing the queues
@ 2015-01-22 21:30 Emmanuel Grumbach
  2015-01-23  9:56 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Emmanuel Grumbach @ 2015-01-22 21:30 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

When mac80211 disconnects, it drops all the packets on the
queues. This happens after the net stack has been notified
that we have no link anymore (netif_carrier_off).
netif_carrier_off ensures that no new packets are sent to
xmit() callback, but we might have older packets in the
middle of the Tx path. These packets will land in the
driver's queues after the latter have been flushed.
Synchronize_net() between netif_carrier_off and drv_flush()
will fix this.

Note that we can't call synchronize_net inside
ieee80211_flush_queues since there are flows that call
ieee80211_flush_queues and don't need synchronize_net()
which is an expensive operation.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/mlme.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1d6bf01..1eafa63 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2016,6 +2016,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 	/* disable per-vif ps */
 	ieee80211_recalc_ps_vif(sdata);
 
+	/* flush out all packets */
+	synchronize_net();
+
 	/*
 	 * drop any frame before deauth/disassoc, this can be data or
 	 * management frame. Since we are disconnecting, we should not
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-23 13:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 21:30 [PATCH] mac80211: synchronize_net() before flushing the queues Emmanuel Grumbach
2015-01-23  9:56 ` Johannes Berg
2015-01-23 10:18   ` Grumbach, Emmanuel
2015-01-23 10:33     ` Johannes Berg
2015-01-23 11:36       ` Emmanuel Grumbach
2015-01-23 13:20         ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.