Skip to contentSkip to conversation

mac80211: Requeue work for all iftypes after scan completion

PATCH Superseded Sachin Kulkarni 3 participants 7 messages Jul 10, 2014 – Jul 21, 2014 1 message not in the archive mac80211

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 mac80211: Requeue work for all iftypes after scan completion

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed for iftype AP when it coexists with a STA, and when the scan durations are very long.

---
We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is not connected to anyone while the AP has a station connected to it. The hardware we are using currently has scan durations of ~8 sec and a new scan request is generated every 10 s. This results in a window of only 2 s when work items can be processed by ieee80211_iface_work. We came across scenarios where the AP is trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work since a hw scan is in progress most of the time. When the scan completes however the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context, the TX frames just keep getting queued up, since the tid has not been destroyed. This results in disconnections since things like ARP timeouts etc start happening.

---
 net/mac80211/mlme.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +3 -2
index 931330b..49af420 100644
@@ -3647,9 +3647,10 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
 		if (!(flags&  IEEE80211_HW_CONNECTION_MONITOR))
 			ieee80211_queue_work(&sdata->local->hw,
 					&sdata->u.mgd.monitor_work);
-		/* and do all the other regular work too */
-		ieee80211_queue_work(&sdata->local->hw,&sdata->work);
 	}
+
+	/* and do all the other regular work too */
+	ieee80211_queue_work(&sdata->local->hw,&sdata->work);
 }
 
 #ifdef CONFIG_PM
#2 lore raw
Quoted 30 lines · Sachin Kulkarni

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However
after the scan complete work is requeued only for STA, ADHOC and MESH iftypes.
This occasionally results in event processing getting delayed for iftype AP when
it coexists with a STA, and when the scan durations are very long.

---
We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is
not connected to anyone while the AP has a station connected to it. The hardware
we are using currently has scan durations of ~8 sec and a new scan request is
generated every 10 s. This results in a window of only 2 s when work items can
be processed by ieee80211_iface_work. We came across scenarios where the AP is
trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work
since a hw scan is in progress most of the time. When the scan completes however

Quoted 8 lines

the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context,
the TX frames just keep getting queued up, since the tid has not been destroyed.
This results in disconnections since things like ARP timeouts etc start happening.
---

afaict, there doesn't seem to be any good reason to exit ieee80211_iface_work in case of hw scan (rather than sw_scan). we had a patch for it (one-liner), but it probably got forgotten in some internal tree :)

Eliad.

maintainer
#3 lore raw
In reply to Sachin Kulkarni
Quoted 33 lines · Sachin Kulkarni

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed for iftype AP when it coexists with a STA, and when the scan durations are very long.

---
We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is not connected to anyone while the AP has a station connected to it. The hardware we are using currently has scan durations of ~8 sec and a new scan request is generated every 10 s. This results in a window of only 2 s when work items can be processed by ieee80211_iface_work. We came across scenarios where the AP is trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work since a hw scan is in progress most of the time. When the scan completes however the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context, the TX frames just keep getting queued up, since the tid has not been destroyed. This results in disconnections since things like ARP timeouts etc start happening.

---
  net/mac80211/mlme.c |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +0 -0
index 931330b..49af420 100644

net/mac80211/mlme.c static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) · line 3653

Quoted 9 lines
net/mac80211/mlme.c +3 -2
@@ -3647,9 +3647,10 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
  		if (!(flags&  IEEE80211_HW_CONNECTION_MONITOR))
  			ieee80211_queue_work(&sdata->local->hw,
  					&sdata->u.mgd.monitor_work);
-		/* and do all the other regular work too */
-		ieee80211_queue_work(&sdata->local->hw,&sdata->work);
  	}
+
+	/* and do all the other regular work too */
+	ieee80211_queue_work(&sdata->local->hw,&sdata->work);

Please fix the space while at it. :)

johannes

#4 lore raw
Quoted 29 lines · Johannes Berg
Quoted 28 lines · Sachin Kulkarni

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed for iftype AP when it coexists with a STA, and when the scan durations are very long.

---
We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is not connected to anyone while the AP has a station connected to it. The hardware we are using currently has scan durations of ~8 sec and a new scan request is generated every 10 s. This results in a window of only 2 s when work items can be processed by ieee80211_iface_work. We came across scenarios where the AP is trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work since a hw scan is in progress most of the time. When the scan completes however the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context, the TX frames just keep getting queued up, since the tid has not been destroyed. This results in disconnections since things like ARP timeouts etc start happening.

---
   net/mac80211/mlme.c |    5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)
Quoted 15 lines
Quoted 5 lines
net/mac80211/mlme.c +0 -0
index 931330b..49af420 100644

net/mac80211/mlme.c static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) · line 3653

Quoted 9 lines
net/mac80211/mlme.c +3 -2
@@ -3647,9 +3647,10 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
   		if (!(flags&   IEEE80211_HW_CONNECTION_MONITOR))
   			ieee80211_queue_work(&sdata->local->hw,
   					&sdata->u.mgd.monitor_work);
-		/* and do all the other regular work too */
-		ieee80211_queue_work(&sdata->local->hw,&sdata->work);
   	}
+
+	/* and do all the other regular work too */
+	ieee80211_queue_work(&sdata->local->hw,&sdata->work);

Please fix the space while at it. :)

Thanks for getting back Johannes. Just a quick question. When you said "..fix the space.." did you mean the spaces in the following lines:

if (!(flags& IEEE80211_HW_CONNECTION_MONITOR))
ieee80211_queue_work(&sdata->local->hw,
&sdata->u.mgd.monitor_work);

