linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@kernel.org>
To: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: Re: [PATCH 1/2] mac80211: fix overflow issues in airtime fairness code
Date: Sun, 05 Jun 2022 19:18:14 +0200	[thread overview]
Message-ID: <87bkv7owq1.fsf@toke.dk> (raw)
In-Reply-To: <20220603164307.92189-1-nbd@nbd.name>

Felix Fietkau <nbd@nbd.name> writes:

> The airtime weight calculation overflows with a default weight value of 256
> whenever more than 8ms worth of airtime is reported.
> Bigger weight values impose even smaller limits on maximum airtime values.
> This can mess up airtime based calculations for drivers that don't report
> per-PPDU airtime values, but batch up values instead.
>
> Fix this by reordering multiplications/shifts and by reducing unnecessary
> intermediate precision (which was lost in a later stage anyway).
>
> The new shift value limits the maximum weight to 4096, which should be more
> than enough. Any values bigger than that will be clamped to the upper limit.
>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

The weights are UAPI, so I guess we could run into applications that
expect to be able to set a weight higher than 4096? I don't think this
is too likely, but maybe it is better to reject such attempts instead of
silently clamping the value, to flush out any breakage if it does occur?

-Toke

  parent reply	other threads:[~2022-06-05 17:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 16:43 [PATCH 1/2] mac80211: fix overflow issues in airtime fairness code Felix Fietkau
2022-06-03 16:43 ` [PATCH 2/2] mac80211: rework the airtime fairness implementation Felix Fietkau
2022-06-05 17:18   ` Toke Høiland-Jørgensen
2022-06-09 16:02     ` Felix Fietkau
2022-06-10 19:19       ` Toke Høiland-Jørgensen
2022-06-11  7:17         ` Felix Fietkau
2022-06-11 11:15           ` Toke Høiland-Jørgensen
2022-06-11 12:15             ` Felix Fietkau
2022-06-05 17:18 ` Toke Høiland-Jørgensen [this message]
2022-06-09 15:33   ` [PATCH 1/2] mac80211: fix overflow issues in airtime fairness code Felix Fietkau

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=87bkv7owq1.fsf@toke.dk \
    --to=toke@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    /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;
as well as URLs for NNTP newsgroup(s).