Skip to content

Commit 4b0768b

Browse files
ChunHao Linkuba-moo
authored andcommitted
r8169: fix rtl8125b PAUSE frames blasting when suspended
When FIFO reaches near full state, device will issue pause frame. If pause slot is enabled(set to 1), in this time, device will issue pause frame only once. But if pause slot is disabled(set to 0), device will keep sending pause frames until FIFO reaches near empty state. When pause slot is disabled, if there is no one to handle receive packets, device FIFO will reach near full state and keep sending pause frames. That will impact entire local area network. This issue can be reproduced in Chromebox (not Chromebook) in developer mode running a test image (and v5.10 kernel): 1) ping -f $CHROMEBOX (from workstation on same local network) 2) run "powerd_dbus_suspend" from command line on the $CHROMEBOX 3) ping $ROUTER (wait until ping fails from workstation) Takes about ~20-30 seconds after step 2 for the local network to stop working. Fix this issue by enabling pause slot to only send pause frame once when FIFO reaches near full state. Fixes: f1bce4a ("r8169: add support for RTL8125") Reported-by: Grant Grundler <[email protected]> Tested-by: Grant Grundler <[email protected]> Cc: [email protected] Signed-off-by: ChunHao Lin <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Heiner Kallweit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6c89f49 commit 4b0768b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ enum rtl_registers {
196196
/* No threshold before first PCI xfer */
197197
#define RX_FIFO_THRESH (7 << RXCFG_FIFO_SHIFT)
198198
#define RX_EARLY_OFF (1 << 11)
199+
#define RX_PAUSE_SLOT_ON (1 << 11) /* 8125b and later */
199200
#define RXCFG_DMA_SHIFT 8
200201
/* Unlimited maximum PCI burst. */
201202
#define RX_DMA_BURST (7 << RXCFG_DMA_SHIFT)
@@ -2306,9 +2307,13 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
23062307
case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_53:
23072308
RTL_W32(tp, RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF);
23082309
break;
2309-
case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_63:
2310+
case RTL_GIGA_MAC_VER_61:
23102311
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
23112312
break;
2313+
case RTL_GIGA_MAC_VER_63:
2314+
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
2315+
RX_PAUSE_SLOT_ON);
2316+
break;
23122317
default:
23132318
RTL_W32(tp, RxConfig, RX128_INT_EN | RX_DMA_BURST);
23142319
break;

0 commit comments

Comments
 (0)