From: Luciano Coelho <[email protected]>
Instead of stopping all the hardware queues during channel switch,
which is especially bad when we have large CSA counts, stop only the
queues that are assigned to the vif that is performing the channel
switch.
Signed-off-by: Luciano Coelho <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
---
net/mac80211/cfg.c | 10 ++++------
net/mac80211/iface.c | 5 ++---
net/mac80211/mlme.c | 20 ++++++++------------
3 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c6fe358..5215abb 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1142,9 +1142,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
mutex_lock(&local->mtx);
sdata->vif.csa_active = false;
if (!ieee80211_csa_needs_block_tx(local))
- ieee80211_wake_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_wake_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
mutex_unlock(&local->mtx);
kfree(sdata->u.ap.next_beacon);
@@ -3146,9 +3145,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
if (!ieee80211_csa_needs_block_tx(local))
- ieee80211_wake_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_wake_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
return 0;
}
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 9b9d804..c7417db 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -842,9 +842,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
mutex_lock(&local->mtx);
sdata->vif.csa_active = false;
if (!ieee80211_csa_needs_block_tx(local))
- ieee80211_wake_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_wake_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
mutex_unlock(&local->mtx);
sdata_unlock(sdata);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 003d17e..2d3b3a5 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -993,9 +993,8 @@ static void ieee80211_chswitch_work(struct work_struct *work)
sdata->vif.csa_active = false;
/* XXX: wait for a beacon first? */
if (!ieee80211_csa_needs_block_tx(local))
- ieee80211_wake_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_wake_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
mutex_unlock(&local->mtx);
ieee80211_bss_info_change_notify(sdata, changed);
@@ -1109,9 +1108,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
sdata->csa_block_tx = csa_ie.mode;
if (sdata->csa_block_tx)
- ieee80211_stop_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_stop_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
mutex_unlock(&local->mtx);
cfg80211_ch_switch_started_notify(sdata->dev, &csa_ie.chandef,
@@ -1830,9 +1828,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
sdata->vif.csa_active = false;
if (!ieee80211_csa_needs_block_tx(local))
- ieee80211_wake_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_wake_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
mutex_unlock(&local->mtx);
sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM;
@@ -2078,9 +2075,8 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata)
mutex_lock(&local->mtx);
sdata->vif.csa_active = false;
if (!ieee80211_csa_needs_block_tx(local))
- ieee80211_wake_queues_by_reason(&local->hw,
- IEEE80211_MAX_QUEUE_MAP,
- IEEE80211_QUEUE_STOP_REASON_CSA);
+ ieee80211_wake_vif_queues(local, sdata,
+ IEEE80211_QUEUE_STOP_REASON_CSA);
mutex_unlock(&local->mtx);
cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
--
1.9.1
On 6 June 2014 09:37, Coelho, Luciano <[email protected]> wrote:
> On Fri, 2014-06-06 at 08:44 +0200, Michal Kazior wrote:
>> On 6 June 2014 08:31, Coelho, Luciano <[email protected]> wrote:
>> > On Fri, 2014-06-06 at 07:51 +0200, Michal Kazior wrote:
>> >> On 5 June 2014 18:26, Emmanuel Grumbach <[email protected]> wrote:
>> [...]
>> >> > @@ -3146,9 +3145,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
>> >> > cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
>> >> >
>> >> > if (!ieee80211_csa_needs_block_tx(local))
>> >> > - ieee80211_wake_queues_by_reason(&local->hw,
>> >> > - IEEE80211_MAX_QUEUE_MAP,
>> >> > - IEEE80211_QUEUE_STOP_REASON_CSA);
>> >> > + ieee80211_wake_vif_queues(local, sdata,
>> >> > + IEEE80211_QUEUE_STOP_REASON_CSA);
>> >>
>> >> I don't think this is going to work with the upcomming multi-vif
>> >> channel switching.
>> >>
>> >> The ieee80211_csa_needs_block_tx() will become false upon *last*
>> >> interface switch completion. This means preceeding interface csa
>> >> finalizations won't call ieee80211_wake_vif_queues() so you actually
>> >> end up not waking all of the queues when you finish csa.
>> >
>> > I think the right way to do it would be to traverse the vifs that
>> > switched and wake up their queues when the switch is finished.
>> >
>> >
>> >> I think this can be solved with:
>> >>
>> >> if (!ieee80211_csa_needs_block_tx(local))
>> >> list_for_each(sdata, &local->interfaces, list)
>> >> ieee80211_wake_vif_queues(local, sdata, REASON_CSA);
>> >>
>> >> But then I guess it's just a convoluted way of saying:
>> >>
>> >> if (!ieee80211_csa_needs_block_tx(local))
>> >> ieee80211_wake_queues_by_reason(hw, REASON_CSA);
>> >>
>> >> IOW waking should remain as it was while stopping can be done per-vif.
>> >>
>> >> This goes for all instances calling wake_vif_queues() in the patch.
>> >
>> > Actually I had it like this in my first version, I had only added the
>> > stop part, leaving the wake as it was. But then I thought that we would
>> > be restarting queues from other vifs that we don't know about. If
>> > another vif is switching separately, we would restart its queues at the
>> > wrong time. I think we shouldn't assume that all vifs are part of the
>> > same switch.
>>
>> Well, not really.
>>
>> There is no "vif switching separately" when it comes to block_tx. The
>> condition checks if ANY interface still needs queues to be locked for
>> the *REASON_CSA*. If the condition is false (i.e. "no interface needs
>> block_tx") then you are safe to wake *all* queues for *REASON_CSA* on
>> all interfaces because channel switches that don't need block_tx don't
>> stop their queues for REASON_CSA in the first place.
>
> Right, and this used to make sense when we were stopping *all* hw_queues
> when we had block_tx.
>
> Maybe we should make a new function that returns all the queues that our
> vif was blocking but that are not blocked by any other vifs. Maybe
> something like this:
>
> static u32 ieee80211_vif_queues_to_wake(struct ieee80211_local *local,
> struct ieee80211_sub_if_data *sdata,
> enum queue_stop_reason reason)
> {
> struct ieee80211_sub_if_data *sdata_iter;
> unsigned long queues, queues_iter, q;
> int i;
>
> lockdep_assert_held(&local->mtx);
>
> queues = ieee80211_get_vif_queues(local, sdata);
>
> rcu_read_lock();
> list_for_each_entry_rcu(sdata_iter, &local->interfaces, list) {
> if (!ieee80211_sdata_running(sdata_iter))
> continue;
>
> queues_iter = ieee80211_get_vif_queues(local, sdata_iter);
> for_each_set_bit(i, &queues_iter, local->hw.queues) {
> q = sdata->vif.hw_queue[i];
>
> if (test_bit(reason, &local->queue_stop_reasons[q]))
> queues &= ~q;
> }
> }
> rcu_read_unlock();
>
> return queues;
> }
>
> void ieee80211_wake_vif_queues(struct ieee80211_local *local,
> struct ieee80211_sub_if_data *sdata,
> enum queue_stop_reason reason)
> {
> unsigned int queues = ieee80211_vif_queues_to_wake(local, sdata, reason);
>
> ieee80211_wake_queues_by_reason(&local->hw, queues, reason);
> }
Once you set local->queue_stop_reasons[] for an overlapping queue you
won't be able to wake it with ieee80211_wake_vif_queues() alone.
You'll need to call ieee80211_wake_queues() to do that. Is that what
you intended?
>> You could argue current queue locking for CSA is not efficient and
>> you'd be right. It was a simplification I came up with to get things
>> at least work correctly not efficiently.
>>
>>
>> >> Generally I don't think having wake_vif_queues() is a good idea. It's
>> >> really tricky. Sure, you can have a stop_vif_queues() which will
>> >> behave as you might expect (i.e. first call stops queues and
>> >> overlapping vif-queue mappings are not a concern). But
>> >> wake_vif_queues() seems to have little practical use to me without any
>> >> kind of per-queue reference counting.
>> >
>> > Yeah, this could be a problem for vifs that are sharing the same queues.
>> > But that case would be really tricky with channel-switch anyway. because
>> > if the channel of one vif is changed but not the other, the queue would
>> > probably have to be split...
>>
>> Hmm. That's a very good point. Can we even re-map this during the switch now?
>>
>> If we can't then doesn't it imply that if there are shared vif-queue
>> mappings then channel switching should be limited/prevented? I.e. it
>> might be okay if you have 2 vifs sharing a queue to switch to the
>> exact same channel but it won't work if you try to switch them to
>> separate channels. Single-channel devices won't have to worry about it
>> (single-channel combination cases for that matter).
>
> Yeah, it should probably be prevented for such drivers. But then, at
> what point? Prevent the channel switch to occur completely if another
> vif shares the same queue? Or fail the switch if the other vif doesn't
> join the switch?
That's a good question too. I would prefer to leave it until the last
second, e.g. give the opportunity to re-map in
drv_switch_vif_chanctx() maybe so driver can fail if it's unable to
comply?
Michał
T24gRnJpLCAyMDE0LTA2LTA2IGF0IDA5OjU2ICswMjAwLCBNaWNoYWwgS2F6aW9yIHdyb3RlOg0K
PiBPbiA2IEp1bmUgMjAxNCAwOTozNywgQ29lbGhvLCBMdWNpYW5vIDxsdWNpYW5vLmNvZWxob0Bp
bnRlbC5jb20+IHdyb3RlOg0KPi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HN3
aXRjaCB0aGVtIHRvDQo+ID4+IHNlcGFyYXRlIGNoYW5uZWxzLiBTaW5nbGUtY2hhbm5lbCBkZXZp
Y2VzIHdvbid0IGhhdmUgdG8gd29ycnkgYWJvdXQgaXQNCj4gPj4gKHNpbmdsZS1jaGFubmVsIGNv
bWJpbmF0aW9uIGNhc2VzIGZvciB0aGF0IG1hdHRlcikuDQo+ID4NCj4gPiBZZWFoLCBpdCBzaG91
bGQgcHJvYmFibHkgYmUgcHJldmVudGVkIGZvciBzdWNoIGRyaXZlcnMuICBCdXQgdGhlbiwgYXQN
Cj4gPiB3aGF0IHBvaW50PyBQcmV2ZW50IHRoZSBjaGFubmVsIHN3aXRjaCB0byBvY2N1ciBjb21w
bGV0ZWx5IGlmIGFub3RoZXINCj4gPiB2aWYgc2hhcmVzIHRoZSBzYW1lIHF1ZXVlPyBPciBmYWls
IHRoZSBzd2l0Y2ggaWYgdGhlIG90aGVyIHZpZiBkb2Vzbid0DQo+ID4gam9pbiB0aGUgc3dpdGNo
Pw0KPiANCj4gVGhhdCdzIGEgZ29vZCBxdWVzdGlvbiB0b28uIEkgd291bGQgcHJlZmVyIHRvIGxl
YXZlIGl0IHVudGlsIHRoZSBsYXN0DQo+IHNlY29uZCwgZS5nLiBnaXZlIHRoZSBvcHBvcnR1bml0
eSB0byByZS1tYXAgaW4NCj4gZHJ2X3N3aXRjaF92aWZfY2hhbmN0eCgpIG1heWJlIHNvIGRyaXZl
ciBjYW4gZmFpbCBpZiBpdCdzIHVuYWJsZSB0bw0KPiBjb21wbHk/DQoNClllcywgSSB0ZW5kIHRv
IGFncmVlLg0KDQotLQ0KTHVjYS4NCg==
On 6 June 2014 08:31, Coelho, Luciano <[email protected]> wrote:
> On Fri, 2014-06-06 at 07:51 +0200, Michal Kazior wrote:
>> On 5 June 2014 18:26, Emmanuel Grumbach <[email protected]> wrote:
[...]
>> > @@ -3146,9 +3145,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
>> > cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
>> >
>> > if (!ieee80211_csa_needs_block_tx(local))
>> > - ieee80211_wake_queues_by_reason(&local->hw,
>> > - IEEE80211_MAX_QUEUE_MAP,
>> > - IEEE80211_QUEUE_STOP_REASON_CSA);
>> > + ieee80211_wake_vif_queues(local, sdata,
>> > + IEEE80211_QUEUE_STOP_REASON_CSA);
>>
>> I don't think this is going to work with the upcomming multi-vif
>> channel switching.
>>
>> The ieee80211_csa_needs_block_tx() will become false upon *last*
>> interface switch completion. This means preceeding interface csa
>> finalizations won't call ieee80211_wake_vif_queues() so you actually
>> end up not waking all of the queues when you finish csa.
>
> I think the right way to do it would be to traverse the vifs that
> switched and wake up their queues when the switch is finished.
>
>
>> I think this can be solved with:
>>
>> if (!ieee80211_csa_needs_block_tx(local))
>> list_for_each(sdata, &local->interfaces, list)
>> ieee80211_wake_vif_queues(local, sdata, REASON_CSA);
>>
>> But then I guess it's just a convoluted way of saying:
>>
>> if (!ieee80211_csa_needs_block_tx(local))
>> ieee80211_wake_queues_by_reason(hw, REASON_CSA);
>>
>> IOW waking should remain as it was while stopping can be done per-vif.
>>
>> This goes for all instances calling wake_vif_queues() in the patch.
>
> Actually I had it like this in my first version, I had only added the
> stop part, leaving the wake as it was. But then I thought that we would
> be restarting queues from other vifs that we don't know about. If
> another vif is switching separately, we would restart its queues at the
> wrong time. I think we shouldn't assume that all vifs are part of the
> same switch.
Well, not really.
There is no "vif switching separately" when it comes to block_tx. The
condition checks if ANY interface still needs queues to be locked for
the *REASON_CSA*. If the condition is false (i.e. "no interface needs
block_tx") then you are safe to wake *all* queues for *REASON_CSA* on
all interfaces because channel switches that don't need block_tx don't
stop their queues for REASON_CSA in the first place.
You could argue current queue locking for CSA is not efficient and
you'd be right. It was a simplification I came up with to get things
at least work correctly not efficiently.
>> Generally I don't think having wake_vif_queues() is a good idea. It's
>> really tricky. Sure, you can have a stop_vif_queues() which will
>> behave as you might expect (i.e. first call stops queues and
>> overlapping vif-queue mappings are not a concern). But
>> wake_vif_queues() seems to have little practical use to me without any
>> kind of per-queue reference counting.
>
> Yeah, this could be a problem for vifs that are sharing the same queues.
> But that case would be really tricky with channel-switch anyway. because
> if the channel of one vif is changed but not the other, the queue would
> probably have to be split...
Hmm. That's a very good point. Can we even re-map this during the switch now?
If we can't then doesn't it imply that if there are shared vif-queue
mappings then channel switching should be limited/prevented? I.e. it
might be okay if you have 2 vifs sharing a queue to switch to the
exact same channel but it won't work if you try to switch them to
separate channels. Single-channel devices won't have to worry about it
(single-channel combination cases for that matter).
Michał
On 6 June 2014 10:04, Coelho, Luciano <[email protected]> wrote:
> On Fri, 2014-06-06 at 09:56 +0200, Michal Kazior wrote:
>> On 6 June 2014 09:37, Coelho, Luciano <[email protected]> wrote:
[...]
>> > static u32 ieee80211_vif_queues_to_wake(struct ieee80211_local *local,
>> > struct ieee80211_sub_if_data *sdata,
>> > enum queue_stop_reason reason)
>> > {
>> > struct ieee80211_sub_if_data *sdata_iter;
>> > unsigned long queues, queues_iter, q;
>> > int i;
>> >
>> > lockdep_assert_held(&local->mtx);
>> >
>> > queues = ieee80211_get_vif_queues(local, sdata);
>> >
>> > rcu_read_lock();
>> > list_for_each_entry_rcu(sdata_iter, &local->interfaces, list) {
>> > if (!ieee80211_sdata_running(sdata_iter))
>> > continue;
Hmm, actually, shouldn't we `if (sdata == sdata_iter) continue`?
Otherwise you'll never wake queues, will you?
>> > queues_iter = ieee80211_get_vif_queues(local, sdata_iter);
>> > for_each_set_bit(i, &queues_iter, local->hw.queues) {
>> > q = sdata->vif.hw_queue[i];
>> >
>> > if (test_bit(reason, &local->queue_stop_reasons[q]))
>> > queues &= ~q;
>> > }
>> > }
>> > rcu_read_unlock();
>> >
>> > return queues;
>> > }
>> >
>> > void ieee80211_wake_vif_queues(struct ieee80211_local *local,
>> > struct ieee80211_sub_if_data *sdata,
>> > enum queue_stop_reason reason)
>> > {
>> > unsigned int queues = ieee80211_vif_queues_to_wake(local, sdata, reason);
>> >
>> > ieee80211_wake_queues_by_reason(&local->hw, queues, reason);
>> > }
>>
>> Once you set local->queue_stop_reasons[] for an overlapping queue you
>> won't be able to wake it with ieee80211_wake_vif_queues() alone.
>> You'll need to call ieee80211_wake_queues() to do that. Is that what
>> you intended?
>
> More or less. My idea is that only the *last* vif that tries to wake
> the overlapping queue, will actually do so.
So ieee80211_wake_vif_queues() would be called regardless of the
ieee80211_csa_needs_block_tx() and ieee80211_wake_queues() is called
like it was before (i.e. when all block_tx interfaces are done).
Michał
T24gRnJpLCAyMDE0LTA2LTA2IGF0IDA3OjUxICswMjAwLCBNaWNoYWwgS2F6aW9yIHdyb3RlOg0K
PiBPbiA1IEp1bmUgMjAxNCAxODoyNiwgRW1tYW51ZWwgR3J1bWJhY2ggPGVtbWFudWVsLmdydW1i
YWNoQGludGVsLmNvbT4gd3JvdGU6DQo+ID4gRnJvbTogTHVjaWFubyBDb2VsaG8gPGx1Y2lhbm8u
Y29lbGhvQGludGVsLmNvbT4NCj4gPg0KPiA+IEluc3RlYWQgb2Ygc3RvcHBpbmcgYWxsIHRoZSBo
YXJkd2FyZSBxdWV1ZXMgZHVyaW5nIGNoYW5uZWwgc3dpdGNoLA0KPiA+IHdoaWNoIGlzIGVzcGVj
aWFsbHkgYmFkIHdoZW4gd2UgaGF2ZSBsYXJnZSBDU0EgY291bnRzLCBzdG9wIG9ubHkgdGhlDQo+
ID4gcXVldWVzIHRoYXQgYXJlIGFzc2lnbmVkIHRvIHRoZSB2aWYgdGhhdCBpcyBwZXJmb3JtaW5n
IHRoZSBjaGFubmVsDQo+ID4gc3dpdGNoLg0KPiA+DQo+ID4gU2lnbmVkLW9mZi1ieTogTHVjaWFu
byBDb2VsaG8gPGx1Y2lhbm8uY29lbGhvQGludGVsLmNvbT4NCj4gPiBTaWduZWQtb2ZmLWJ5OiBF
bW1hbnVlbCBHcnVtYmFjaCA8ZW1tYW51ZWwuZ3J1bWJhY2hAaW50ZWwuY29tPg0KPiA+IC0tLQ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b3UgbWlnaHQgZXhwZWN0
IChpLmUuIGZpcnN0IGNhbGwgc3RvcHMgcXVldWVzIGFuZA0KPiBvdmVybGFwcGluZyB2aWYtcXVl
dWUgbWFwcGluZ3MgYXJlIG5vdCBhIGNvbmNlcm4pLiBCdXQNCj4gd2FrZV92aWZfcXVldWVzKCkg
c2VlbXMgdG8gaGF2ZSBsaXR0bGUgcHJhY3RpY2FsIHVzZSB0byBtZSB3aXRob3V0IGFueQ0KPiBr
aW5kIG9mIHBlci1xdWV1ZSByZWZlcmVuY2UgY291bnRpbmcuDQoNClllYWgsIHRoaXMgY291bGQg
YmUgYSBwcm9ibGVtIGZvciB2aWZzIHRoYXQgYXJlIHNoYXJpbmcgdGhlIHNhbWUgcXVldWVzLg0K
QnV0IHRoYXQgY2FzZSB3b3VsZCBiZSByZWFsbHkgdHJpY2t5IHdpdGggY2hhbm5lbC1zd2l0Y2gg
YW55d2F5LiBiZWNhdXNlDQppZiB0aGUgY2hhbm5lbCBvZiBvbmUgdmlmIGlzIGNoYW5nZWQgYnV0
IG5vdCB0aGUgb3RoZXIsIHRoZSBxdWV1ZSB3b3VsZA0KcHJvYmFibHkgaGF2ZSB0byBiZSBzcGxp
dC4uLg0KDQotLQ0KTHVjYS4NCg==
On 5 June 2014 18:26, Emmanuel Grumbach <[email protected]> wrote:
> From: Luciano Coelho <[email protected]>
>
> Instead of stopping all the hardware queues during channel switch,
> which is especially bad when we have large CSA counts, stop only the
> queues that are assigned to the vif that is performing the channel
> switch.
>
> Signed-off-by: Luciano Coelho <[email protected]>
> Signed-off-by: Emmanuel Grumbach <[email protected]>
> ---
> net/mac80211/cfg.c | 10 ++++------
> net/mac80211/iface.c | 5 ++---
> net/mac80211/mlme.c | 20 ++++++++------------
> 3 files changed, 14 insertions(+), 21 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index c6fe358..5215abb 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1142,9 +1142,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
> mutex_lock(&local->mtx);
> sdata->vif.csa_active = false;
> if (!ieee80211_csa_needs_block_tx(local))
> - ieee80211_wake_queues_by_reason(&local->hw,
> - IEEE80211_MAX_QUEUE_MAP,
> - IEEE80211_QUEUE_STOP_REASON_CSA);
> + ieee80211_wake_vif_queues(local, sdata,
> + IEEE80211_QUEUE_STOP_REASON_CSA);
> mutex_unlock(&local->mtx);
>
> kfree(sdata->u.ap.next_beacon);
> @@ -3146,9 +3145,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
> cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
>
> if (!ieee80211_csa_needs_block_tx(local))
> - ieee80211_wake_queues_by_reason(&local->hw,
> - IEEE80211_MAX_QUEUE_MAP,
> - IEEE80211_QUEUE_STOP_REASON_CSA);
> + ieee80211_wake_vif_queues(local, sdata,
> + IEEE80211_QUEUE_STOP_REASON_CSA);
I don't think this is going to work with the upcomming multi-vif
channel switching.
The ieee80211_csa_needs_block_tx() will become false upon *last*
interface switch completion. This means preceeding interface csa
finalizations won't call ieee80211_wake_vif_queues() so you actually
end up not waking all of the queues when you finish csa.
I think this can be solved with:
if (!ieee80211_csa_needs_block_tx(local))
list_for_each(sdata, &local->interfaces, list)
ieee80211_wake_vif_queues(local, sdata, REASON_CSA);
But then I guess it's just a convoluted way of saying:
if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(hw, REASON_CSA);
IOW waking should remain as it was while stopping can be done per-vif.
This goes for all instances calling wake_vif_queues() in the patch.
Generally I don't think having wake_vif_queues() is a good idea. It's
really tricky. Sure, you can have a stop_vif_queues() which will
behave as you might expect (i.e. first call stops queues and
overlapping vif-queue mappings are not a concern). But
wake_vif_queues() seems to have little practical use to me without any
kind of per-queue reference counting.
Michał
T24gRnJpLCAyMDE0LTA2LTA2IGF0IDEwOjEyICswMjAwLCBNaWNoYWwgS2F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