linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mac80211: changing number of queues in ops->start
@ 2009-04-07 18:24 Michael Buesch
  2009-04-07 19:29 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Buesch @ 2009-04-07 18:24 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, bcm43xx-dev

I'm wondering how to implement QoS capability runtime detection
in a mac80211 driver.

In b43 we don't know at ieee80211_register time whether the firmware does
support QoS or not, because it's not loaded yet. (Reasons for not loading
it that early are issues with builtin-b43, etc...).
So we don't know whether we are going to load opensource fw (no QoS) or
proprietary fw (QoS capable).
But it seems that mac80211 requires to set hw->queues before ieee80211_register.

So what I'd need is a way to change the number of possible queues from within
the ops->start handler.

Any ideas?

-- 
Greetings, Michael.

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

* Re: mac80211: changing number of queues in ops->start
  2009-04-07 18:24 mac80211: changing number of queues in ops->start Michael Buesch
@ 2009-04-07 19:29 ` Johannes Berg
  2009-04-07 19:33   ` Michael Buesch
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2009-04-07 19:29 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless, bcm43xx-dev

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

On Tue, 2009-04-07 at 20:24 +0200, Michael Buesch wrote:
> I'm wondering how to implement QoS capability runtime detection
> in a mac80211 driver.
> 
> In b43 we don't know at ieee80211_register time whether the firmware does
> support QoS or not, because it's not loaded yet. (Reasons for not loading
> it that early are issues with builtin-b43, etc...).
> So we don't know whether we are going to load opensource fw (no QoS) or
> proprietary fw (QoS capable).
> But it seems that mac80211 requires to set hw->queues before ieee80211_register.
> 
> So what I'd need is a way to change the number of possible queues from within
> the ops->start handler.

Well, I suppose you could register with the max and later reduce and
stop the remaining queues you're not using... Or not stop them and drop
packets on them. That's somewhat fragile, gives people who look at tc a
wrong idea, and I can't imagine supporting it, but it should work.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: mac80211: changing number of queues in ops->start
  2009-04-07 19:29 ` Johannes Berg
@ 2009-04-07 19:33   ` Michael Buesch
  2009-04-07 19:37     ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Buesch @ 2009-04-07 19:33 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, bcm43xx-dev

On Tuesday 07 April 2009 21:29:27 Johannes Berg wrote:
> On Tue, 2009-04-07 at 20:24 +0200, Michael Buesch wrote:
> > I'm wondering how to implement QoS capability runtime detection
> > in a mac80211 driver.
> > 
> > In b43 we don't know at ieee80211_register time whether the firmware does
> > support QoS or not, because it's not loaded yet. (Reasons for not loading
> > it that early are issues with builtin-b43, etc...).
> > So we don't know whether we are going to load opensource fw (no QoS) or
> > proprietary fw (QoS capable).
> > But it seems that mac80211 requires to set hw->queues before ieee80211_register.
> > 
> > So what I'd need is a way to change the number of possible queues from within
> > the ops->start handler.
> 
> Well, I suppose you could register with the max and later reduce and
> stop the remaining queues you're not using... Or not stop them and drop
> packets on them. That's somewhat fragile, gives people who look at tc a
> wrong idea, and I can't imagine supporting it, but it should work.

mkay, I'll try this. thanks :)

I wonder, however, will mac80211 try to queue packets on queues that are stopped?
And I think just dropping them is not an option, because this will cause breakage.

What about just queueing everything on a single queue, no matter what queue mac80211
puts the frame into? Would this cause ordering issues?
Or the other way around, is there anything that _depends_ on the higher priority queues
to get sent before the higher priority queues?

-- 
Greetings, Michael.

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

* Re: mac80211: changing number of queues in ops->start
  2009-04-07 19:33   ` Michael Buesch
@ 2009-04-07 19:37     ` Johannes Berg
  2009-04-07 19:40       ` Michael Buesch
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2009-04-07 19:37 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless, bcm43xx-dev

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

On Tue, 2009-04-07 at 21:33 +0200, Michael Buesch wrote:

> > Well, I suppose you could register with the max and later reduce and
> > stop the remaining queues you're not using... Or not stop them and drop
> > packets on them. That's somewhat fragile, gives people who look at tc a
> > wrong idea, and I can't imagine supporting it, but it should work.
> 
> mkay, I'll try this. thanks :)
> 
> I wonder, however, will mac80211 try to queue packets on queues that are stopped?
> And I think just dropping them is not an option, because this will cause breakage.
> 
> What about just queueing everything on a single queue, no matter what queue mac80211
> puts the frame into? Would this cause ordering issues?
> Or the other way around, is there anything that _depends_ on the higher priority queues
> to get sent before the higher priority queues?

mac80211 won't try to select a queue higher than hw->queues at
select_queue time, so it shouldn't try to put packets onto that queue,
look in wme.c.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: mac80211: changing number of queues in ops->start
  2009-04-07 19:37     ` Johannes Berg
