Thread (7 messages) 7 messages, 2 authors, 2025-09-26

Re: [PATCH v3 3/3] can: esd_usb: Add watermark handling for TX jobs

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-09-26 19:50:27
Also in: linux-can

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();
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help