From: Felix Fietkau <nbd@openwrt.org>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH 2/2] mac80211: expose txq queue depth and size to drivers
Date: Tue, 26 Jan 2016 13:04:24 +0100 [thread overview]
Message-ID: <56A760C8.3050300@openwrt.org> (raw)
In-Reply-To: <CA+BoTQk+7cpP9jZ8UyUjOrnPc309LdgYN8BbNBfEOyTSUDBcAw@mail.gmail.com>
On 2016-01-26 12:56, Michal Kazior wrote:
> On 26 January 2016 at 11:45, Felix Fietkau <nbd@openwrt.org> wrote:
>> On 2016-01-21 14:23, Michal Kazior wrote:
>>> This will allow drivers to make more educated
>>> decisions whether to defer transmission or not.
>>>
>>> Relying on wake_tx_queue() call count implicitly
>>> was not possible because it could be called
>>> without queued frame count actually changing on
>>> software tx aggregation start/stop code paths.
>>>
>>> It was also not possible to know how long
>>> byte-wise queue was without dequeueing.
>>>
>>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>> Instead of exposing these in the struct to the driver directly, please
>> make a function to get them. Since the number of frames is already
>> tracked in txqi->queue, you can avoid counter duplication that way.
>
> Hmm, so you suggest to have something like:
>
> void
> ieee80211_get_txq_depth(struct ieee80211_txq *txq,
> unsigned int *frame_cnt,
> unsigned int *byte_count) {
> struct txq_info *txqi = txq_to_info(txq);
>
> if (frame_cnt)
> *frame_cnt = txqi->queue.qlen;
>
> if (byte_count)
> *byte_cnt = txqi->byte_cnt;
> }
>
> Correct?
>
> Sounds reasonable.
Right.
>> Also, that way you can fix a race condition between accessing the number
>> of frames counter and the bytes counter.
>
> I don't see a point in maintaining coherency between the two counters
> with regard to each other alone. Do you have a use-case that would
> actually make use of that property?
>
> I'd like to avoid any unnecessary spinlocks.
OK. I guess we can leave them out for now. How frequently are you going
to call this function?
- Felix
next prev parent reply other threads:[~2016-01-26 12:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-21 13:23 [PATCH 1/2] mac80211: fix txq queue related crashes Michal Kazior
2016-01-21 13:23 ` [PATCH 2/2] mac80211: expose txq queue depth and size to drivers Michal Kazior
2016-01-26 10:45 ` Felix Fietkau
2016-01-26 11:56 ` Michal Kazior
2016-01-26 12:04 ` Felix Fietkau [this message]
2016-01-26 12:45 ` Michal Kazior
2016-01-26 12:56 ` Johannes Berg
2016-01-25 17:59 ` [PATCH 1/2] mac80211: fix txq queue related crashes Ben Greear
2016-01-26 6:35 ` Michal Kazior
2016-01-26 15:29 ` Ben Greear
2016-01-26 13:11 ` Johannes Berg
2016-01-27 14:26 ` [PATCH v2] mac80211: expose txq queue depth and size to drivers Michal Kazior
2016-01-27 14:26 ` Johannes Berg
2016-01-27 14:33 ` Michal Kazior
2016-01-27 14:36 ` Johannes Berg
2016-02-02 15:07 ` Johannes Berg
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=56A760C8.3050300@openwrt.org \
--to=nbd@openwrt.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
/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).