linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit
@ 2015-09-24 12:59 Felix Fietkau
  2015-09-24 12:59 ` [PATCH 4.3 2/2] mac80211: fix handling of PS filtering with fast-xmit Felix Fietkau
  2015-09-24 14:31 ` [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit Johannes Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Felix Fietkau @ 2015-09-24 12:59 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

When using software queueing, tx sequence number assignment happens at
ieee80211_tx_dequeue time, so the fast-xmit codepath must not do that.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 net/mac80211/tx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 84e0e8c..af058eb 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2767,7 +2767,8 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
 
 	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
 		*ieee80211_get_qos_ctl(hdr) = tid;
-		hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
+		if (!sta->sta.txq[0])
+			hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
 	} else {
 		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
 		hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number);
-- 
2.2.2


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

* [PATCH 4.3 2/2] mac80211: fix handling of PS filtering with fast-xmit
  2015-09-24 12:59 [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit Felix Fietkau
@ 2015-09-24 12:59 ` Felix Fietkau
  2015-09-24 14:29   ` Johannes Berg
  2015-09-24 14:31 ` [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit Johannes Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Felix Fietkau @ 2015-09-24 12:59 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

Fixes dropped packets in the tx path in case a non-PS station triggers
the tx filter.

Cc: stable@vger.kernel.org # 4.2
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 net/mac80211/status.c | 1 +
 net/mac80211/tx.c     | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 8ba5832..3ed7ddf 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -101,6 +101,7 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
 	 * when it wakes up for the next time.
 	 */
 	set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT);
+	ieee80211_clear_fast_xmit(sta);
 
 	/*
 	 * This code races in the following way:
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index af058eb..77a7726 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1218,8 +1218,10 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
 
 	if (!tx->sta)
 		info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
-	else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT))
+	else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) {
 		info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
+		ieee80211_check_fast_xmit(tx->sta);
+	}
 
 	info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
 
@@ -2451,7 +2453,8 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
 
 	if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
 	    test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
-	    test_sta_flag(sta, WLAN_STA_PS_DELIVER))
+	    test_sta_flag(sta, WLAN_STA_PS_DELIVER) ||
+	    test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))
 		goto out;
 
 	if (sdata->noack_map)
-- 
2.2.2


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

* Re: [PATCH 4.3 2/2] mac80211: fix handling of PS filtering with fast-xmit
  2015-09-24 12:59 ` [PATCH 4.3 2/2] mac80211: fix handling of PS filtering with fast-xmit Felix Fietkau
@ 2015-09-24 14:29   ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2015-09-24 14:29 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless

On Thu, 2015-09-24 at 14:59 +0200, Felix Fietkau wrote:
> Fixes dropped packets in the tx path in case a non-PS station 
> triggers
> the tx filter.
> 
Applied, but without the stable tag since no driver in 4.2 that uses
IEEE80211_TX_CTL_CLEAR_PS_FILT also had FAST_XMIT.

johannes

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

* Re: [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit
  2015-09-24 12:59 [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit Felix Fietkau
  2015-09-24 12:59 ` [PATCH 4.3 2/2] mac80211: fix handling of PS filtering with fast-xmit Felix Fietkau
@ 2015-09-24 14:31 ` Johannes Berg
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2015-09-24 14:31 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless

On Thu, 2015-09-24 at 14:59 +0200, Felix Fietkau wrote:
> When using software queueing, tx sequence number assignment happens 
> at
> ieee80211_tx_dequeue time, so the fast-xmit codepath must not do 
> that.
> 
Applied, but to mac80211-next since there's no driver in 4.3 yet that
actually uses ieee80211_tx_dequeue().

johannes

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

end of thread, other threads:[~2015-09-24 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 12:59 [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit Felix Fietkau
2015-09-24 12:59 ` [PATCH 4.3 2/2] mac80211: fix handling of PS filtering with fast-xmit Felix Fietkau
2015-09-24 14:29   ` Johannes Berg
2015-09-24 14:31 ` [PATCH 4.3 1/2] mac80211: fix tx sequence number assignment with software queue + fast-xmit 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).