Re: [PATCH wireless] wifi: mac80211: drop the monitor filter counts on stop, not just sometimes
From: Johannes Berg
Date: Fri Sep 04 2026 - 03:49:59 EST
On Mon, 2026-08-24 at 21:37 -0700, Devin Wittmayer wrote:
> Bringing a monitor up raises the filter counts that track what userspace
> asked to see: frames that failed their checksum, control frames, other-BSS
> traffic. Taking it down again should lower them.
Seems legit, but ...
> The rise happens for every monitor. The fall sits inside the branch that
> retires the virtual monitor, so it is skipped for an active monitor, and
> on any driver setting NO_VIRTUAL_MONITOR. For those, every up and down
> leaves another increment behind.
>
> So once anything has asked to see frames that failed their checksum, the
> hardware keeps handing them up long afterwards, to monitors that never
> asked for them. The other counts accumulate the same way, including the
> one that keeps TX status reporting armed once it has been used.
>
> Changing the flags on a running monitor still balances, so the
> accumulation boils down to the open and stop pair.
>
> Reproduced on mac80211_hwsim: an active monitor brought up and down
> leaves one unmatched increment behind, while a passive monitor on the
> same phy balances.
>
> The two sides matched until cooked monitor support was taken off the
> heat. The decrement got baked into the new conditional along with the
> virtual monitor bookkeeping and never came back out. Move it out again
> so it mirrors the increment.
Ugh. Please rewrite this manually to not just be LLM fluff, to be
something one can actually consume at human speed.
johannes