Re: [PATCH v5 10/12] can: m_can: Use tx_fifo_in_flight for netif_queue control

From: Simon Horman
Date: Thu Jul 20 2023 - 11:53:56 EST


On Tue, Jul 18, 2023 at 09:57:06AM +0200, Markus Schneider-Pargmann wrote:
> 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@xxxxxxxxxxxx>

Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>