The new Realtek 8127 10GbE is working without problem on OpenWrt

Well, recently Realtek has also released it's very low priced 10GbE PCI-E NIC, purchased it from China and it's less than $40.

Tested on my CWWK N100, running OpenWrt 24.10.3, with kmod-r8127-rss and things working pretty smooth.

With the other end connecting to HP Pro desk with Mellanox 10G using RJ45 SFP+, negotiation is quick:

[ 955.164429] r8127: eth2: Link is Up - 10Gbps/Full

Of course this won't be the final working system, because I made a stupid mistake: The Realtek 8127 PCI-E has 2 variants, one is PCI-E v4.0 x1, the other one is PCI-E v3.0x2, I completely forgot that my CWWK N100 has PCI-E v3.0 only and so I got degraded performance (iperf getting < 7Gbps).

However in future I might just get another platform with 2 PCI-E v4.0 slots to plug 2 cards: 1 with SFP+ dual port (uses at least x4/x8 slot), the other one will be this card (then the x1 is useful here) for internet facing (because internet provider only provides ethernet connection, this can avoid using RJ45 SFP+ module)



3 Likes

You can get a quad port 10GbE (not multi gig) on US eBay for less than $25.

But those are PCI-E x8 and hot like hell while running....

2 Likes

Unless you need multi-port and can get away with 10GBe-only, rtl8127 is more sensible in most cases, because it's running much cooler and does support 0.01/0.1/1/2.5/5/10 GBe, which makes it more compatible for contemporary home uses (and the prices are getting attractive, especially if you order from abroad).

"Power consumption – 1.95 Watts" :eyes:

ASPM functioning?

1 Like

Probably current driver doesn't have this, but how to check this capability?

Is the PCIe 3.0 x2 version actually available anywhere?

Please post some alternatives you have reviewed for such platforms! Would be very interested to know what you found. As you pointed out, finding PCIe 10G boards is easy but not really worth it if the underlying platform does not have the bandwidth.

Probably not yet, haven't seen it in China market at the moment.

You are likely right and may have to boot a bleeding edge live usb of linux:

# dmesg | grep ASPM
# lspci -vvv

At idle, you should see C10 power state if ASPM is fully working.

Note 1: "CWWK N100" and other chinese boards may have completely broken ASPM support.
Note 2: Your ethernet appears to be i226 and one of intel's solution to make it work is turning off ASPM.

Alright, I can put it into my HP ProDesk 400G6 PC and check again later.
But I think it's related to driver as well? Looks like the current r8127 driver in OpenWrt is a backport, not sure any ASPM support there.

