[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230406174140.36930b15@kernel.org>
Date: Thu, 6 Apr 2023 17:41:40 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, alexander.duyck@...il.com, hkallweit1@...il.com,
andrew@...n.ch, willemb@...gle.com, michael.chan@...adcom.com,
jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com
Subject: Re: [PATCH net-next v3 7/7] net: piggy back on the memory barrier
in bql when waking queues
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.
Powered by blists - more mailing lists