[Make-wifi-fast] [PATCH v11 2/4] mac80211: Import airtime calculation code from mt76

Toke Høiland-Jørgensen toke at redhat.com
Fri Nov 22 07:56:25 EST 2019

Johannes Berg <johannes at sipsolutions.net> writes:

> On Mon, 2019-11-18 at 22:06 -0800, Kan Yan wrote:
>> From: Toke Høiland-Jørgensen <toke at redhat.com>
>> Felix recently added code to calculate airtime of packets to the mt76
>> driver. Import this into mac80211 so we can use it for airtime queue limit
>> calculations.
>> The airtime.c file is copied verbatim from the mt76 driver, and adjusted to
>> be usable in mac80211. This involves:
>> - Switching to mac80211 data structures.
>> - Adding support for 160 MHz channels and HE mode.
>> - Moving the symbol and duration calculations around a bit to avoid
>>   rounding with the higher rates and longer symbol times used for HE rates.
> :)
> I'll apply this, I guess,


> but I do wonder to what extent it overlaps with
> cfg80211_calculate_bitrate()?

Well, one calculates bitrates while the other calculates airtime? ;)

But yeah, I get what you mean. I think Felix went through quite some
pains to structure this code to avoid divisions in the fast path. I
guess that is the main blocker for cfg80211_calculate_bitrate() to be
used instead (assuming we do want to consolidate them eventually). Not
sure if that can be fixed easily though?


More information about the Make-wifi-fast mailing list