Manufacturer - BIOS/UEFI must support
PCI slot - connected to chipset, not cpu lanes
Driver - (https://github.com/openwrt/rtl8127) Looks to be latest.
Kernel - 6.15 might be needed?

Your HP should work if that "CWWK" doesn't. Booting fedora rawhide should be enough. Considering how tiny that heatsink is, ASPM might not do much.

(https://www.phoronix.com/news/Linux-6.16-Realtek-RTL8127A)
8127A is already in 6.16.

Here is the lspci -vv from my Linux Mint (kernel 6.14)

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Device 8127 (rev 05)
	Subsystem: Realtek Semiconductor Co., Ltd. Device 0123
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 16
	IOMMU group: 2
	Region 0: I/O ports at 4000 [size=256]
	Region 2: Memory at f1400000 (64-bit, non-prefetchable) [size=256K]
	Region 4: Memory at f1440000 (64-bit, non-prefetchable) [size=16K]
	Expansion ROM at f1460000 [disabled] [size=128K]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [70] Express (v2) Endpoint, MSI 01
		DevCap:	MaxPayload 512 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 75W
		DevCtl:	CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 256 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr+ NonFatalErr- FatalErr- UnsupReq+ AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 16GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
			ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 8GT/s (downgraded), Width x1
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ NROPrPrP- LTR+
			 10BitTagComp+ 10BitTagReq- OBFF Via message/WAKE#, ExtFmt- EETLPPrefix-
			 EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
			 FRS- TPHComp+ ExtTPHComp-
			 AtomicOpsCap: 32bit- 64bit- 128bitCAS-
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR+ 10BitTagReq- OBFF Disabled,
			 AtomicOpsCtl: ReqEn-
		LnkCap2: Supported Link Speeds: 2.5-16GT/s, Crosslink- Retimer+ 2Retimers+ DRS-
		LnkCtl2: Target Link Speed: 16GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance Preset/De-emphasis: -6dB de-emphasis, 0dB preshoot
		LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete+ EqualizationPhase1+
			 EqualizationPhase2+ EqualizationPhase3+ LinkEqualizationRequest-
			 Retimer- 2Retimers- CrosslinkRes: Upstream Port
	Capabilities: [b0] MSI-X: Enable+ Count=64 Masked-
		Vector table: BAR=4 offset=00000000
		PBA: BAR=4 offset=00000800
	Capabilities: [d0] Vital Product Data
pcilib: sysfs_read_vpd: read failed: No such device
		Not readable
	Capabilities: [100 v2] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
		AERCap:	First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
			MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
		HeaderLog: 00000000 00000000 00000000 00000000
	Capabilities: [148 v1] Virtual Channel
		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
		Arb:	Fixed- WRR32- WRR64- WRR128-
		Ctrl:	ArbSelect=Fixed
		Status:	InProgress-
		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
			Status:	NegoPending- InProgress-
	Capabilities: [164 v1] Device Serial Number 01-00-00-00-68-4c-e0-00
	Capabilities: [174 v1] Secondary PCI Express
		LnkCtl3: LnkEquIntrruptEn- PerformEqu-
		LaneErrStat: 0
	Capabilities: [184 v1] Physical Layer 16.0 GT/s <?>
	Capabilities: [1a8 v1] Lane Margining at the Receiver <?>
	Capabilities: [244 v1] Latency Tolerance Reporting
		Max snoop latency: 71680ns
		Max no snoop latency: 71680ns
	Capabilities: [24c v1] L1 PM Substates
		L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
			  PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
		L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
			   T_CommonMode=0us LTR1.2_Threshold=0ns
		L1SubCtl2: T_PwrOn=10us
	Capabilities: [25c v1] Data Link Feature <?>
	Capabilities: [268 v1] Precision Time Measurement
		PTMCap: Requester:+ Responder:- Root:-
		PTMClockGranularity: Unimplemented
		PTMControl: Enabled:- RootSelected:-
		PTMEffectiveGranularity: Unknown
	Capabilities: [274 v1] Vendor Specific Information: ID=0003 Rev=1 Len=054 <?>
	Kernel driver in use: r8127
	Kernel modules: r8127
1 Like
LnkCtl:	ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+

``
L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
			  PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
``
		L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
			   T_CommonMode=0us LTR1.2_Threshold=0ns

Card supports ASPM fully (+), but is not active (-). Fastest way is to just turn on "Native ASPM" or whatever it is called in your BIOS setting. This forces ASPM globally across your entire system.

Or manually set each state from 0 to 1 via:

/sys/bus/pci/drivers/r8127/*\*\*/link/l1_*
l1_1_aspm   l1_1_pcipm  l1_2_aspm   l1_2_pcipm  l1_aspm

You know it worked if everything in "L1SubCtl1" has a + next to it.

OT, but if you want to go down the rabbit hole of getting your entire system to have it on:
lspci -vv | awk '/ASPM/{print $0}' RS= | grep --color -P '(^[a-z0-9:.]+|ASPM )'

1 Like

I actually observed this and went into BIOS, according to the manual of HP my setting should be already enabling that, however from dmesg I see that "ASPM setting not controlled by Linux kernel" which makes me confuse.

BTW, I just wiped my Linux Mint, and installed with Debian Trixie (using 6.16 kernel from backports), I know that since 6.16 the Realtek 8126/8127 both upstream into kernel (so it's different from Linux Mint I have to install vendor driver DKMS module), and I see that both new NICs are absorbed into r8169 driver.

I cannot find this one from my system

That's a weird error. Triple check there aren't multiple places to turn on ASPM.
If OS controls ASPM, dmesg should provide:
[ 10.443179] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]

Fedora rawhide is what I would recommend for testing out bleeding edge hardware/kernels.

My mistake. 6.16 should be in r8169

/sys/bus/pci/drivers/r8169/*/link/

" * " = whatever PCI slot you have e.g.

root@debian:/sys/bus/pci/drivers/r8169/0000:84:00.0/link# ls
clkpm  l1_1_aspm  l1_1_pcipm  l1_2_aspm  l1_2_pcipm  l1_aspm

0 = - (disabled)
1 = + (enabled)

AFAIK, all mediatek drivers still have ASPM disabled by default. When Native ASPM is turned on, the driver will send this to dmesg informing you the default is being overridden by BIOS:

r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control

Yes, I am seeing this exact message in dmesg.

When I tried to install "fwts" tools from snapd, it also told me similar thing that "device has the ASPM capability but currently not in use"

But at least, it's a good sign to us, because hardware is capable to do, then remaining will be just software issue.

I also installed powertop tool and I saw that the system can go to C10 state from output, not sure if that's reflecting the NIC itself.

If you see that, the card (and entire system) should be forced into ASPM. You can try switching to OS control.

# lspci -vv |grep _L1

Get everything above to show "+" everywhere, and you will hit C10 at idle.

rtl8127 supports ASPM. Under OS control, you should at least be able to manually turn it on.