Introduction
This article demonstrates how to enable Jumbo Frames (ie. set MTU / packet size to 9000) on the Raspberry Pi 3 or 4. Enabling Jumbo Frames is necessary to unlock the full performance of LUCID cameras, however doing so on a Raspberry Pi involves recompiling the kernel. This article assumes the Raspberry Pi is running a 64-bit OS, which is needed for the ARM 64-bit version of Arena SDK.
Preparation
Install the needed dependencies using the Terminal command:
sudo apt-get install gedit texinfo build-essential libgmp-dev libmpfr-dev libmpc-dev libisl-dev libncurses5-dev bc git-core bison flex
Build and install binutils using the commands:
wget https://ftp.gnu.org/gnu/binutils/binutils-2.34.tar.bz2
tar xf binutils-2.34.tar.bz2
mkdir binutils-obj
cd binutils-obj
../binutils-2.34/configure --prefix=/opt/aarch64 --target=aarch64-linux-gnu --disable-nls
make -j4
sudo make install
cd
To be able to use binutils directly, set the PATH using this command:
export PATH=$PATH:/opt/aarch64/bin/
Build and install gcc using the commands:
wget https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz
tar xf gcc-8.4.0.tar.xz
mkdir gcc-out
cd gcc-out
../gcc-8.4.0/configure --prefix=/opt/aarch64 --target=aarch64-linux-gnu --with-newlib --without-headers \
--disable-nls --disable-shared --disable-threads --disable-libssp --disable-decimal-float \
--disable-libquadmath --disable-libvtv --disable-libgomp --disable-libatomic \
--enable-languages=c
make all-gcc -j4
sudo make install-gcc
cd
Use this command to test if gcc installed correctly:
/opt/aarch64/bin/aarch64-linux-gnu-gcc -v
The output of that command should be similar to:
Download the .tar.gz folder for the latest Raspberry Pi kernel source from: https://github.com/raspberrypi/linux/releases, and save it to the /home/pi directory. As of writing, the latest version is 1.20200902-1.
Extract the folder with the command:
tar xf raspberrypi-kernel_1.20200902-1.tar.gz
Check here: https://github.com/raspberrypi/linux, for the latest branch number of the kernel sources. As of writing, it is 5.4.
Clone and update the sources to the Raspberry Pi using these commands:
git clone --depth=1 -b rpi-5.4.y https://github.com/raspberrypi/linux.git
git pull
Altering the Kernel Source Files
In File Manager, navigate to the directory /home/pi/linux/include/linux/ and open the file if_vlan.h.
In if_vlan.h, change the lines:
#define VLAN_ETH_DATA_LEN 1500 /* Max. octets in payload */
#define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */
to:
#define VLAN_ETH_DATA_LEN 9000 /* Max. octets in payload */
#define VLAN_ETH_FRAME_LEN 9018 /* Max. octets in frame sans FCS */
In File Manager, navigate to the directory /home/pi/linux/include/uapi/linux/ and open the file if_ether.h.
In if_ether.h, change the lines:
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
to:
#define ETH_DATA_LEN 9000 /* Max. octets in payload */
#define ETH_FRAME_LEN 9014 /* Max. octets in frame sans FCS */
In File Manager, navigate to the directory /home/pi/linux/drivers/net/ethernet/broadcom/genet/ and open the file bcmgenet.c.
In bcmgenet.c, change the line:
#define RX_BUF_LENGTH 2048
to:
#define RX_BUF_LENGTH 10240
Configure & Build Kernel for 64-bit Raspberry Pi
In Terminal, run the commands:
cd
mkdir kernel-out
cd linux
If using Raspberry Pi 3, run the command:
make O=../kernel-out/ ARCH=arm64 CROSS_COMPILE=/opt/aarch64/bin/aarch64-linux-gnu- bcmrpi3_defconfig
If using Raspberry Pi 4, run the command:
make O=../kernel-out/ ARCH=arm64 CROSS_COMPILE=/opt/aarch64/bin/aarch64-linux-gnu- bcm2711_defconfig
Finally run this command to build the kernel:
make -j4 O=../kernel-out/ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
Booting 64-bit Kernel
In Terminal, run the following commands:
sudo make O=../kernel-out/ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install dtbs_install
sudo cp ../kernel-out/arch/arm64/boot/Image /boot/kernel8.img
In File Manager, go to the path /boot/dtbs and note the version number. In this case it is 5.4.68-v8+.
Go back to /boot, and open the file config.txt
In config.txt, add the following lines to the end:
#Boot 64-bit kernel
device_tree=dtbs/5.4.68-v8+/broadcom/bcm2710-rpi-3-b.dtb (if using Raspberry Pi 3)
device_tree=dtbs/5.4.68-v8+/broadcom/bcm2711-rpi-4-b.dtb (if using Raspberry Pi 4)
overlay_prefix=dtbs/5.4.68-v8+/overlays/
kernel=kernel8.img
Notice the version number found in the previous step is used in the paths here. Only use one of the “device_tree=…” lines based on the Raspberry Pi model, as mentioned in the parentheses. To go back to default kernel, simply comment out these lines.
Reboot the Raspberry Pi.
To confirm the Raspberry Pi is running the 64-bit kernel, the Terminal command “arch” should give the output “aarch64“, and the Terminal Command “uname -a” should give an output similar to:
Enable Jumbo Frames
In Terminal, set the MTU to 9000 using the command:
sudo ifconfig eth0 mtu 9000
Confirm that eth0 lists its MTU as 9000 using the command:
ifconfig eth0
Jumbo Frames are now enabled on this Raspberry Pi.