]> Gentwo Git Trees - linux/.git/commitdiff
amd-xgbe: schedule NAPI on Rx Buffer Unavailable (RBU)
authorRaju Rangoju <Raju.Rangoju@amd.com>
Sat, 29 Nov 2025 17:50:16 +0000 (23:20 +0530)
committerJakub Kicinski <kuba@kernel.org>
Mon, 1 Dec 2025 22:30:06 +0000 (14:30 -0800)
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 <Raju.Rangoju@amd.com>
Link: https://patch.msgid.link/20251129175016.3034185-3-Raju.Rangoju@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amd/xgbe/xgbe-drv.c

index aca1c57554d709c059a64ffaee71eef50069b920..3ddd896d6987741254ad924ef0febc391c5bae5c 100644 (file)
@@ -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);