2008-08-06 19:46:02

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] mac80211: fill start-sequence-number for BA session start

Otherwise, drivers are required to keep track of the sequence numbers
themselves, and they really shouldn't be since we already do it for
them. I'll fix the race once we figure out how this code should work
at all, it's currently disabled.

Signed-off-by: Johannes Berg <[email protected]>
---
net/mac80211/ht.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--- everything.orig/net/mac80211/ht.c 2008-08-06 21:40:24.000000000 +0200
+++ everything/net/mac80211/ht.c 2008-08-06 21:43:42.000000000 +0200
@@ -78,7 +78,7 @@ int ieee80211_start_tx_ba_session(struct
struct ieee80211_local *local = hw_to_local(hw);
struct sta_info *sta;
struct ieee80211_sub_if_data *sdata;
- u16 start_seq_num = 0;
+ u16 start_seq_num;
u8 *state;
int ret;
DECLARE_MAC_BUF(mac);
@@ -158,6 +158,9 @@ int ieee80211_start_tx_ba_session(struct
* call back right away, it must see that the flow has begun */
*state |= HT_ADDBA_REQUESTED_MSK;

+ /* This is slightly racy because the queue isn't stopped */
+ start_seq_num = sta->tid_seq[tid];
+
if (local->ops->ampdu_action)
ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_START,
ra, tid, &start_seq_num);




2008-08-06 22:42:15

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fill start-sequence-number for BA session start

On Wed, Aug 6, 2008 at 10:45 PM, Johannes Berg
<[email protected]> wrote:
> Otherwise, drivers are required to keep track of the sequence numbers
> themselves, and they really shouldn't be since we already do it for
> them. I'll fix the race once we figure out how this code should work
> at all, it's currently disabled.
>
> Signed-off-by: Johannes Berg <[email protected]>

Finally I know why nothing works in iwlwifi. This is most crucial
point of correct driver behavior.
There is direct mapping between hw queue indexes and sequence numbers....
This is bad.

> ---
> net/mac80211/ht.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> --- everything.orig/net/mac80211/ht.c 2008-08-06 21:40:24.000000000 +0200
> +++ everything/net/mac80211/ht.c 2008-08-06 21:43:42.000000000 +0200
> @@ -78,7 +78,7 @@ int ieee80211_start_tx_ba_session(struct
> struct ieee80211_local *local = hw_to_local(hw);
> struct sta_info *sta;
> struct ieee80211_sub_if_data *sdata;
> - u16 start_seq_num = 0;
> + u16 start_seq_num;
> u8 *state;
> int ret;
> DECLARE_MAC_BUF(mac);
> @@ -158,6 +158,9 @@ int ieee80211_start_tx_ba_session(struct
> * call back right away, it must see that the flow has begun */
> *state |= HT_ADDBA_REQUESTED_MSK;
>
> + /* This is slightly racy because the queue isn't stopped */
> + start_seq_num = sta->tid_seq[tid];
> +
> if (local->ops->ampdu_action)
> ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_START,
> ra, tid, &start_seq_num);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2008-08-07 06:34:10

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fill start-sequence-number for BA session start

On Thu, 2008-08-07 at 01:42 +0300, Tomas Winkler wrote:
> On Wed, Aug 6, 2008 at 10:45 PM, Johannes Berg
> <[email protected]> wrote:
> > Otherwise, drivers are required to keep track of the sequence numbers
> > themselves, and they really shouldn't be since we already do it for
> > them. I'll fix the race once we figure out how this code should work
> > at all, it's currently disabled.
> >
> > Signed-off-by: Johannes Berg <[email protected]>
>
> Finally I know why nothing works in iwlwifi. This is most crucial
> point of correct driver behavior.
> There is direct mapping between hw queue indexes and sequence numbers....
> This is bad.

Eh, this particular patch has nothing to do with iwlwifi at all because
iwlwifi overrides all sequence numbers anyway.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-08-07 16:45:40

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fill start-sequence-number for BA session start

On Thu, Aug 7, 2008 at 9:33 AM, Johannes Berg <[email protected]> wrote:
> On Thu, 2008-08-07 at 01:42 +0300, Tomas Winkler wrote:
>> On Wed, Aug 6, 2008 at 10:45 PM, Johannes Berg
>> <[email protected]> wrote:
>> > Otherwise, drivers are required to keep track of the sequence numbers
>> > themselves, and they really shouldn't be since we already do it for
>> > them. I'll fix the race once we figure out how this code should work
>> > at all, it's currently disabled.
>> >
>> > Signed-off-by: Johannes Berg <[email protected]>
>>
>> Finally I know why nothing works in iwlwifi. This is most crucial
>> point of correct driver behavior.
>> There is direct mapping between hw queue indexes and sequence numbers....
>> This is bad.
>
> Eh, this particular patch has nothing to do with iwlwifi at all because
> iwlwifi overrides all sequence numbers anyway.

I'm not referring to this patch but to expected behavior that was broken.
Second I'm not sure mac should keep track of sequence numbers. In
theory driver can drop packets in processing
and this may confuse sequence progress. I've already wrote about it...

Tomas

2008-08-07 16:57:15

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fill start-sequence-number for BA session start

On Thu, 2008-08-07 at 19:45 +0300, Tomas Winkler wrote:

> I'm not referring to this patch but to expected behavior that was broken.

Ok.

> Second I'm not sure mac should keep track of sequence numbers. In
> theory driver can drop packets in processing
> and this may confuse sequence progress. I've already wrote about it...

Yeah, and that's why I've taken care to not change anything that would
affect iwlwifi although I'd like to :) But this would make it possible
to have ath9k not use its own sequence numbers if it doesn't drop frames
(and iwlwifi doesn't really drop frames any more anyway, so here's to
hoping you can at some point use the mac80211 provided sequence numbers
too)

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part