Jeff Geerling Squeezes 4.15Gb/s From a Raspberry Pi Compute Module 4 Using a PCIe Network Card
With a little driver hacking and some experimentation, Geerling has recorded the fastest throughput from any model of Raspberry Pi.
Jeff Geerling has succeeded in pulling over 4Gb/s of data from a Raspberry Pi Compute Module 4, by hooking up a four-port Ethernet card to its PCI Express bus β and the same may well be possible on a modified Raspberry Pi 4, too.
Launched last month, the Raspberry Pi Compute Module 4 takes the core technology found in the popular Raspberry Pi 4 Model B and brings it to a system-on-module (SoM) form factor. The biggest shift from the original design, though, comes with making the USB 3.0 ports optional and replacing them with a fully-functional PCI Express Gen. 2 lane β suitable for all manner of add-on boards, providing you can find suitable drivers for the Arm architecture.
Geerling, like many, took one look at the PCIe port and figured it'd be great for high-speed networking β but took the project a step further than most by hooking the device up to a four-port Intel network card, which combined with the on-board gigabit port gives the Raspberry Pi Compute Module an impressive five gigabit-capable Ethernet ports.
"The card itself is an x4 card, meaning it won't slot into the stock PCIe x1 slot on the Compute Module," Geerling commented while working through the process on his GitHub repository. "I could hack into it with a Dremel, but instead, I bought an x16 to x1 riser/adapter."
Initially, the card failed to properly initialise thanks to a lack of drivers. After some tweaking β "I monkey-patched the igb_main.c
and added #include <linux/ctype.h>
alongside the other includes," Geerling explains - all network interfaces came up. The next stage: Performance testing, which revealed an apparent upper limit of just over 3Gb/s. Further tweaking, including switching to a 64-bit operating system, lifted the ceiling and showcased an impressive aggregate throughput of 4.15Gb.s β the fastest ever recorded from a Raspberry Pi.
"I can confirm the Pi Compute Module 4 can be overclocked to 2.20 GHz, just like the Pi 400. Though it needs better cooling to stay running that fast," Geerling notes. "4.15 Gbps ain't too shabby on a single Pi. I remember back in my early Pi cluster days when I salivated over getting 200-300 Mbps..."
Geerling has written the process up on GitHub, with a supporting video available on YouTube. While his approach centres around the easily-accessible PCI Express lane on the Raspberry Pi Compute Module 4, though, it's in theory also applicable to the Raspberry Pi 4 Model B - if you're willing to desolder the USB 3.0 controller and replace it with a bridge chip to break out the PCIe functionality.