mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Evan Severson <eseverson@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] wifi: ath9k: track PS-Poll responses in the BlockAck window
Date: Mon, 19 Oct 2026 23:05:04 +0200	[thread overview]
Message-ID: <87ecdlv1tr.fsf@toke.dk> (raw)
In-Reply-To: <20261014025734.2288693-1-eseverson@gmail.com>

Evan Severson <eseverson@gmail.com> writes:

> ath_tx_setup_buffer() takes a sequence number from the TID for every
> QoS data frame, but a frame only enters the BlockAck window when it
> carries IEEE80211_TX_CTL_AMPDU. Since commit 592234e941f1 ("wifi:
> mac80211: Fix iTXQ AMPDU fragmentation handling"), mac80211 sets that
> flag only when dequeuing from a TXQ. Frames that reach ath_tx_start()
> directly while a session is running, such as PS-Poll responses for a
> dozing station, now use up session sequence numbers without being
> tracked.
>
> Once seq_next is more than baw_size ahead of seq_start, every frame
> the TXQ hands out is outside the window. ath_tx_get_tid_subframe()
> puts it back on the retry queue and returns -EINPROGRESS on every
> attempt, nothing ever moves the window, and the AP stops sending
> unicast data to the station until the session is torn down or the
> station reassociates.
>
> Seen on a QCA9563 AP (OpenWrt) with a station that stayed in power
> save for several seconds under downlink load: the window was empty
> and seq_next was about 2170 ahead of seq_start. With this change, a
> 90 minute run saw a run of more than 3800 such frames and no stall.
>
> Flag unfragmented QoS data frames of an active session as A-MPDU where
> the sequence number is assigned, so they are tracked like any other
> session frame. Fragments stay unflagged, as mac80211 intends. A frame
> from ath_tx_start() cannot wait for the window, so if it is already
> outside it, send it untracked as before rather than set a bit beyond
> the window.
>
> A PS-Poll response is sent on the UAPSD queue, and ath_tx_start() held
> that queue's lock while it took the TID's sequence number. The sequence
> counter and the window belong to the lock of the TID's own queue, which
> the TXQ path holds when it adds to or advances the window, so take that
> lock for the TID work and the UAPSD queue's lock only to hand the frame
> to the hardware, as ath9k_release_buffered_frames() already does.
>
> Fixes: 592234e941f1 ("wifi: mac80211: Fix iTXQ AMPDU fragmentation handling")
> Cc: stable@vger.kernel.org
> Signed-off-by: Evan Severson <eseverson@gmail.com>
> ---
>
> Notes:
>     An alternative would be to restore IEEE80211_TX_CTL_AMPDU on
>     non-fragmented PS-Poll responses in mac80211, which would also cover
>     other drivers that track the BA window in software. Happy to rework it
>     that way if that's preferred.

Johannes, WDYT?

-Toke

      reply	other threads:[~2026-10-19 21:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  2:57 Evan Severson
2026-10-19 21:05 ` Toke Høiland-Jørgensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ecdlv1tr.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=eseverson@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®