<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Luke Robinson</title>
    <description>The latest articles on Forem by Luke Robinson (@lkrbnsn).</description>
    <link>https://forem.com/lkrbnsn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3742016%2F916bac28-0d17-4276-a1b7-54aadce153bb.jpeg</url>
      <title>Forem: Luke Robinson</title>
      <link>https://forem.com/lkrbnsn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lkrbnsn"/>
    <language>en</language>
    <item>
      <title>Running DPDK on a Raspberry Pi</title>
      <dc:creator>Luke Robinson</dc:creator>
      <pubDate>Wed, 18 Feb 2026 14:01:18 +0000</pubDate>
      <link>https://forem.com/lkrbnsn/running-dpdk-on-a-raspberry-pi-5721</link>
      <guid>https://forem.com/lkrbnsn/running-dpdk-on-a-raspberry-pi-5721</guid>
      <description>&lt;p&gt;In this post, I'm going to show you how to install DPDK on a Raspberry Pi. DPDK (Data Plane Development Kit) is a set of libraries and drivers designed to enable fast packet processing, typically by bypassing the kernel and interfacing directly with the network card. It's often used as a base for building tools like software defined networking functions, traffic generators and packet inspectors, usually running on enterprise grade servers. While the hardware capabilities of the Raspberry Pi are fairly limited, it's an interesting exercise to see that it can also run DPDK.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;First of all, you'll need a suitable Raspberry Pi board. It needs to be a 64-bit model in order to support hugepages, so any of the newer ones should work. In this tutorial I use a Raspberry Pi 4.&lt;br&gt;
You'll also need a host machine running Linux to cross-compile a new kernel for the RPI. You could probably do it on the RPI itself if you want an extra challenge, but it takes a lot longer to do it this way.&lt;br&gt;
Finally, you'll need all the peripherals to set up a Raspberry Pi such as screen, keyboard, power supply, SD card adapter etc. I don't recommend running this fully headless, as to run DPDK you'll want to mess around with networking drivers and it's good to have another way into it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Building DPDK on the Raspberry Pi
&lt;/h2&gt;

&lt;p&gt;This is relatively easy step, everything works pretty much out of the box.&lt;br&gt;
Get the DPDK source code by going to &lt;a href="https://core.dpdk.org/download/" rel="noopener noreferrer"&gt;https://core.dpdk.org/download/&lt;/a&gt; and pulling the latest version with wget and extracting the tarball.&lt;br&gt;
The Meson build system should already be installed on your RPI, but we need to install a few other dependencies:&lt;br&gt;
&lt;code&gt;sudo apt install python3-pyelftools&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo apt install libnuma-dev&lt;/code&gt;&lt;br&gt;
Build and install DPDK:&lt;br&gt;
&lt;code&gt;meson build&lt;/code&gt;&lt;br&gt;
&lt;code&gt;ninja -C build&lt;/code&gt;&lt;br&gt;
&lt;code&gt;cd build&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo meson install&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo ldconfig&lt;/code&gt;&lt;br&gt;
You're now ready to build whatever apps you want. To build the example app:&lt;br&gt;
&lt;code&gt;cd examples/helloworld&lt;/code&gt;&lt;br&gt;
&lt;code&gt;make&lt;/code&gt;&lt;br&gt;
The built app is now in examples/helloworld and you can try running it:&lt;br&gt;
&lt;code&gt;cd build&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo ./helloworld -l 0-3 -n 4&lt;/code&gt;&lt;br&gt;
At this stage you'll probably run into a hugepage error, which brings us to the next step of the tutorial.&lt;/p&gt;
&lt;h2&gt;
  
  
  Enabling hugepages on the Raspberry Pi
&lt;/h2&gt;

