From: Johannes Berg <johannes@sipsolutions.net>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>, jjohnson@kernel.org
Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] wifi: mac80211: add ieee80211_tx_peek API
Date: Tue, 21 Jul 2026 18:28:07 +0200 [thread overview]
Message-ID: <c913114343692dd201da3af8f05fe1bc356702a8.camel@sipsolutions.net> (raw)
In-Reply-To: <20260720070852.206495-2-jtornosm@redhat.com>
On Mon, 2026-07-20 at 09:08 +0200, Jose Ignacio Tornos Martinez wrote:
>
> +const struct sk_buff *ieee80211_tx_peek(struct ieee80211_hw *hw,
> + struct ieee80211_txq *txq)
While it makes some sense, I don't think I like the way you've
implemented this.
First, it basically does a lot of the work twice, say if it has to walk
a lot of flows to find the SKB.
Second, the work that it does is almost entirely disjoint from
ieee80211_tx_dequeue(). The latter doesn't even fill the hash (and not
all drivers might care), although I'm not even sure it's _needed_ to do
skb_get_hash() there, seems like this fairly obviously happens *after*
ieee80211_select_queue() or ieee80211_select_queue_80211(). So maybe
this isn't strictly more work than what dequeue() would do, because it's
a nop anyway.
Also though it does a LOT less work, although it pretends that the SKB
is fully formed, at least it makes no representations otherwise, and
that's obviously not true. Most things in the ieee80211_tx_info are not
filled in, kind of randomly by where and when mac80211 decided to do
that (which isn't really random, of course, but might as well be random
to the driver). As such, it seems only useful in a very limited subset
of cases.
Third, it documents that the skb will be returned by a subsequent
ieee80211_tx_dequeue() call, but that's obviously not true - the next
such call might not return anything at all, even for quite a while if
queues are stopped etc. which isn't considered in peek(), and I'm not
even convinced that it must ever be returned, if something else happened
in the meantime while such a situation occurred (queues stopped). Even
ieee80211_tx_dequeue() itself can drop SKBs entirely.
As such I'm not even convinced that there's a guarantee that after the
skb peek you even have done the work you claim to have done, if a
different skb is returned from dequeue() instead of this one.
I think I sort of understand the motivation, but it feels like you need
to go back to the drawing board. Maybe even further back, and perhaps
ath11k/ath12k just shouldn't use the hash of the SKB itself, but
something else that can be derived without the SKB hash?
If that's not feasible then this probably needs to be turned upside
down; perhaps there's some way to dequeue it anyway and hold it
somewhere for later (though that has issues with all the pointers in the
skb->cb), I don't have a good idea though.
johannes
next prev parent reply other threads:[~2026-07-21 16:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 7:08 [PATCH v3 0/3] wifi: ath11k/ath12k: implement TX flow control Jose Ignacio Tornos Martinez
2026-07-20 7:08 ` [PATCH v3 1/3] wifi: mac80211: add ieee80211_tx_peek API Jose Ignacio Tornos Martinez
2026-07-21 16:28 ` Johannes Berg [this message]
2026-07-22 17:11 ` Jose Ignacio Tornos Martinez
2026-07-20 7:08 ` [PATCH v3 2/3] wifi: ath11k: implement custom wake_tx_queue with flow control Jose Ignacio Tornos Martinez
2026-07-20 7:08 ` [PATCH v3 3/3] wifi: ath12k: " Jose Ignacio Tornos Martinez
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=c913114343692dd201da3af8f05fe1bc356702a8.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ath11k@lists.infradead.org \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=jtornosm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.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
all inboxes | Powered by JetHome®