On Tue, Dec 08, 2020 at 04:49:27PM +0100, Tobias Heider wrote:
> Hi,
>
> here is another diff that should fix associating with
> some APs that currently don't work.
>
> If block ack is active and the first frame got lost,
> subsequent packets are held back until a timeout expires.
> When this timeout expires, the gap at the start of the
> reorder buffer is skipped and subsequent frames that are
> sitting in the reorder buffer can be processed.
>
> In order to make this work, flush the reorder buffer
> after skipping the sequence number gap. Without doing this,
> packets in the reorder buffer will remain there until a new
> block ack packet is received.
The last sentence is not quite accurate; we don't need a block ack frame
to advance, any received data frame will do it.
> Found and fix provided by Christian Ehrhardt
>
> ok?
Yes, OK. We had something like this before. I removed that code because
I was not sure whether if_input() from a timeout is safe. But I've since
been told that if_input() from a timeout is indeed safe.
> Index: ieee80211_input.c
> ===================================================================
> RCS file: /cvs/src/sys/net80211/ieee80211_input.c,v
> retrieving revision 1.222
> diff -u -p -r1.222 ieee80211_input.c
> --- ieee80211_input.c 8 Dec 2020 10:28:22 -0000 1.222
> +++ ieee80211_input.c 8 Dec 2020 11:45:44 -0000
> @@ -972,6 +972,11 @@ ieee80211_input_ba_gap_timeout(void *arg
>
> skipped = ieee80211_input_ba_gap_skip(ba);
> ic->ic_stats.is_ht_rx_ba_frame_lost += skipped;
> + if (skipped) {
> + struct mbuf_list ml = MBUF_LIST_INITIALIZER();
> + ieee80211_input_ba_flush(ic, ni, ba, &ml);
> + if_input(&ic->ic_if, &ml);
> + }
>
> splx(s);
> }
>