Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] igc: permanent Tx queue deadlock in igc_clean_tx_irq() [1]
--

commit c5dcfb32c435e778dcb0ad6b827b371a99667e5b
Author: Steffen Dirkwinkel <[email protected]>

igc: let dev_watchdog reset the adapter after a Tx hang

This commit checks whether a Tx subqueue is already stopped before
stopping it upon detecting a Tx unit hang in igc_clean_tx_irq(), so
repeated hang reports do not keep resetting trans_start and preventing
dev_watchdog() from resetting the adapter.

> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index 1fb5f3cbe93c5..a2d383f79a29d 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -3281,8 +3281,15 @@ static bool igc_clean_tx_irq(struct igc_q_vector 
> *q_vector, int napi_budget)
>                                  tx_buffer->next_to_watch,
>                                  jiffies,
>                                  tx_buffer->next_to_watch->wb.status);
> -                     netif_stop_subqueue(tx_ring->netdev,
> -                                         tx_ring->queue_index);
> +                     /* The hang is reported again on every watchdog run,
> +                      * but stop the queue only once: stopping it again
> +                      * would also restart the Tx timeout, so dev_watchdog()
> +                      * would never reset the adapter.
> +                      */
> +                     if (!__netif_subqueue_stopped(tx_ring->netdev,
> +                                                   tx_ring->queue_index))
> +                             netif_stop_subqueue(tx_ring->netdev,
> +                                                 tx_ring->queue_index);
>  
>                       /* we are about to reset, no point in enabling stuff */
>                       return true;

[Severity: High]
This problem wasn't introduced by this patch, but can a stopped Tx
subqueue remain permanently stalled in igc_clean_tx_irq() [1] when
CONFIG_MAX_SKB_FRAGS is large (such as 45 for BIG TCP) and the ring is
sized to IGC_MIN_TXD (64)?

A couple of lines below this hunk, igc_clean_tx_irq() only wakes a stopped
subqueue when igc_desc_unused(tx_ring) reaches TX_WAKE_THRESHOLD:

drivers/net/ethernet/intel/igc/igc_main.c:igc_clean_tx_irq() {
        ...
#define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
        if (unlikely(total_packets &&
                     netif_carrier_ok(tx_ring->netdev) &&
                     igc_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD)) {
        ...
}

Because DESC_NEEDED is (MAX_SKB_FRAGS + 4), CONFIG_MAX_SKB_FRAGS=45 makes
TX_WAKE_THRESHOLD 98, while igc_desc_unused() on a 64-descriptor ring is at
most 63.  Once igc_maybe_stop_tx() stops the queue, the wake condition can
never be satisfied and the queue stays stopped until a Tx watchdog timeout.

[1] https://sashiko.dev/#/bug/linux-8616c413-3d5c-4d57-9eda-b2849ebf6eb4

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=4

Reply via email to