Skip to content

Commit ab96af7

Browse files
RajuRangojukuba-moo
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c3b744f commit ab96af7

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-drv.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,29 @@ static void xgbe_isr_bh_work(struct work_struct *work)
410410
* Decide which NAPI to use and whether to schedule:
411411
* - When not using per-channel IRQs: schedule on global NAPI
412412
* if TI or RI are set.
413+
* - RBU should also trigger NAPI (either per-channel or global)
414+
* to allow refill.
413415
*/
414416
if (!per_ch_irq && (ti || ri))
415417
schedule_napi = true;
416418

419+
if (rbu) {
420+
schedule_napi = true;
421+
pdata->ext_stats.rx_buffer_unavailable++;
422+
}
423+
417424
napi = per_ch_irq ? &channel->napi : &pdata->napi;
418425

419426
if (schedule_napi && napi_schedule_prep(napi)) {
420427
/* Disable interrupts appropriately before polling */
421-
xgbe_disable_rx_tx_ints(pdata);
428+
if (per_ch_irq) {
429+
if (pdata->channel_irq_mode)
430+
xgbe_disable_rx_tx_int(pdata, channel);
431+
else
432+
disable_irq_nosync(channel->dma_irq);
433+
} else {
434+
xgbe_disable_rx_tx_ints(pdata);
435+
}
422436

423437
/* Turn on polling */
424438
__napi_schedule(napi);
@@ -436,9 +450,6 @@ static void xgbe_isr_bh_work(struct work_struct *work)
436450
XGMAC_SET_BITS(dma_ch_isr, DMA_CH_SR, RI, 0);
437451
}
438452

439-
if (rbu)
440-
pdata->ext_stats.rx_buffer_unavailable++;
441-
442453
/* Restart the device on a Fatal Bus Error */
443454
if (fbe)
444455
schedule_work(&pdata->restart_work);

0 commit comments

Comments
 (0)