Messages in this thread | | | From | Michael Chan <> | Date | Thu, 2 Nov 2023 13:09:38 -0700 | Subject | Re: [PATCH v2 2/2] tg3: Fix the TX ring stall |
| |
On Thu, Nov 2, 2023 at 10:25 AM <alexey.pakhunov@spacex.com> wrote: > > From: Alex Pakhunov <alexey.pakhunov@spacex.com> > > The TX ring maintained by the tg3 driver can end up in the 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. > > 5. The queue is stuck now. tg3_start_xmit() is not called while the queue > is stopped. The NIC is not processing new packets because > tnapi->prodmbox wasn't updated. tg3_tx() is not called by > tg3_poll_work() because the all TX descriptions that could be freed has > been freed: > > /* run TX completion thread */ > if (tnapi->hw_status->idx[0].tx_consumer != tnapi->tx_cons) { > tg3_tx(tnapi); > > 6. Eventually, dev_watchdog() fires triggering a reset of the queue. > > This fix makes sure that the tnapi->prodmbox update happens regardless of > the reason tg3_start_xmit() returned. > > Signed-off-by: Alex Pakhunov <alexey.pakhunov@spacex.com> > Signed-off-by: Vincent Wong <vincent.wong2@spacex.com> > --- > v2: Sort Order the local variables in tg3_start_xmit() in the RCS order > v1: https://lore.kernel.org/netdev/20231101191858.2611154-1-alexey.pakhunov@spacex.com/T/#t > ---
Thanks.
Reviewed-by: Michael Chan <michael.chan@broadcom.com> [unhandled content-type:application/pkcs7-signature] | |