[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250926125026.49f20992@kernel.org>
Date: Fri, 26 Sep 2025 12:50:26 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Stefan Mätje <stefan.maetje@....eu>
Cc: "mailhol@...nel.org" <mailhol@...nel.org>, "socketcan@...tkopp.net"
<socketcan@...tkopp.net>, "davem@...emloft.net" <davem@...emloft.net>,
"wg@...ndegger.com" <wg@...ndegger.com>, "linux-can@...r.kernel.org"
<linux-can@...r.kernel.org>, socketcan <socketcan@....eu>, Frank Jungclaus
<frank.jungclaus@....eu>, "mkl@...gutronix.de" <mkl@...gutronix.de>,
"horms@...nel.org" <horms@...nel.org>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] can: esd_usb: Add watermark handling for TX jobs
On Fri, 26 Sep 2025 01:35:07 +0000 Stefan Mätje wrote:
> Using the netif_txq_maybe_stop() / netif_txq_completed_wake() pair seem
> not the right thing for me because I don't understand the code completely
> and the netif_txq_completed_wake() should only called from NAPI poll
> context where I would need to call it from the USB callback handler
> possibly on IRQ level.
Ah, true, not NAPI, but you don't use BQL so we'd need a flavor of
the macro that doesn't picky back on the mb() in BQL.
The main point of the macro is that on one side you need to re-check
after a barrier. No matter how many barriers you put in place you
can still have:
CPU 0 CPU 1
used++
if (used > threshold)
/* long IRQ comes */
used--
if (used <= threshold)
wake();
/* long IRQ ends */
stop();
Powered by blists - more mailing lists