&lt;p&gt;64-bit RPIs support hugepages, but they aren't enabled by default. To enable them you'll have to recompile the RPI kernel with hugepages enabled in the config. This isn't a difficult process, but it takes a little while. Below is a quick guide on how I got hugepages working on my setup, but refer to the &lt;a href="https://www.raspberrypi.com/documentation/computers/linux_kernel.html" rel="noopener noreferrer"&gt;official site&lt;/a&gt; for more information on compiling a custom RPI kernel.&lt;br&gt;
First you need to get the kernel source code:&lt;br&gt;
&lt;code&gt;git clone --depth=1 https://github.com/raspberrypi/linux&lt;/code&gt;&lt;br&gt;
Move to the kernel directory and set up:&lt;br&gt;
&lt;code&gt;cd linux&lt;/code&gt;&lt;br&gt;
&lt;code&gt;KERNEL=kernel8-hp&lt;/code&gt;&lt;br&gt;
Set up the config for 64-bit RPIs&lt;br&gt;
&lt;code&gt;make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig&lt;/code&gt;&lt;br&gt;
Run menuconfig and enable hugepages through File systems -&amp;gt; Pseudo file systems -&amp;gt; HugeTLB file system support&lt;br&gt;
&lt;code&gt;make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig&lt;/code&gt;&lt;br&gt;
Compile the kernel - this may take a few hours, depending on the speed of your machine.&lt;br&gt;
&lt;code&gt;make -j 4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs&lt;/code&gt;&lt;br&gt;
Insert your RPI SD card in the host machine and mount both partitions. Note that /dev/sdb1 and sdb2 may be different for you, use lsblk to check the naming.&lt;br&gt;
&lt;code&gt;mkdir mnt&lt;/code&gt;&lt;br&gt;
&lt;code&gt;mkdir mnt/fat32&lt;/code&gt;&lt;br&gt;
&lt;code&gt;mkdir mnt/ext4&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo mount /dev/sdb1 mnt/fat32&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo mount /dev/sdb2 mnt/ext4&lt;/code&gt;&lt;br&gt;
Install the new kernel onto the SD card. Note that I'm renaming the image to kernel8-new.img, this is so we don't overwrite the default kernel and we can switch between them. &lt;br&gt;
&lt;code&gt;sudo env PATH=$PATH make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=mnt/ext4 modules_install&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo cp arch/arm64/boot/Image mnt/fat32/kernel8-new.img&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo cp arch/arm64/boot/dts/broadcom/*.dtb mnt/fat32/&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo cp arch/arm64/boot/dts/overlays/*.dtb* mnt/fat32/overlays/&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo cp arch/arm64/boot/dts/overlays/README mnt/fat32/overlays/&lt;/code&gt;&lt;br&gt;
Set the boot config to use the new kernel. This should be found on the last line of config.txt.&lt;br&gt;
&lt;code&gt;vi mnt/fat32/config.txt&lt;/code&gt;&lt;br&gt;
&lt;code&gt;kernel=kernel8-new.img&lt;/code&gt;&lt;br&gt;
Unmount the SD card, reinstall in your RPI and reboot. The new kernel should come up straightaway.&lt;br&gt;
&lt;code&gt;sudo umount mnt/fat32&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo umount mnt/ext4&lt;/code&gt;&lt;br&gt;
From the RPI command line, you can check which kernel is running with:&lt;br&gt;
&lt;code&gt;uname -r&lt;/code&gt;&lt;br&gt;
You can also switch back to the old kernel by editing the last line of /boot/config.txt.&lt;br&gt;
Now that hugepages are enabled, we can set them up using the built in DPDK tool dpdk-hugepages.py. More information is available at &lt;a href="https://doc.dpdk.org/guides/tools/hugepages.html" rel="noopener noreferrer"&gt;https://doc.dpdk.org/guides/tools/hugepages.html&lt;/a&gt;, but a basic setup I used is:&lt;br&gt;
&lt;code&gt;sudo ./usertools/dpdk-hugepages.py -p 32768k --setup 256M&lt;/code&gt;&lt;br&gt;
You can check them with:&lt;br&gt;
&lt;code&gt;sudo ./usertools/dpdk-hugepages.py -s&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Using DPDK on the Raspberry Pi
&lt;/h2&gt;

&lt;p&gt;Now that we have hugepages set up, we can go back to the helloworld application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;luke@raspberrypi $ sudo ./helloworld -l 0-3 -n 4
EAL: Detected CPU lcores: 4
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
hello from core 1
hello from core 2
hello from core 3
hello from core 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also run the basic l2fwd application. As the Raspberry Pi ethernet interface doesn't have a poll mode driver we can use, we have to use the PCAP PMD. This can be enabled by setting the environment variable &lt;code&gt;CONFIG_RTE_LIBRTE_PMD_PCAP=y&lt;/code&gt; and recompiling DPDK. We then run l2fwd with it enabled using the &lt;code&gt;--vdev&lt;/code&gt; option.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;luke@raspberrypi $ sudo ./examples/l2fwd/build/l2fwd -l 0-3 --no-pci --vdev=net_pcap0,iface=eth0 -- -p 1
EAL: Detected CPU lcores: 4
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
TELEMETRY: No legacy callbacks, legacy socket not created
MAC updating enabled
Notice: odd number of ports in portmask.
Lcore 0: RX port 0 TX port 0
Initializing port 0... done: 
Port 0, MAC address: 02:70:63:61:70:00


Checking link statusdone
Port 0 Link up at 10 Gbps FDX Fixed
L2FWD: lcore 1 has nothing to do
L2FWD: lcore 2 has nothing to do
L2FWD: entering main loop on lcore 0
L2FWD:  -- lcoreid=0 portid=0
L2FWD: lcore 3 has nothing to do
Port statistics ====================================
Statistics for port 0 ------------------------------
Packets sent:                        0
Packets received:                    0
Packets dropped:                     0
Aggregate statistics ===============================
Total packets sent:                  0
Total packets received:              0
Total packets dropped:               0
====================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, the statistics for l2fwd update every ten seconds. At this stage you should be able to ssh into the RPI over the ethernet port l2fwd is running on, and watch the number of packets increase as you send data back and forth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So there you have it - a basic DPDK application up and running on the Raspberry Pi! Without a proper poll-mode driver the usefulness is quite constrained, but it's interesting to play around with some heavy-duty software on such a small platform. Let me know in the comments if you think of any interesting applications for this.&lt;/p&gt;

</description>
      <category>dpdk</category>
      <category>raspberrypi</category>
      <category>linux</category>
      <category>networking</category>
    </item>
  </channel>
</rss>
