Uncategorized

Check your driver! Faster Linux 2.5G Networking with Realtek RTL8125B

Since the Raspberry Pi Compute Module 4 was introduced last year, I’ve been testing a variety of PCI Express NICs with it. One of the main types of NIC I’m interested in is cheap 2.5 Gigabit Ethernet adapters.

2.5 Gigabits is about the highest reasonable bandwidth you can get through the PCI Express Gen 2.0 x1 lane on the Raspberry Pi, and it’s also a lot more accessible than 10 Gigabit networking, especially for home users who might already have Cat5e runs that they are loathe to swap out for Cat6 or better cabling.

In my testing, besides discovering that not all 10 Gbps SFP+ transceivers are created equal, I found out that when it comes to performance, the Linux driver you’re using matters—a lot.

And as a stark illustration of this point, I recently pitted an ASUSTOR Drivestor 4 Pro NAS against a Raspberry Pi ‘Taco’ NAS. Both of these devices use the popular Realtek RTL8125B chip, and both of them were reporting underwhelming iperf3 bandwidth results:

iperf3 bandwidth - kernel driver

The maximum throughput was eerily similar, just under 1.9 Gbps. And worse, I noticed when using devices through a PCI Express switch on the Pi, like a SATA RAID array, the network throughput took a hit, down to 1.51 Gbps on the Pi.

I wondered if the driver might’ve seen some improvements in later revisions of the Linux kernel, so I recompiled the kernel using the 5.15.x source:

menuconfig - Realtek 2.5G network driver in Linux kernel source tree

That made no difference—in fact, the results started to have more jitter in them, so I decided that avenue wasn’t worth pursuing further.

So next, I downloaded the driver directly from Realtek’s website, and installed version 9.007.01:

$ sudo apt-get install -y raspberrypi-kernel-headers
$ tar vjxf r8125-9.007.01.tar.bz2
$ cd r8125-9.007.01/
$ sudo ./autorun.sh

I re-ran my benchmarks, and wouldn’t you know? I’m able to get the full 2.35 Gbps of real-world throughput through the card—regardless of other traffic on the PCIe bus!

iperf3 bandwidth - realtek driver

So the moral of the story seems to be: if you’re not seeing the performance you expect, see if the vendor’s driver is better than what’s in the kernel tree.

Many vendors take an upstream-first approach, where they make sure any driver optimizations make their way to the kernel quickly… but not all. I’m not sure how the discrepancy is so big, though, in this case. It looks like 8125B support was only added a year and a half ago, and only a few chip-specific commits have been added since.

I have to wonder if maybe since far fewer Linux users have 2.5G-capable networks, these kinds of performance issues aren’t discussed as much?

I confirmed with ASUSTOR that their current Drivestor 4 Pro software is running the driver from the kernel, and not the Realtek vendor driver. No word yet on if that could change—but if so, it may be able to unlock more performance from their value-lineup of 2.5G NASes!

For all my debugging details, check out my GitHub issue NAS Comparison – ASUSTOR Drivestor 4 Pro vs Pi CM4.

