[Paper Review] hXDP: Efficient Software Packet Processing on FPGA NICs
hXDP enables high-performance, low-latency packet processing on FPGA NICs by compiling unmodified eBPF/XDP programs to a custom, optimized instruction set architecture (ISA) that exploits parallelism and reduces resource usage. It achieves CPU-core-level throughput at 156MHz with under 15% FPGA resource utilization, outperforming high-end CPUs in latency while supporting dynamic program loading.
FPGA accelerators on the NIC enable the offloading of expensive packet processing tasks from the CPU. However, FPGAs have limited resources that may need to be shared among diverse applications, and programming them is difficult. We present a solution to run Linux's eXpress Data Path programs written in eBPF on FPGAs, using only a fraction of the available hardware resources while matching the performance of high-end CPUs. The iterative execution model of eBPF is not a good fit for FPGA accelerators. Nonetheless, we show that many of the instructions of an eBPF program can be compressed, parallelized or completely removed, when targeting a purpose-built FPGA executor, thereby significantly improving performance. We leverage that to design hXDP, which includes (i) an optimizing-compiler that parallelizes and translates eBPF bytecode to an extended eBPF Instruction-set Architecture defined by us; a (ii) soft-CPU to execute such instructions on FPGA; and (iii) an FPGA-based infrastructure to provide XDP's maps and helper functions as defined within the Linux kernel. We implement hXDP on an FPGA NIC and evaluate it running real-world unmodified eBPF programs. Our implementation is clocked at 156.25MHz, uses about 15% of the FPGA resources, and can run dynamically loaded programs. Despite these modest requirements, it achieves the packet processing throughput of a high-end CPU core and provides a 10x lower packet forwarding latency.
Motivation & Objective
- Address the challenge of efficiently offloading XDP packet processing to resource-constrained FPGA NICs while preserving compatibility with existing Linux eBPF/XDP programs.
- Overcome the mismatch between eBPF's sequential execution model and FPGA's native parallelism, which limits performance when directly mapping eBPF to FPGAs.
- Enable shared FPGA usage across multiple accelerators by minimizing resource consumption, ensuring sufficient capacity for other network functions.
- Provide a seamless integration path with the Linux kernel by supporting dynamic loading of unmodified XDP programs and emulating XDP maps and helper functions.
Proposed method
- Design an extended eBPF ISA with 3-operand instructions, 6-byte load/store operations, and a parametrized exit instruction to improve code density and execution efficiency on FPGAs.
- Implement a custom soft-CPU in FPGA hardware that natively executes the extended ISA, enabling efficient and parallel instruction processing.
- Develop a static compiler that performs instruction-level parallelism analysis and optimizes eBPF bytecode by removing redundant instructions (e.g., boundary checks, zeroing) when safe in the FPGA context.
- Build a complete FPGA-based infrastructure that emulates XDP maps and helper functions as defined in the Linux kernel, enabling full compatibility with existing XDP programs.
- Integrate the system with the NetFPGA platform to enable open-source deployment and evaluation of hXDP on real hardware.
- Minimize PCIe transfers by optimizing data movement and leveraging on-NIC execution, reducing CPU and system overhead.
Experimental results
Research questions
- RQ1Can eBPF programs be efficiently compiled and executed on FPGAs despite the mismatch between eBPF’s sequential model and FPGA’s native parallelism?
- RQ2What hardware and software optimizations are necessary to achieve high performance while using minimal FPGA resources for XDP offloading?
- RQ3To what extent can redundant or context-specific eBPF instructions be removed or replaced when targeting a purpose-built FPGA executor?
- RQ4Can a custom ISA extension and compiler pipeline enable high-throughput, low-latency packet processing on FPGAs with minimal resource overhead?
- RQ5Is it feasible to support dynamic loading of unmodified XDP programs on FPGA NICs while maintaining compatibility with the Linux kernel’s XDP interface?
Key findings
- hXDP achieves packet processing throughput equivalent to a high-end x86 CPU core, despite operating at only 156.25MHz clock frequency.
- The system uses less than 15% of the FPGA’s resources, enabling efficient sharing with other accelerators.
- hXDP reduces packet forwarding latency by a factor of 10 compared to a high-end CPU core.
- The compiler and hardware stack successfully remove or optimize redundant eBPF instructions (e.g., boundary checks, zeroing) without compromising correctness in the FPGA context.
- The system supports dynamic loading of unmodified XDP programs, enabling runtime reconfiguration and seamless integration with the Linux kernel.
- The implementation on NetFPGA demonstrates that high performance is achievable even with modest clock speeds, thanks to effective instruction-level parallelism and ISA-level optimizations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.