From: Kan Yan <kyan@google.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org,
make-wifi-fast@lists.bufferbloat.net,
Felix Fietkau <nbd@nbd.name>,
ath10k@lists.infradead.org, Yibo Zhao <yiboz@codeaurora.org>
Subject: Re: [PATCH v3 1/2] mac80211: Implement Airtime-based Queue Limit (AQL)
Date: Thu, 10 Oct 2019 19:24:07 -0700 [thread overview]
Message-ID: <CA+iem5u8p7pDZw-QvqU285p7F5AunN3Z4YyS=TjAd9xbKqegnQ@mail.gmail.com> (raw)
In-Reply-To: <87ftk0jr70.fsf@toke.dk>
> > +/* The per TXQ firmware queue limit in airtime */
>
> I was pretty sure I mentioned it *somewhere*, but I think just calling
> this "device" or something would be more general. If you don't mind, I
> can edit that also (unless you have other reasons to resubmit?)
done. I will upload a new version to fix coding style issues according
to your comment. Please do help
revise comment as you see fit.
> > + * ieee80211_txq_aql_check - check if a txq can send frame to device
> I wonder if this really should even be have "aql" in the name? It's also
> going to return NULL if there's nothing on the TXQ, for example, right?
Renamed to ieee80211_txq_airtime_check()
This function is not for finding next eligible txq, but return a
boolean to indicate if a given txq can send more packets to device. It
is also called from ath10k:
static bool ath10k_mac_tx_can_push(struct ieee80211_hw *hw,
struct ieee80211_txq *txq)
{
...
if (!ieee80211_txq_airtime_check(hw, txq))
return false;
> if (WARN_ONCE(..., "...", ...))
> saves you the braces and the extra condition
done.
> But then again, we don't really care *that* much about overflow or
> underflow in this code path - it's not going to be security critical.
> But it seems that your code there actually can cause UB? That would be
> nice to avoid.
> Actually, that condition can never be true, right? Wait, ok, this one
> can because integer promotion?
I don't think that condition could happen. The WARN_ONCE() was added
per your earlier comment. The older version don't have underflow check
and reset pending_airtime part and I didn't find any issues.
> Except aql_total_pending_airtime is still defined as s32 and that causes
> different behaviour?
> All this confuses me ... is it possible to write this more clearly?
I revised it to something similar to the original version, which
ieee80211_sta_update_pending_airtime() takes extra parameter to
indicate whether it is for a tx completion event.
void ieee80211_sta_update_pending_airtime(struct ieee80211_sta *pubsta, u8 tid,
u32 tx_airtime, bool tx_completed)
This help get rid of the problem that airtime need be signed. Also
added the inline function of
ieee80211_sta_register/release_pending_airtime() as you suggested.
On Thu, Oct 10, 2019 at 1:12 PM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
> Johannes Berg <johannes@sipsolutions.net> writes:
>
> > Hi,
> >
> > A couple of points...
> >
> > First, I'd like Toke to review & ack this if possible :-)
>
> Sure, I'll look at it. I'm away the rest of this week, but should
> hopefully get some more time next week. It may be that it will take the
> form of another submission that integrates this with the previous patch
> I sent that put more of the calculation into mac80211 itself...
>
> -Toke
>
next prev parent reply other threads:[~2019-10-11 2:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 2:25 [PATCH v3 0/2] Implement Airtime-based Queue Limit (AQL) Kan Yan
2019-10-10 2:25 ` [PATCH v3 1/2] mac80211: " Kan Yan
2019-10-10 15:40 ` Johannes Berg
2019-10-10 20:12 ` Toke Høiland-Jørgensen
2019-10-11 2:24 ` Kan Yan [this message]
2019-10-11 8:16 ` Johannes Berg
2019-10-10 2:25 ` [PATCH v3 2/2] ath10k: Enable " Kan Yan
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='CA+iem5u8p7pDZw-QvqU285p7F5AunN3Z4YyS=TjAd9xbKqegnQ@mail.gmail.com' \
--to=kyan@google.com \
--cc=ath10k@lists.infradead.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=make-wifi-fast@lists.bufferbloat.net \
--cc=nbd@nbd.name \
--cc=toke@redhat.com \
--cc=yiboz@codeaurora.org \
/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).