Work with DPDK
This page describes how to use the Data Plane Development Kit (DPDK) on U4C Compute Engine instances.
About DPDK on U4C instances
The Data Plane Development Kit (DPDK) is a framework for performance-intensive applications that require fast packet processing, low latency, and consistent performance. DPDK bypasses the Linux kernel network stack and runs directly in the user space.
U4C instances support DPDK using the
Google Virtual NIC (gVNIC) Poll Mode Driver (PMD).
Once you install DPDK, driver features can be configured using standard
ethdev and rte_flow APIs.
Using DPDK with ULL Solution includes support for flow steering. You can bypass default Receive Side Scaling (RSS) hashing by steering specific traffic flows directly to a designated receive queue (RX). ULL Solution supports 3-tuple flow steering (protocol, destination IP address, and destination port) for ULL unicast and multicast traffic.
Additionally, the gVNIC PMD supports hardware RX timestamping in mbufs and clock
reads through rte_eth_read_clock.
Limitations
Using DPDK on U4C instances has the following limitations:
- Support for bare metal instances isn't available in the mainline DPDK release
or the
dpdk-next-netrepository. You must apply the required patches by following the steps in Install DPDK on your U4C instance. - When configuring accurate time for a U4C
instance that uses DPDK on its ULL network interfaces (
nic1andnic2), you must configurechronyto usenic0as source for time synchronization.
Before you begin
Before you work with DPDK on U4C Compute Engine instances, you must meet the following requirements.
Create a U4C instance
If you haven't already, create a U4C bare metal instance. See Create ULL Compute Engine instances.
Connect to your instance by using SSH
If you haven't already, connect to your instance by using SSH.
Install DPDK on your U4C instance
To install DPDK on your U4C instance, follow these steps:
Configure the dependencies for DPDK installation:
If you are using Rocky Linux, enable the CodeReady Builder (CRB) repository. If you are using Red Hat Enterprise Linux (RHEL), skip this step.
sudo dnf -y config-manager --enable crbInstall the required packages and build tools:
sudo dnf install -y git gcc gcc-c++ make ninja-build python3-pip \ kernel-devel-$(uname -r) pkgconf-pkg-config numactl-devel sudo pip install pyelftools meson
Download the DPDK source. You must use either the
dpdk-next-netrepository or the DPDK release version 26.07 or later.dpdk-next-netgit clone git://dpdk.org/next/dpdk-next-net dpdk-sourceDPDK 26.07 or later
git clone git://dpdk.org/dpdk -b v26.07 dpdk-source
Apply the required patches. The source for bare metal support is hosted in the
dpdk-bmbranch of the Googlecompute-virtual-ethernet-dpdkrepository. The patches are ABI-compatible with thedpdk-next-netrepository.You can apply the patches using either a verbatim copy or a cherry-pick method. Do one of the following depending on your preferred workflow:
Verbatim copy
git clone https://github.com/google/compute-virtual-ethernet-dpdk -b dpdk-bm dpdk-bm cp -r dpdk-bm/drivers/net/gve/* dpdk-source/drivers/net/gve/ cd dpdk-source
Cherry-pick
cd dpdk-source git remote add gve-bm https://github.com/google/compute-virtual-ethernet-dpdk git fetch gve-bm git cherry-pick gve-bm/main..gve-bm/dpdk-bm
Build and install DPDK:
meson setup build sudo ninja -C build install; sudo ldconfig
Bind DPDK to a driver
You must bind your instance's network interfaces to a DPDK-compatible kernel driver as described in Bind DPDK to a driver and test it.
For U4C bare metal instances, consider the following:
- Bare metal instances don't require the UIO or
IOMMU-less VFIO drivers used by VM instances. You can bind directly to the
standard
vfio-pcidriver. - You can only bind the ULL network interfaces (
nic1andnic2) to the DPDK driver.nic0must remain bound to the standard kernel driver to maintain network connectivity and support time synchronization.
For more information, see Binding and Unbinding Network Ports to/from the Kernel Modules in the DPDK documentation.
What's next
- To synchronize your instance clock to the physical NIC clock of its host server, see Configure accurate time.