2009-07-22 19:23:48

by Gao Lei

[permalink] [raw]
Subject: [PATCH] compat-wireless-old: Fix problem with TX on amd64

On amd64, the `ieee80211_tx_info' struct takes 56 bytes, thus cannot fit
into skb's control buffer.

The very first result is that nothing can be really sent out, because
skb's next member `len' also gets cleared when doing:

info = IEEE80211_SKB_CB(skb);
memset(info, 0, sizeof(*info));

A quick fix may be removing the TX control's sta pointer, since IMHO
it's rarely used for now (the only place that I found was a function
assigning values to it).

It has been working well for me so far, but please let me know if
there're better solutions. Thanks!

Best regards,
Gao Lei


diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e3adf99..b9a5ae7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -331,7 +331,6 @@ struct ieee80211_tx_info {
struct {
struct ieee80211_vif *vif;
struct ieee80211_key_conf *hw_key;
- struct ieee80211_sta *sta;
unsigned long jiffies;
int ifindex;
u16 aid;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 7d1b32c..ee0ed32 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -540,9 +540,6 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)

sband = tx->local->hw.wiphy->bands[tx->channel->band];

- if (tx->sta)
- info->control.sta = &tx->sta->sta;
-
if (!info->control.retry_limit) {
if (!is_multicast_ether_addr(hdr->addr1)) {
int len = min_t(int, tx->skb->len + FCS_LEN,
@@ -620,9 +617,6 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
info->control.rts_cts_rate_idx = 0;
}

- if (tx->sta)
- info->control.sta = &tx->sta->sta;
-
return TX_CONTINUE;
}




2009-07-23 19:04:09

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless-old: Fix problem with TX on amd64

On Thu, Jul 23, 2009 at 11:54 AM, Gao Lei<[email protected]> wrote:
> On Wed, 2009-07-22 at 12:30 -0700, Luis R. Rodriguez wrote:
>> On Wed, Jul 22, 2009 at 12:23 PM, Gao Lei wrote:
>> > On amd64, the `ieee80211_tx_info' struct takes 56 bytes, thus cannot fit
>> > into skb's control buffer.
>>
>> Thanks, what kernel is this against BTW? Just so you know we should be
>> able to bring down compat-wireless down to 2.6.21 and maybe even
>> further now that we no longer are using the master netdev, which used
>> the multiqueue support added as of 2.6.27. Last I checked
>> compat-wireless now compiles on 2.6.25, but I never actually tried
>> loading it as I'm on ext4. So if you are on 2.6.25 or 2.6.26 you may
>> want to try out compat-wireless directly and see if to works. If you
>> are on 2.6.21..2.6.24 you can try adding backport support. I've added
>> a few files already for older kernel support based on our old
>> compat-wireless-old effort, so only the new stuff that mac80211 makes
>> use of should require backporting.
>>
>>   Luis
>
> Hi,
>
> I am using kernel 2.6.26. Just tested compat-wireless and yes it works!
> Here the TX info struct takes exactly 48 bytes so it can fit well into
> the control buffer.
>
> Btw, I came up with the 'iwlagn: Unknown symbol iwl4965_agn_cfg' issue
> though (actually also in compat-wireless-old). Strange as it seems
> there're already some treatments there. Will look at it later.

May be a real issue. You can try wireless-testing directly and see if
it happens there.

> While it's great to see compat-wireless working for more old kernels, I
> wonder if compat-wireless-old is still actively maintained?

Well sure its maintained, its just deprecated now as we can backport
compat-wireless. The issue we had with compat-wireless-old is lack of
interest from developers to support it as no one cared for old drivers
and that old kernels.

> Asking this
> because currently most of the documentations still describe it as
> 'compat-wireless-old for <= 2.6.26 and compat-wireless for >= 2.6.27',
> and I was probably not the only amd64 user reading that. :)

Well so a few things:

1) We hadn't announced compat-wireless was available for older kernels
now. This was really because we had no testers.
2) you are the first to report success with 2.6.26 so that's a plus,
so now you can go ahead and update the documentation (its a wiki after
all) to mention this
3) If someone reports success with 2.6.25 then we bring the
documentation down to 2.6.25 and so on

Luis

2009-07-23 18:56:47

by Gao Lei

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless-old: Fix problem with TX on amd64

On Wed, 2009-07-22 at 12:30 -0700, Luis R. Rodriguez wrote:
> On Wed, Jul 22, 2009 at 12:23 PM, Gao Lei wrote:
> > On amd64, the `ieee80211_tx_info' struct takes 56 bytes, thus cannot fit
> > into skb's control buffer.
>
> Thanks, what kernel is this against BTW? Just so you know we should be
> able to bring down compat-wireless down to 2.6.21 and maybe even
> further now that we no longer are using the master netdev, which used
> the multiqueue support added as of 2.6.27. Last I checked
> compat-wireless now compiles on 2.6.25, but I never actually tried
> loading it as I'm on ext4. So if you are on 2.6.25 or 2.6.26 you may
> want to try out compat-wireless directly and see if to works. If you
> are on 2.6.21..2.6.24 you can try adding backport support. I've added
> a few files already for older kernel support based on our old
> compat-wireless-old effort, so only the new stuff that mac80211 makes
> use of should require backporting.
>
> Luis

Hi,

I am using kernel 2.6.26. Just tested compat-wireless and yes it works!
Here the TX info struct takes exactly 48 bytes so it can fit well into
the control buffer.

Btw, I came up with the 'iwlagn: Unknown symbol iwl4965_agn_cfg' issue
though (actually also in compat-wireless-old). Strange as it seems
there're already some treatments there. Will look at it later.

While it's great to see compat-wireless working for more old kernels, I
wonder if compat-wireless-old is still actively maintained? Asking this
because currently most of the documentations still describe it as
'compat-wireless-old for <= 2.6.26 and compat-wireless for >= 2.6.27',
and I was probably not the only amd64 user reading that. :)

Best regards,
Gao Lei


2009-07-22 19:30:44

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless-old: Fix problem with TX on amd64

On Wed, Jul 22, 2009 at 12:23 PM, Gao Lei<[email protected]> wrote:
> On amd64, the `ieee80211_tx_info' struct takes 56 bytes, thus cannot fit
> into skb's control buffer.
>
> The very first result is that nothing can be really sent out, because
> skb's next member `len' also gets cleared when doing:
>
>        info = IEEE80211_SKB_CB(skb);
>        memset(info, 0, sizeof(*info));
>
> A quick fix may be removing the TX control's sta pointer, since IMHO
> it's rarely used for now (the only place that I found was a function
> assigning values to it).
>
> It has been working well for me so far, but please let me know if
> there're better solutions. Thanks!
>
> Best regards,
> Gao Lei

Thanks, what kernel is this against BTW? Just so you know we should be
able to bring down compat-wireless down to 2.6.21 and maybe even
further now that we no longer are using the master netdev, which used
the multiqueue support added as of 2.6.27. Last I checked
compat-wireless now compiles on 2.6.25, but I never actually tried
loading it as I'm on ext4. So if you are on 2.6.25 or 2.6.26 you may
want to try out compat-wireless directly and see if to works. If you
are on 2.6.21..2.6.24 you can try adding backport support. I've added
a few files already for older kernel support based on our old
compat-wireless-old effort, so only the new stuff that mac80211 makes
use of should require backporting.

Luis