linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue
@ 2016-11-04  9:27 Felix Fietkau
  2016-11-04  9:27 ` [PATCH 2/3] mac80211: remove bogus skb vif assignment Felix Fietkau
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Felix Fietkau @ 2016-11-04  9:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: toke, johannes

The sequence number counter is used to derive the starting sequence
number. Since that counter is updated on tx dequeue, the A-MPDU flag
needs to be up to date at the tme of dequeue as well.

This patch prevents sending more A-MPDU frames after the session has
been terminated and also ensures that aggregation starts right after the
session has been established

Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/tx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 62ccaf6..c380e85 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3451,6 +3451,11 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
 		goto begin;
 	}
 
+	if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags))
+		info->flags |= IEEE80211_TX_CTL_AMPDU;
+	else
+		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+
 	if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
 		struct sta_info *sta = container_of(txq->sta, struct sta_info,
 						    sta);
-- 
2.10.1

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

* [PATCH 2/3] mac80211: remove bogus skb vif assignment
  2016-11-04  9:27 [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Felix Fietkau
@ 2016-11-04  9:27 ` Felix Fietkau
  2016-11-04 11:47   ` Toke Høiland-Jørgensen
  2016-11-04  9:27 ` [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq Felix Fietkau
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Felix Fietkau @ 2016-11-04  9:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: toke, johannes

The call to ieee80211_txq_enqueue overwrites the vif pointer with the
codel enqueue time, so setting it just before that call makes no sense.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/tx.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c380e85..390b425 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1500,7 +1500,6 @@ static bool ieee80211_queue_skb(struct ieee80211_local *local,
 				struct sta_info *sta,
 				struct sk_buff *skb)
 {
-	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct fq *fq = &local->fq;
 	struct ieee80211_vif *vif;
 	struct txq_info *txqi;
@@ -1525,8 +1524,6 @@ static bool ieee80211_queue_skb(struct ieee80211_local *local,
 	if (!txqi)
 		return false;
 
-	info->control.vif = vif;
-
 	spin_lock_bh(&fq->lock);
 	ieee80211_txq_enqueue(local, txqi, skb);
 	spin_unlock_bh(&fq->lock);
-- 
2.10.1

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

* [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq
  2016-11-04  9:27 [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Felix Fietkau
  2016-11-04  9:27 ` [PATCH 2/3] mac80211: remove bogus skb vif assignment Felix Fietkau
@ 2016-11-04  9:27 ` Felix Fietkau
  2016-11-04 11:49   ` Toke Høiland-Jørgensen
  2016-11-04 11:46 ` [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Toke Høiland-Jørgensen
  2016-11-15 13:38 ` Johannes Berg
  3 siblings, 1 reply; 7+ messages in thread
From: Felix Fietkau @ 2016-11-04  9:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: toke, johannes

A-MSDU aggregation alters the QoS header after a frame has been
enqueued, so it needs to be ready before enqueue and not overwritten
again afterwards

Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/tx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 390b425..2c21b70 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3235,7 +3235,6 @@ static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
 
 	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
 		tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
-		*ieee80211_get_qos_ctl(hdr) = tid;
 		hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
 	} else {
 		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
@@ -3360,6 +3359,11 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
 		      (tid_tx ? IEEE80211_TX_CTL_AMPDU : 0);
 	info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
 
+	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
+		tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+		*ieee80211_get_qos_ctl(hdr) = tid;
+	}
+
 	__skb_queue_head_init(&tx.skbs);
 
 	tx.flags = IEEE80211_TX_UNICAST;
-- 
2.10.1

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

* Re: [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue
  2016-11-04  9:27 [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Felix Fietkau
  2016-11-04  9:27 ` [PATCH 2/3] mac80211: remove bogus skb vif assignment Felix Fietkau
  2016-11-04  9:27 ` [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq Felix Fietkau
@ 2016-11-04 11:46 ` Toke Høiland-Jørgensen
  2016-11-15 13:38 ` Johannes Berg
  3 siblings, 0 replies; 7+ messages in thread
From: Toke Høiland-Jørgensen @ 2016-11-04 11:46 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, johannes

Felix Fietkau <nbd@nbd.name> writes:

> The sequence number counter is used to derive the starting sequence
> number. Since that counter is updated on tx dequeue, the A-MPDU flag
> needs to be up to date at the tme of dequeue as well.
>
> This patch prevents sending more A-MPDU frames after the session has
> been terminated and also ensures that aggregation starts right after the
> session has been established

Makes sense. Suppose there's no reason why the session couldn't be
started/ended while packets were queued.

Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk>

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

* Re: [PATCH 2/3] mac80211: remove bogus skb vif assignment
  2016-11-04  9:27 ` [PATCH 2/3] mac80211: remove bogus skb vif assignment Felix Fietkau
@ 2016-11-04 11:47   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 7+ messages in thread
From: Toke Høiland-Jørgensen @ 2016-11-04 11:47 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, johannes

Felix Fietkau <nbd@nbd.name> writes:

> The call to ieee80211_txq_enqueue overwrites the vif pointer with the
> codel enqueue time, so setting it just before that call makes no
> sense.

Yeah, I think this was leftover from earlier version when the flow was
different. Or maybe I just missed it...

Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk>

-Toke

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

* Re: [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq
  2016-11-04  9:27 ` [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq Felix Fietkau
@ 2016-11-04 11:49   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 7+ messages in thread
From: Toke Høiland-Jørgensen @ 2016-11-04 11:49 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, johannes

Felix Fietkau <nbd@nbd.name> writes:

> A-MSDU aggregation alters the QoS header after a frame has been
> enqueued, so it needs to be ready before enqueue and not overwritten
> again afterwards

Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk>

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

* Re: [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue
  2016-11-04  9:27 [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Felix Fietkau
                   ` (2 preceding siblings ...)
  2016-11-04 11:46 ` [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Toke Høiland-Jørgensen
@ 2016-11-15 13:38 ` Johannes Berg
  3 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2016-11-15 13:38 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless; +Cc: toke

All three applied, thanks.

johannes

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

end of thread, other threads:[~2016-11-15 13:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04  9:27 [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Felix Fietkau
2016-11-04  9:27 ` [PATCH 2/3] mac80211: remove bogus skb vif assignment Felix Fietkau
2016-11-04 11:47   ` Toke Høiland-Jørgensen
2016-11-04  9:27 ` [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq Felix Fietkau
2016-11-04 11:49   ` Toke Høiland-Jørgensen
2016-11-04 11:46 ` [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue Toke Høiland-Jørgensen
2016-11-15 13:38 ` Johannes Berg

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).