]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
r8169: Implement dynamic ASPM mechanism
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Mon, 11 Oct 2021 04:16:26 +0000 (12:16 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:32:19 +0000 (07:32 +0100)
commit55c779f23679ae11dfc8f37e0bcaefbd721ead95
tree880d9013af3bce3f8561d5548091a101b9a33bd9
parent1151aa9224eb8bee540e306a6ba89a09e638ee94
r8169: Implement dynamic ASPM mechanism

BugLink: https://bugs.launchpad.net/bugs/1946433
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.

The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets per second, and vice versa. The possible reason for
this is likely because the buffer on the chip is too small for its ASPM
exit latency.

Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.

Also introduce a lock to prevent race on accessing config registers.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214307
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
(cherry picked from
https://patchwork.ozlabs.org/project/linux-pci/patch/20211007161552.272771-4-kai.heng.feng@canonical.com/)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/net/ethernet/realtek/r8169_main.c