Skip to content

Commit 21b5f67

Browse files
hkallweitdavem330
authored andcommitted
r8169: fix performance regression related to PCIe max read request size
It turned out that on low performance systems the original change can cause lower tx performance. On a N3450-based mini-PC tx performance in iperf3 was reduced from 950Mbps to ~900Mbps. Therefore effectively revert the original change, just use pcie_set_readrq() now instead of changing the PCIe capability register directly. Fixes: 2df49d3 ("r8169: remove fiddling with the PCIe max read request size") Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7a02ea6 commit 21b5f67

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,15 +2477,18 @@ static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)
24772477
switch (tp->mac_version) {
24782478
case RTL_GIGA_MAC_VER_12:
24792479
case RTL_GIGA_MAC_VER_17:
2480+
pcie_set_readrq(tp->pci_dev, 512);
24802481
r8168b_1_hw_jumbo_enable(tp);
24812482
break;
24822483
case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26:
2484+
pcie_set_readrq(tp->pci_dev, 512);
24832485
r8168c_hw_jumbo_enable(tp);
24842486
break;
24852487
case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28:
24862488
r8168dp_hw_jumbo_enable(tp);
24872489
break;
24882490
case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33:
2491+
pcie_set_readrq(tp->pci_dev, 512);
24892492
r8168e_hw_jumbo_enable(tp);
24902493
break;
24912494
default:
@@ -2515,6 +2518,9 @@ static void rtl_hw_jumbo_disable(struct rtl8169_private *tp)
25152518
break;
25162519
}
25172520
rtl_lock_config_regs(tp);
2521+
2522+
if (pci_is_pcie(tp->pci_dev) && tp->supports_gmii)
2523+
pcie_set_readrq(tp->pci_dev, 4096);
25182524
}
25192525

25202526
static void rtl_jumbo_config(struct rtl8169_private *tp, int mtu)

0 commit comments

Comments
 (0)