Load more 1501
Load more 1502
Load more 1503
Load more 1504
Load more 1505
Load more 1506
Load more 1507
Load more 1508
Load more 1509
Load more 1510
Load more 1511
Load more 1512
Load more 1513
Load more 1514
Load more 1515
Load more 1516
Load more 1517
Load more 1518
Load more 1519
Load more 1520
Load more 1521
Load more 1522
Load more 1523
Load more 1524
Load more 1525
Load more 1526
Load more 1527
Load more 1528
Load more 1529
Load more 1530
Load more 1531
Load more 1532
Load more 1533
Load more 1534
Load more 1535
Load more 1536
Load more 1537
Load more 1538
Load more 1539
Load more 1540
Load more 1541
Load more 1542
Load more 1543
Load more 1544
Load more 1545
Load more 1546
Load more 1547
Load more 1548
Load more 1549
Load more 1550
Load more 1551
Load more 1552
Load more 1553
Load more 1554
Load more 1555
Load more 1556
Load more 1557
Load more 1558
Load more 1559
Load more 1560
Load more 1561
Load more 1562
Load more 1563
Load more 1564
Load more 1565
Load more 1566
Load more 1567
Load more 1568
Load more 1569
Load more 1570
Load more 1571
Load more 1572
Load more 1573
Load more 1574
Load more 1575
Load more 1576
Load more 1577
Load more 1578
Load more 1579
Load more 1580
Load more 1581
Load more 1582
Load more 1583
Load more 1584
Load more 1585
Load more 1586
Load more 1587
Load more 1588
Load more 1589
Load more 1590
Load more 1591
Load more 1592
Load more 1593
Load more 1594
Load more 1595
Load more 1596
Load more 1597
Load more 1598
Load more 1599
Load more 1600
Load more 1601
Load more 1602
Load more 1603
Load more 1604
Load more 1605
Load more 1606
Load more 1607
Load more 1608
Load more 1609
Load more 1610
Load more 1611
Load more 1612
Load more 1613
Load more 1614
Load more 1615
Load more 1616
Load more 1617
Load more 1618
Load more 1619
Load more 1620
Load more 1621
Load more 1622
Load more 1623
Load more 1624
Load more 1625
Load more 1626
Load more 1627
Load more 1628
Load more 1629
Load more 1630
Load more 1631
Load more 1632
Load more 1633
Load more 1634
Load more 1635
Load more 1636
Load more 1637
Load more 1638
Load more 1639
Load more 1640
Load more 1641
Load more 1642
Load more 1643
Load more 1644
Load more 1645
Load more 1646
Load more 1647
Load more 1648
Load more 1649
Load more 1650
Load more 1651
Load more 1652
Load more 1653
Load more 1654
Load more 1655
Load more 1656
Load more 1657
Load more 1658
Load more 1659
Load more 1660
Load more 1661
Load more 1662
Load more 1663
Load more 1664
Load more 1665
Load more 1666
Load more 1667
Load more 1668
Load more 1669
Load more 1670
Load more 1671
Load more 1672
Load more 1673
Load more 1674
Load more 1675
Load more 1676
Load more 1677
Load more 1678
Load more 1679
Load more 1680
Load more 1681
Load more 1682
Load more 1683
Load more 1684
Load more 1685
Load more 1686
Load more 1687
Load more 1688
Load more 1689
Load more 1690
Load more 1691
Load more 1692
Load more 1693
Load more 1694
Load more 1695
Load more 1696
Load more 1697
Load more 1698
Load more 1699
Load more 1700
Load more 1701
Load more 1702
Load more 1703
Load more 1704
Load more 1705
Load more 1706
Load more 1707
Load more 1708
Load more 1709
Load more 1710
Load more 1711
Load more 1712
Load more 1713
Load more 1714
Load more 1715
Load more 1716
Load more 1717
Load more 1718
Load more 1719
Load more 1720
Load more 1721
Load more 1722
Load more 1723
Load more 1724
Load more 1725
Load more 1726
Load more 1727
Load more 1728
Load more 1729
Load more 1730
Load more 1731
Load more 1732
Load more 1733
Load more 1734
Load more 1735
Load more 1736
Load more 1737
Load more 1738
Load more 1739
Load more 1740
Load more 1741
Load more 1742
Load more 1743
Load more 1744
Load more 1745
Load more 1746
Load more 1747
Load more 1748
Load more 1749
Load more 1750
Load more 1751
Load more 1752
Load more 1753
Load more 1754
Load more 1755
Load more 1756
Load more 1757
Load more 1758
Load more 1759
Load more 1760
Load more 1761
Load more 1762
Load more 1763
Load more 1764
Load more 1765
Load more 1766
Load more 1767
Load more 1768
Load more 1769
Load more 1770
Load more 1771
Load more 1772
Load more 1773
Load more 1774
Load more 1775
Load more 1776
Load more 1777
Load more 1778
Load more 1779
Load more 1780
Load more 1781
Load more 1782
Load more 1783
Load more 1784
Load more 1785
Load more 1786
Load more 1787
Load more 1788
Load more 1789
Load more 1790
Load more 1791
Load more 1792
Load more 1793
Load more 1794
Load more 1795
Load more 1796
Load more 1797
Load more 1798
Load more 1799
Load more 1800
Load more 1801
Load more 1802
Load more 1803
Load more 1804
Load more 1805
Load more 1806
Load more 1807
Load more 1808
Load more 1809
Load more 1810
Load more 1811
Load more 1812
Load more 1813
Load more 1814
Load more 1815
Load more 1816
Load more 1817
Load more 1818
Load more 1819
Load more 1820
Load more 1821
Load more 1822
Load more 1823
Load more 1824
Load more 1825
Load more 1826
Load more 1827
Load more 1828
Load more 1829
Load more 1830
Load more 1831
Load more 1832
Load more 1833
Load more 1834
Load more 1835
Load more 1836
Load more 1837
Load more 1838
Load more 1839
Load more 1840
Load more 1841
Load more 1842
Load more 1843
Load more 1844
Load more 1845
Load more 1846
Load more 1847
Load more 1848
Load more 1849
Load more 1850
Load more 1851
Load more 1852
Load more 1853
Load more 1854
Load more 1855
Load more 1856
Load more 1857
Load more 1858
Load more 1859
Load more 1860
Load more 1861
Load more 1862
Load more 1863
Load more 1864
Load more 1865
Load more 1866
Load more 1867
Load more 1868
Load more 1869
Load more 1870
Load more 1871
Load more 1872
Load more 1873
Load more 1874
Load more 1875
Load more 1876
Load more 1877
Load more 1878
Load more 1879
Load more 1880
Load more 1881
Load more 1882
Load more 1883
Load more 1884
Load more 1885
Load more 1886
Load more 1887
Load more 1888
Load more 1889
Load more 1890
Load more 1891
Load more 1892
Load more 1893
Load more 1894
Load more 1895
Load more 1896
Load more 1897
Load more 1898
Load more 1899
Load more 1900
Load more 1901
Load more 1902
Load more 1903
Load more 1904
Load more 1905
Load more 1906
Load more 1907
Load more 1908
Load more 1909
Load more 1910
Load more 1911
Load more 1912
Load more 1913
Load more 1914
Load more 1915
Load more 1916
Load more 1917
Load more 1918
Load more 1919
Load more 1920
Load more 1921
Load more 1922
Load more 1923
Load more 1924
Load more 1925
Load more 1926
Load more 1927
Load more 1928
Load more 1929
Load more 1930
Load more 1931
Load more 1932
Load more 1933
Load more 1934
Load more 1935
Load more 1936
Load more 1937
Load more 1938
Load more 1939
Load more 1940
Load more 1941
Load more 1942
Load more 1943
Load more 1944
Load more 1945
Load more 1946
Load more 1947
Load more 1948
Load more 1949
Load more 1950
Load more 1951
Load more 1952
Load more 1953
Load more 1954
Load more 1955
Load more 1956
Load more 1957
Load more 1958
Load more 1959
Load more 1960
Load more 1961
Load more 1962
Load more 1963
Load more 1964
Load more 1965
Load more 1966
Load more 1967
Load more 1968
Load more 1969
Load more 1970
Load more 1971
Load more 1972
Load more 1973
Load more 1974
Load more 1975
Load more 1976
Load more 1977
Load more 1978
Load more 1979
Load more 1980
Load more 1981
Load more 1982
Load more 1983
Load more 1984
Load more 1985
Load more 1986
Load more 1987
Load more 1988
Load more 1989
Load more 1990
Load more 1991
Load more 1992
Load more 1993
Load more 1994
Load more 1995
Load more 1996
Load more 1997
Load more 1998
Load more 1999
Load more 2000

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button