]> www.infradead.org Git - users/willy/xarray.git/commit
can: m_can: Use tx_fifo_in_flight for netif_queue control
authorMarkus Schneider-Pargmann <msp@baylibre.com>
Wed, 7 Feb 2024 09:32:18 +0000 (10:32 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 12 Feb 2024 16:02:44 +0000 (17:02 +0100)
commit7508a10ca295c635fad9c9f34ac96384d806af89
tree20bbdc27b9b89cceed61ec7450cbce912f462b07
parent1fa80e23c15051edc1c594270517de3517ded798
can: m_can: Use tx_fifo_in_flight for netif_queue control

The network queue is currently always stopped in start_xmit and
continued in the interrupt handler. This is not possible anymore if we
want to keep multiple transmits in flight in parallel.

Use the previously introduced tx_fifo_in_flight counter to control the
network queue instead. This has the benefit of not needing to ask the
hardware about fifo status.

This patch stops the network queue in start_xmit if the number of
transmits in flight reaches the size of the fifo and wakes up the queue
from the interrupt handler once the transmits in flight drops below the
fifo size. This means any skbs over the limit will be rejected
immediately in start_xmit (it shouldn't be possible at all to reach that
state anyways).

The maximum number of transmits in flight is the size of the fifo.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240207093220.2681425-13-msp@baylibre.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c