From: Raju Rangoju Date: Sat, 29 Nov 2025 17:50:16 +0000 (+0530) Subject: amd-xgbe: schedule NAPI on Rx Buffer Unavailable (RBU) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab96af7004c76de5fdca077b1e3732a7ec96f69b;p=thirdparty%2Fkernel%2Flinux.git amd-xgbe: schedule NAPI on Rx Buffer Unavailable (RBU) Under heavy load, Rx Buffer Unavailable (RBU) can occur if Rx processing is slower than network. When an RBU is signaled, try to schedule NAPI to help recover from such situation (including cases where an IRQ may be missed or such) Signed-off-by: Raju Rangoju Link: https://patch.msgid.link/20251129175016.3034185-3-Raju.Rangoju@amd.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index aca1c57554d70..3ddd896d69877 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -410,15 +410,29 @@ static void xgbe_isr_bh_work(struct work_struct *work) * Decide which NAPI to use and whether to schedule: * - When not using per-channel IRQs: schedule on global NAPI * if TI or RI are set. + * - RBU should also trigger NAPI (either per-channel or global) + * to allow refill. */ if (!per_ch_irq && (ti || ri)) schedule_napi = true; + if (rbu) { + schedule_napi = true; + pdata->ext_stats.rx_buffer_unavailable++; + } + napi = per_ch_irq ? &channel->napi : &pdata->napi; if (schedule_napi && napi_schedule_prep(napi)) { /* Disable interrupts appropriately before polling */ - xgbe_disable_rx_tx_ints(pdata); + if (per_ch_irq) { + if (pdata->channel_irq_mode) + xgbe_disable_rx_tx_int(pdata, channel); + else + disable_irq_nosync(channel->dma_irq); + } else { + xgbe_disable_rx_tx_ints(pdata); + } /* Turn on polling */ __napi_schedule(napi); @@ -436,9 +450,6 @@ static void xgbe_isr_bh_work(struct work_struct *work) XGMAC_SET_BITS(dma_ch_isr, DMA_CH_SR, RI, 0); } - if (rbu) - pdata->ext_stats.rx_buffer_unavailable++; - /* Restart the device on a Fatal Bus Error */ if (fbe) schedule_work(&pdata->restart_work);