or the newline I introduced here:

+
+ /* and do all the other regular work too */
+ ieee80211_queue_work(&sdata->local->hw,&sdata->work);

(I verified the patch with ./scripts/checkpatch.pl and it passed.)

Regards,
Sachin

maintainer
#5 lore raw
Quoted 55 lines · Sachin Kulkarni
Quoted 29 lines · Johannes Berg
Quoted 28 lines · Sachin Kulkarni

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed for iftype AP when it coexists with a STA, and when the scan durations are very long.

---
We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is not connected to anyone while the AP has a station connected to it. The hardware we are using currently has scan durations of ~8 sec and a new scan request is generated every 10 s. This results in a window of only 2 s when work items can be processed by ieee80211_iface_work. We came across scenarios where the AP is trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work since a hw scan is in progress most of the time. When the scan completes however the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context, the TX frames just keep getting queued up, since the tid has not been destroyed. This results in disconnections since things like ARP timeouts etc start happening.

---
   net/mac80211/mlme.c |    5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)
Quoted 15 lines
Quoted 5 lines
net/mac80211/mlme.c +0 -0
index 931330b..49af420 100644

net/mac80211/mlme.c static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) · line 3653

Quoted 9 lines
net/mac80211/mlme.c +3 -2
@@ -3647,9 +3647,10 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
   		if (!(flags&   IEEE80211_HW_CONNECTION_MONITOR))
   			ieee80211_queue_work(&sdata->local->hw,
   					&sdata->u.mgd.monitor_work);
-		/* and do all the other regular work too */
-		ieee80211_queue_work(&sdata->local->hw,&sdata->work);
   	}
+
+	/* and do all the other regular work too */
+	ieee80211_queue_work(&sdata->local->hw,&sdata->work);

Please fix the space while at it. :)

Thanks for getting back Johannes. Just a quick question. When you said "..fix the space.." did you mean the spaces in the following lines:

   		if (!(flags&   IEEE80211_HW_CONNECTION_MONITOR))
   			ieee80211_queue_work(&sdata->local->hw,
   					&sdata->u.mgd.monitor_work);

or the newline I introduced here:

net/mac80211/mlme.c static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) · line 3653

Quoted 3 lines
net/mac80211/mlme.c +3 -0
+
+	/* and do all the other regular work too */
+	ieee80211_queue_work(&sdata->local->hw,&sdata->work);

You should have a space after the comma

johannes

#6 lore raw

PATCH v2 1/1 mac80211: Requeue work for all iftypes after scan completion

In reply to Sachin Kulkarni

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed for iftype AP when it coexists with a STA, and when the scan durations are very long.

---
v2: Fix white space after comma

We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is not connected to anyone while the AP has a station connected to it. The hardware we are using currently has scan durations of ~8 sec and a new scan request is generated every 10 s. This results in a window of only 2 s when work items can be processed by ieee80211_iface_work. We came across scenarios where the AP is trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work since a hw scan is in progress most of the time. When the scan completes however the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context, the TX frames just keep getting queued up, since the tid has not been destroyed. This results in disconnections since things like ARP timeouts etc start happening.

---
 net/mac80211/mlme.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +3 -2
index 931330b..49af420 100644
@@ -3647,9 +3647,10 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
 		if (!(flags&   IEEE80211_HW_CONNECTION_MONITOR))
 			ieee80211_queue_work(&sdata->local->hw,
 					&sdata->u.mgd.monitor_work);
-		/* and do all the other regular work too */
-		ieee80211_queue_work(&sdata->local->hw,&sdata->work);
 	}
+
+	/* and do all the other regular work too */
+	ieee80211_queue_work(&sdata->local->hw,&sdata->work);
 }
 
 #ifdef CONFIG_PM
#7 lore raw
Quoted 48 lines · Sachin Kulkarni

From: Sachin Kulkarni<[email protected]>

During a hw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed for iftype AP when it coexists with a STA, and when the scan durations are very long.

---
v2: Fix white space after comma

We have a test scenario where there are 2 VIFs: one STA and one AP. The STA is not connected to anyone while the AP has a station connected to it. The hardware we are using currently has scan durations of ~8 sec and a new scan request is generated every 10 s. This results in a window of only 2 s when work items can be processed by ieee80211_iface_work. We came across scenarios where the AP is trying to tear down a AMPDU session, and the IEEE80211_SDATA_QUEUE_AGG_STOP event gets queued. However the work item for this gets ignored by the ieee80211_iface_work since a hw scan is in progress most of the time. When the scan completes however the work item for the AP does not get requeued, and by the time the IEEE80211_SDATA_QUEUE_AGG_STOP gets processed in some other work items context, the TX frames just keep getting queued up, since the tid has not been destroyed. This results in disconnections since things like ARP timeouts etc start happening.

---
 net/mac80211/mlme.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +3 -2
index 931330b..49af420 100644
@@ -3647,9 +3647,10 @@ static void ieee80211_restart_sta_timer(struct 
 ieee80211_sub_if_data *sdata)
         if (!(flags&   IEEE80211_HW_CONNECTION_MONITOR))
             ieee80211_queue_work(&sdata->local->hw,
 &sdata->u.mgd.monitor_work);
-        /* and do all the other regular work too */
-        ieee80211_queue_work(&sdata->local->hw,&sdata->work);
     }
+
+    /* and do all the other regular work too */
+    ieee80211_queue_work(&sdata->local->hw,&sdata->work);
 }
 
Quoted 3 lines

#ifdef CONFIG_PM

Sorry Johannes, it looks like my Thunderbird is removing the white space for some reason !! I will try to resend the patch by some other means soon.