@ 2009-04-07 19:40       ` Michael Buesch
  2009-04-07 19:46         ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Buesch @ 2009-04-07 19:40 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, bcm43xx-dev

On Tuesday 07 April 2009 21:37:58 Johannes Berg wrote:
> On Tue, 2009-04-07 at 21:33 +0200, Michael Buesch wrote:
> 
> > > Well, I suppose you could register with the max and later reduce and
> > > stop the remaining queues you're not using... Or not stop them and drop
> > > packets on them. That's somewhat fragile, gives people who look at tc a
> > > wrong idea, and I can't imagine supporting it, but it should work.
> > 
> > mkay, I'll try this. thanks :)
> > 
> > I wonder, however, will mac80211 try to queue packets on queues that are stopped?
> > And I think just dropping them is not an option, because this will cause breakage.
> > 
> > What about just queueing everything on a single queue, no matter what queue mac80211
> > puts the frame into? Would this cause ordering issues?
> > Or the other way around, is there anything that _depends_ on the higher priority queues
> > to get sent before the higher priority queues?
> 
> mac80211 won't try to select a queue higher than hw->queues at
> select_queue time, so it shouldn't try to put packets onto that queue,
> look in wme.c.

Ok I see. So you say it's OK to lower hw->queues after ieee80211_register.
Should I reset hw->queues back to the value ieee80211_register was called with, before
I call unregister/free? Are there resources allocated by the number of queues?

-- 
Greetings, Michael.

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

* Re: mac80211: changing number of queues in ops->start
  2009-04-07 19:40       ` Michael Buesch
@ 2009-04-07 19:46         ` Johannes Berg
  2009-04-07 19:51           ` Michael Buesch
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2009-04-07 19:46 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless, bcm43xx-dev

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

On Tue, 2009-04-07 at 21:40 +0200, Michael Buesch wrote:

> Ok I see. So you say it's OK to lower hw->queues after ieee80211_register.

Let's say it's acceptable ;)

> Should I reset hw->queues back to the value ieee80211_register was called with, before
> I call unregister/free? Are there resources allocated by the number of queues?

There are resources allocated, notably the qdiscs etc. in
alloc_ether_mq() or whatever it's called in register_hw(). But the
networking core should keep track of those so it shouldn't matter what
the value is. OTOH if it can switch back and forth the pending packets
are done per queue... for example ieee80211_clear_tx_pending will be
called at unregister times, so if it's possible to be up with 4 queues,
and later be up with 1, you will want to unregister with 4.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: mac80211: changing number of queues in ops->start
  2009-04-07 19:46         ` Johannes Berg
@ 2009-04-07 19:51           ` Michael Buesch
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Buesch @ 2009-04-07 19:51 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, bcm43xx-dev

On Tuesday 07 April 2009 21:46:29 Johannes Berg wrote:
> On Tue, 2009-04-07 at 21:40 +0200, Michael Buesch wrote:
> 
> > Ok I see. So you say it's OK to lower hw->queues after ieee80211_register.
> 
> Let's say it's acceptable ;)
> 
> > Should I reset hw->queues back to the value ieee80211_register was called with, before
> > I call unregister/free? Are there resources allocated by the number of queues?
> 
> There are resources allocated, notably the qdiscs etc. in
> alloc_ether_mq() or whatever it's called in register_hw(). But the
> networking core should keep track of those so it shouldn't matter what
> the value is. OTOH if it can switch back and forth the pending packets
> are done per queue... for example ieee80211_clear_tx_pending will be
> called at unregister times, so if it's possible to be up with 4 queues,
> and later be up with 1, you will want to unregister with 4.

Ok, sounds like a huge hack to me. :) I'll think about it.

-- 
Greetings, Michael.

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

end of thread, other threads:[~2009-04-07 19:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-07 18:24 mac80211: changing number of queues in ops->start Michael Buesch
2009-04-07 19:29 ` Johannes Berg
2009-04-07 19:33   ` Michael Buesch
2009-04-07 19:37     ` Johannes Berg
2009-04-07 19:40       ` Michael Buesch
2009-04-07 19:46         ` Johannes Berg
2009-04-07 19:51           ` Michael Buesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).