linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Brivio <stefano.brivio@polimi.it>
To: Mattias Nissler <mattias.nissler@gmx.de>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [RFC/T][PATCH 1/3] rc80211-pid: introduce rate behaviour learning algorithm
Date: Mon, 10 Dec 2007 22:22:13 +0100	[thread overview]
Message-ID: <20071210222213.0cf8ce0d@morte> (raw)
In-Reply-To: <1197319867.7493.4.camel@localhost>

On Mon, 10 Dec 2007 21:51:07 +0100
Mattias Nissler <mattias.nissler@gmx.de> wrote:

> 
> On Mon, 2007-12-10 at 09:08 +0100, Stefano Brivio wrote:
> > On Sun, 09 Dec 2007 23:25:50 +0100
> > Mattias Nissler <mattias.nissler@gmx.de> wrote:
> > 
> > > >  static void *rate_control_pid_alloc(struct ieee80211_local *local)
> > > >  {
> > > >  	struct rc_pid_info *pinfo;
> > > > +	struct rc_pid_rateinfo *rinfo;
> > > > +	struct ieee80211_hw_mode *mode;
> > > > +	int i, j, tmp;
> > > > +	bool s;
> > > >  
> > > >  	pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC);
> > > > +	if (!pinfo)
> > > > +		return NULL;
> > > > +
> > > > +	mode = local->oper_hw_mode;
> > > > +	rinfo = kmalloc(sizeof(*rinfo) * mode->num_rates, GFP_ATOMIC);
> > > > +	if (!rinfo) {
> > > > +		kfree(pinfo);
> > > > +		return NULL;
> > > > +	}
> > > 
> > > What if the mode is changed? Have you checked the rate control algorithm
> > > gets reinitialized? If not, we're scheduling a crash here, when
> > > mode->num_rates changes.
> > 
> > After a discussion on IRC with Michael (Wu), we came to the conclusion that
> > it doesn't make sense for mode->num_rates to change, because:
> > 1) if the AP drops supported rates, it'll drop the association as well,
> > then everything here will be destroyed and created again;
> > 2) that can be changed in userspace, but we couldn't figure out a scenario
> > where it would make any sense. Johannes, any comments? Wouldn't it make
> > sense to just forbid to change this in userspace?
> 
> I don't agree. For example, what if you have some broken 802.11b only
> hardware that you desperately need to get going, but it freaks out on
> 802.11g encoded frames. Now if your AP is hostapd on a Linux machine,
> you'll want to change the mode. Hence, also the number of available
> rates change.

Yes, but the association gets dropped. I'm not sure about the hostapd
implementation (will check), but APs drop association when they change
supported rates. So the per-sta rate control would obviously get reinitialized.
I didn't find anything clear about this in the 802.11 standard, though.

> Moreover, I think we can do better than just disallowing changes to the
> rate set, don't you think?

Well, I still can't find an example of where this would be needed. Your
scenario looks like this:
1) the AP STA periodically advertises supported rates;
2) the non-AP STA supported rates are the intersection (as in set theory)
of the rates supported by the non-AP STA and the rate advertised by the AP
STA (in this case, assuming that the both the non-AP and the AP STAs
support 802.11b and g, rates supported by the non-AP STA are both CCK and
OFDM rates);
3) let's say that a thunderstorm makes the air CCK-hostile, so we want to
reconfigure our AP STA to work with 802.11b only: the association will need
to be recreated (thus the rc algorithm gets reinitialized), and now rates
supported by the non-AP STA are the CCK rates only -> everything works as
expected and wanted.

Anyway, it's not an issue at all to deal with rates changing in
rc80211-pid - I would just need to reallocate a struct and copy over some
data (but please think about this now: OFDM rates are the same for 802.11a
and 802.11g, but it really doesn't make any sense to assume that behaviour
at 2.4GHz is anywhere near to behaviour at 5GHz - so maybe I would just
reallocate the struct and that's it). But before than doing this, I wanted
to be sure that we aren't just hiding a bug in mac80211.


--
Ciao
Stefano

  reply	other threads:[~2007-12-10 21:29 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-09 20:15 [RFC/T][PATCH 0/3] rc80211-pid: PID controller enhancements Stefano Brivio
2007-12-09 20:19 ` [RFC/T][PATCH 1/3] rc80211-pid: introduce rate behaviour learning algorithm Stefano Brivio
2007-12-09 22:25   ` Mattias Nissler
2007-12-09 23:21     ` Stefano Brivio
2007-12-10  0:17       ` Stefano Brivio
2007-12-10  2:24       ` [RFC/T][PATCH v2 " Stefano Brivio
2007-12-10  6:51         ` Mattias Nissler
2007-12-10  7:23           ` Stefano Brivio
2007-12-11 23:29           ` [RFC/T][PATCH v3 " Stefano Brivio
2007-12-12  0:25             ` [RFC/T][PATCH v4 " Stefano Brivio
2007-12-10  6:48       ` [RFC/T][PATCH " Mattias Nissler
2007-12-10  8:03         ` Stefano Brivio
2007-12-10 20:48           ` Mattias Nissler
2007-12-10 20:56           ` Mattias Nissler
2007-12-10 21:30             ` Stefano Brivio
2007-12-10 22:05               ` Mattias Nissler
2007-12-10  8:08     ` Stefano Brivio
2007-12-10 20:51       ` Mattias Nissler
2007-12-10 21:22         ` Stefano Brivio [this message]
2007-12-10 21:31           ` st3
2007-12-10 22:09           ` Mattias Nissler
2007-12-11 14:52         ` Johannes Berg
2007-12-11 17:23           ` Mattias Nissler
2007-12-12 17:13             ` Johannes Berg
2007-12-12 20:06               ` Mattias Nissler
2007-12-12 21:34                 ` Stefano Brivio
2007-12-13 11:42                 ` Johannes Berg
2007-12-14  5:27                   ` Jouni Malinen
2007-12-14 12:09                     ` Johannes Berg
2007-12-13  8:00             ` Holger Schurig
2007-12-11 14:51       ` Johannes Berg
2007-12-09 20:21 ` [RFC/T][PATCH 2/3] rc80211-pid: introduce PID sharpening factor Stefano Brivio
2007-12-09 22:29   ` Mattias Nissler
2007-12-09 23:31     ` Stefano Brivio
2007-12-09 23:53       ` Mattias Nissler
2007-12-10  2:28         ` [RFC/T][PATCH v2 " Stefano Brivio
2007-12-10  6:28           ` Mattias Nissler
2007-12-10  7:21             ` Stefano Brivio
2007-12-10  7:44               ` Mattias Nissler
2007-12-10  8:17                 ` Stefano Brivio
2007-12-11 23:31                 ` [RFC/T][PATCH v3 " Stefano Brivio
2007-12-09 20:28 ` [RFC/T][PATCH 3/3] rc80211-pid: allow for parameters to be set through sysfs Stefano Brivio
2007-12-09 22:30   ` Mattias Nissler
2007-12-10  2:31     ` [RFC/T][PATCH v2 " Stefano Brivio
2007-12-16  9:40   ` [RFC/T][PATCH " Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071210222213.0cf8ce0d@morte \
    --to=stefano.brivio@polimi.it \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mattias.nissler@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).