GPU Boosts Linux Kernel’s Network Packet Processing

Linux kernel developers are currently discussing a set of patches that introduce the KNOD, a tool designed to utilize AMD GPUs for accelerating network packet processing. KNOD operates directly with the GPU, bypassing user-space frameworks like AMD ROCm and NVIDIA CUDA. It independently manages GPU queues and JIT-compiles BPF packet processing routines for GPU execution. Through DMA and Device Memory TCP, packets are redirected from NIC memory to the GPU for processing.

The network stack’s networking capabilities that can benefit from GPU acceleration include network protocol handlers, IPsec, tunnels, encryption, netfilter, traffic engineering, OVS (Open vSwitch), and XDP (eXpress Data Path). The project’s current emphasis is on enhancing the XDP subsystem, which collaborates with eBPF to enable BPF program execution at the network driver level, accessing the DMA packet buffer directly and working before memory allocation by the network stack.

Performance in operations like load balancing at the transport layer and IPsec encryption via XDP depends on the CPU core count. With KNOD, BPF programs are translated into GPU machine code using a JIT compiler and executed on the GPU. The GPU’s capability to support numerous threads executing the same program simultaneously on distinct network packets shifts the workload from the CPU to the GPU, enabling scalability due to GPU parallelism (SIMT) rather than the quantity of CPU cores.

The project is compatible with systems utilizing AMD GPUs based on the GCN architecture. This choice is based on the comprehensive open AMDGPU driver incorporated in the primary Linux kernel, documenting the essential functionality for organizing GPU computations without superfluous layers and abstractions. Future integration with Intel GPUs is plausible. Meanwhile, the challenging support for NVIDIA GPUs is attributed to the absence of a full-fledged open driver in the main kernel, with the current Nouveau driver deemed unsuitable for KNOD use.

/Reports, release notes, official announcements.