Lets make wifi fast again!
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>, linux-wireless@vger.kernel.org
Cc: make-wifi-fast@lists.bufferbloat.net, Felix Fietkau <nbd@nbd.name>
Subject: Re: [Make-wifi-fast] [RFC v2 1/4] mac80211: Add TXQ scheduling API
Date: Wed, 29 Aug 2018 09:36:07 +0200	[thread overview]
Message-ID: <1535528167.5215.15.camel@sipsolutions.net> (raw)
In-Reply-To: <153115422491.7447.12479559048433925372.stgit@alrua-x1> (sfid-20180709_183719_768645_CF7DCAEC)

Rather belatedly reviewing this too ...

> + * The driver can't access the queue directly. To dequeue a frame from a
> + * txq, it calls ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a
> + * queue, it calls the .wake_tx_queue driver op.
> + *
> + * Drivers can optionally delegate responsibility for scheduling queues to
> + * mac80211, to take advantage of airtime fairness accounting. In this case, to
> + * obtain the next queue to pull frames from, the driver calls
> + * ieee80211_next_txq(). The driver is then expected to re-schedule the txq
> + * using ieee80211_schedule_txq() if it is still active after the driver has
> + * finished pulling packets from it.

Maybe you could clarify what "is still active" means here? I'm guessing
it means "tx_dequeue() would return non-NULL" but I doubt you really
want such a strong requirement, perhaps "the last tx_dequeue() returned
non-NULL" is sufficient?


We're also working on adding a TXQ for (bufferable) management packets -
I wonder how that should interact here? Always be scheduled first?

> +/**
> + * ieee80211_schedule_txq - add txq to scheduling loop
> + *
> + * @hw: pointer as obtained from ieee80211_alloc_hw()
> + * @txq: pointer obtained from station or virtual interface
> + * @reset_seqno: Whether to reset the internal scheduling sequence number,
> + *               allowing this txq to appear again in the current scheduling
> + *               round (see doc for ieee80211_next_txq()).
> + *
> + * Returns %true if the txq was actually added to the scheduling,
> + * %false otherwise.
> + */
> +bool ieee80211_schedule_txq(struct ieee80211_hw *hw,
> +			    struct ieee80211_txq *txq,
> +			    bool reset_seqno);

I concur with Rajkumar in a way that "seqno" is a really bad name for
this since it's so loaded in the context of wifi. He didn't say it this
way, but said it was an "internal to mac80211" concept here, and was
perhaps also/more referring to the manipulations by drivers.

Perhaps calling it something like scheduling_round or something would be
better? That's not really what it is, schedule_id? Even schedule_seq[no]
would be clearer.

> +/**
> + * ieee80211_next_txq - get next tx queue to pull packets from
> + *
> + * @hw: pointer as obtained from ieee80211_alloc_hw()
> + * @ac: filter returned txqs with this AC number. Pass -1 for no filtering.
> + * @inc_seqno: Whether to increase the scheduling sequence number. Setting this
> + *             to true signifies the start of a new scheduling round. Each TXQ
> + *             will only be returned exactly once in each round (unless its
> + *             sequence number is explicitly reset when calling
> + *             ieee80211_schedule_txq()).

Here you already talk about "scheduling sequence number" after all :)

> +	ieee80211_schedule_txq(&local->hw, &txqi->txq, true);
>  	drv_wake_tx_queue(local, txqi);

These always seem to come paired - perhaps a helper is useful?

Although it looks like there are sometimes different locking contexts,
not sure if that's really necessary though.

johannes

  parent reply	other threads:[~2018-08-29  7:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 16:37 [Make-wifi-fast] [RFC v2 0/4] Move TXQ scheduling into mac80211 Toke Høiland-Jørgensen
2018-07-09 16:37 ` [Make-wifi-fast] [RFC v2 1/4] mac80211: Add TXQ scheduling API Toke Høiland-Jørgensen
2018-07-11  0:14   ` Rajkumar Manoharan
2018-07-11 20:48     ` Toke Høiland-Jørgensen
2018-07-12 22:40       ` Rajkumar Manoharan
2018-07-12 23:13         ` Toke Høiland-Jørgensen
2018-07-13  0:33           ` Rajkumar Manoharan
2018-07-13 13:39             ` Toke Høiland-Jørgensen
2018-07-17  1:06               ` Rajkumar Manoharan
2018-07-19 14:18                 ` Toke Høiland-Jørgensen
2018-07-21  1:01                   ` Rajkumar Manoharan
2018-07-21 20:54                     ` Toke Høiland-Jørgensen
2018-07-24  0:42                       ` Rajkumar Manoharan
2018-07-24 11:08                         ` Toke Høiland-Jørgensen
2018-07-30 21:10                           ` Rajkumar Manoharan
2018-07-30 22:48                             ` Toke Høiland-Jørgensen
2018-07-31  0:19                               ` Rajkumar Manoharan
2018-08-29  7:36   ` Johannes Berg [this message]
2018-08-29  9:22     ` Toke Høiland-Jørgensen
2018-08-29  9:24       ` Johannes Berg
2018-08-29 10:09         ` Toke Høiland-Jørgensen
2018-07-09 16:37 ` [Make-wifi-fast] [RFC v2 2/4] mac80211: Add airtime accounting and scheduling to TXQs Toke Høiland-Jørgensen
2018-08-29  7:44   ` Johannes Berg
2018-08-29  9:27     ` Toke Høiland-Jørgensen
2018-08-29 10:14       ` Johannes Berg
2018-08-29 10:33         ` Toke Høiland-Jørgensen
2018-08-29 10:40           ` Johannes Berg
2018-08-29 14:16             ` Toke Høiland-Jørgensen
2018-07-09 16:37 ` [Make-wifi-fast] [RFC v2 4/4] ath9k: Switch to mac80211 TXQ scheduling and airtime APIs Toke Høiland-Jørgensen
2018-07-09 16:37 ` [Make-wifi-fast] [RFC v2 3/4] cfg80211: Add airtime statistics and settings Toke Høiland-Jørgensen

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

  List information: https://lists.bufferbloat.net/postorius/lists/make-wifi-fast.lists.bufferbloat.net/

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

  git send-email \
    --in-reply-to=1535528167.5215.15.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=make-wifi-fast@lists.bufferbloat.net \
    --cc=nbd@nbd.name \
    --cc=toke@toke.dk \
    /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