From: Jakub Kicinski <kuba@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, alexander.duyck@gmail.com,
hkallweit1@gmail.com, andrew@lunn.ch, willemb@google.com,
michael.chan@broadcom.com, jesse.brandeburg@intel.com,
anthony.l.nguyen@intel.com
Subject: Re: [PATCH net-next v3 7/7] net: piggy back on the memory barrier in bql when waking queues
Date: Thu, 6 Apr 2023 17:41:40 -0700 [thread overview]
Message-ID: <20230406174140.36930b15@kernel.org> (raw)
In-Reply-To: <ZC52VRfUOOObx2fw@gondor.apana.org.au>
On Thu, 6 Apr 2023 15:35:49 +0800 Herbert Xu wrote:
> Minor nit, I would write this as
>
> if (IS_ENABLED(CONFIG_BQL))
> netdev_tx_completed_queue(dev_queue, pkts, bytes);
> else if (bytes)
> smp_mb();
Will do!
> Actually, why is this checking bytes while the caller is checking
> pkts? Do we need to check them at all? If pkts/bytes is commonly
> non-zero, then we should just do a barrier unconditionally and make
> the uncommon path pay the penalty.
I wanted to keep the same semantics as netdev_tx_completed_queue()
which only barriers if (bytes). Not in the least to make it obvious
to someone looking at the code of netdev_txq_completed_mb() (and not
the comment above it) that it doesn't _always_ put a barrier in.
next prev parent reply other threads:[~2023-04-07 0:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 22:31 [PATCH net-next v3 0/7] net: lockless stop/wake combo macros Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 1/7] docs: net: reformat driver.rst from a list to sections Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 2/7] docs: net: move the probe and open/close sections of driver.rst up Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 3/7] docs: net: use C syntax highlight in driver.rst Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 4/7] net: provide macros for commonly copied lockless queue stop/wake code Jakub Kicinski
2023-04-06 7:22 ` Herbert Xu
2023-04-05 22:31 ` [PATCH net-next v3 5/7] ixgbe: use new queue try_stop/try_wake macros Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 6/7] bnxt: " Jakub Kicinski
2023-04-05 22:31 ` [PATCH net-next v3 7/7] net: piggy back on the memory barrier in bql when waking queues Jakub Kicinski
2023-04-06 7:35 ` Herbert Xu
2023-04-07 0:41 ` Jakub Kicinski [this message]
2023-04-12 6:06 ` Herbert Xu
2023-04-12 13:54 ` Jakub Kicinski
2023-04-13 2:31 ` Herbert Xu
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=20230406174140.36930b15@kernel.org \
--to=kuba@kernel.org \
--cc=alexander.duyck@gmail.com \
--cc=andrew@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=hkallweit1@gmail.com \
--cc=jesse.brandeburg@intel.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.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).