2011-11-27 22:16:05

by Nikolay Martynov

[permalink] [raw]
Subject: [PATCH 0/2] mac80211: use timeout from addba resp

If other side sent us non zero timeout in addba response use it as a
timeout for TX session. Before this patch initiator and recipient
could have different timeouts if recipient decides to change timeout
offered by initiator.
This patchset also adds timeout information into agg_status sysfs file.
This should be applied after patches for "timeout tx agg sessions in
way similar to rx agg sessions".

All comments and suggestions are appreciated.
Thanks.

Nikolay Martynov (2):
mac80211: Use timeout from addba resp
mac80211: add session timeout to agg_status debugfs file

net/mac80211/agg-tx.c | 10 +++++++++-
net/mac80211/debugfs_sta.c | 9 +++++++--
2 files changed, 16 insertions(+), 3 deletions(-)

--
1.7.4.1



2011-11-28 15:54:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 0/2] mac80211: use timeout from addba resp

On Mon, 2011-11-28 at 10:44 -0500, Nikolay Martynov wrote:

> Sorry, about this. I just though that if addba resp contains timeout
> then there should be some use of it. If this goes against standard
> just disregard this patch.

Well, ok, I thought you checked and found we were doing it wrong :)

> BTW, is it possible to download a copy of the standard or is it
> something I need to pay for/subscribe to?

Google for getieee 802.11.

johannes


2011-11-27 22:16:18

by Nikolay Martynov

[permalink] [raw]
Subject: [PATCH 2/2] mac80211: add session timeout to agg_status debugfs file

Add session timeout value for both rx and tx agg sessions to
agg_status debugfs file.

Signed-off-by: Nikolay Martynov <[email protected]>
---
net/mac80211/debugfs_sta.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 2406b3e..c2a0063 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -154,24 +154,29 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n",
sta->ampdu_mlme.dialog_token_allocator + 1);
p += scnprintf(p, sizeof(buf) + buf - p,
- "TID\t\tRX active\tDTKN\tSSN\t\tTX\tDTKN\tpending\n");
+ "TID\t\tRX active\tDTKN\tSSN\ttimeout\t\t"
+ "TX active\tDTKN\tpending\ttimeout\n");

for (i = 0; i < STA_TID_NUM; i++) {
tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[i]);
tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[i]);

p += scnprintf(p, sizeof(buf) + buf - p, "%02d", i);
- p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", !!tid_rx);
+ p += scnprintf(p, sizeof(buf) + buf - p, "\t\t\t%x", !!tid_rx);
p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x",
tid_rx ? tid_rx->dialog_token : 0);
p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x",
tid_rx ? tid_rx->ssn : 0);
+ p += scnprintf(p, sizeof(buf) + buf - p, "\t%d",
+ tid_rx ? tid_rx->timeout : 0);

p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", !!tid_tx);
p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x",
tid_tx ? tid_tx->dialog_token : 0);
p += scnprintf(p, sizeof(buf) + buf - p, "\t%03d",
tid_tx ? skb_queue_len(&tid_tx->pending) : 0);
+ p += scnprintf(p, sizeof(buf) + buf - p, "\t%d",
+ tid_tx ? tid_tx->timeout : 0);
p += scnprintf(p, sizeof(buf) + buf - p, "\n");
}
rcu_read_unlock();
--
1.7.4.1


2011-11-27 22:16:09

by Nikolay Martynov

[permalink] [raw]
Subject: [PATCH 1/2] mac80211: use timeout from addba resp

If other side sent us non zero timeout in addba response use it as a
timeout for TX session.

Signed-off-by: Nikolay Martynov <[email protected]>
---
net/mac80211/agg-tx.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 5eeac6d..e363120 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -761,12 +761,13 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
size_t len)
{
struct tid_ampdu_tx *tid_tx;
- u16 capab, tid;
+ u16 capab, tid, timeout;
u8 buf_size;

capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab);
tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6;
+ timeout = le16_to_cpu(mgmt->u.action.u.addba_resp.timeout);

mutex_lock(&sta->ampdu_mlme.mtx);

@@ -802,6 +803,13 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,

tid_tx->buf_size = buf_size;

+ /*
+ * If other side sent us nonzero timeout - use it,
+ * otherwise stick to our local value.
+ */
+ if(timeout)
+ tid_tx->timeout = timeout;
+
if (test_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state))
ieee80211_agg_tx_operational(local, sta, tid);

--
1.7.4.1


2011-11-28 15:44:40

by Nikolay Martynov

[permalink] [raw]
Subject: Re: [PATCH 0/2] mac80211: use timeout from addba resp

Hi

2011/11/28 Johannes Berg <[email protected]>:
> On Sun, 2011-11-27 at 17:15 -0500, Nikolay Martynov wrote:
>> If other side sent us non zero timeout in addba response use it as a
>> timeout for TX session. Before this patch initiator and recipient
>> could have different timeouts if recipient decides to change timeout
>> offered by initiator.
>
> I'm not convinced this is correct, can you say where the standard says
> that we should take the recipient's timeout? The way I read it, the
> originator informs the recipient of its timeout, not the other way
> around, and we implement that in agg-rx.

Sorry, about this. I just though that if addba resp contains timeout
then there should be some use of it. If this goes against standard
just disregard this patch.
BTW, is it possible to download a copy of the standard or is it
something I need to pay for/subscribe to?
Thanks!


--
Truthfully yours,
Martynov Nikolay.
Email: [email protected]

2011-11-28 08:30:34

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 0/2] mac80211: use timeout from addba resp

On Sun, 2011-11-27 at 17:15 -0500, Nikolay Martynov wrote:
> If other side sent us non zero timeout in addba response use it as a
> timeout for TX session. Before this patch initiator and recipient
> could have different timeouts if recipient decides to change timeout
> offered by initiator.

I'm not convinced this is correct, can you say where the standard says
that we should take the recipient's timeout? The way I read it, the
originator informs the recipient of its timeout, not the other way
around, and we implement that in agg-rx.

johannes