lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 1 Nov 2023 14:08:00 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: alexey.pakhunov@...cex.com
Cc: siva.kallam@...adcom.com, vincent.wong2@...cex.com, netdev@...r.kernel.org, 
	linux-kernel@...r.kernel.org, prashant@...adcom.com, mchan@...adcom.com
Subject: Re: [PATCH 2/2] tg3: Fix the TX ring stall

On Wed, Nov 1, 2023 at 12:19 PM <alexey.pakhunov@...cex.com> wrote:
>
> From: Alex Pakhunov <alexey.pakhunov@...cex.com>
>
> The TX ring maintained by the tg3 driver can end up in a state, when it
> has packets queued for sending but the NIC hardware is not informed, so no
> progress is made. This leads to a multi-second interruption in network
> traffic followed by dev_watchdog() firing and resetting the queue.
>
> The specific sequence of steps is:
>
> 1. tg3_start_xmit() is called at least once and queues packet(s) without
>    updating tnapi->prodmbox (netdev_xmit_more() returns true)
> 2. tg3_start_xmit() is called with an SKB which causes tg3_tso_bug() to be
>    called.
> 3. tg3_tso_bug() determines that the SKB is too large, ...
>
>         if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {
>
>    ... stops the queue, and returns NETDEV_TX_BUSY:
>
>         netif_tx_stop_queue(txq);
>         ...
>         if (tg3_tx_avail(tnapi) <= frag_cnt_est)
>                 return NETDEV_TX_BUSY;
>
> 4. Since all tg3_tso_bug() call sites directly return, the code updating
>    tnapi->prodmbox is skipped.

Thanks for the patch.  An alternative fix that may be simpler is to
add a goto after calling tg3_tso_bug().  Something like this:

        tg3_tso_bug();
        goto update_tx_mbox;
...

update_tx_mbox:
        if (!netdev_xmit_more() || netif_xmit_stopped())
                tw32_tx_mbox();
...

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