AFXDP-rs

This module provides a Rust interface for AF_XDP which wraps libbpf built on libbpf-sys.

Author: Dan Siemon \

docs.rs

AF_XDP (XSK):

The goals of this crate, in order, are:

  1. Correctness
  2. Performance
  3. Ease of use

Current Status

The API works for my current use cases but I expect it will change to achieve higher performance and better usability.

If you have knowledge of Rust FFI and general Rust unsafe things I would greatly appreciate some help auditing this crate as my experience in this area is limited.

Sample Programs

There are several programs in examples/:

You can run with cargo run --release --example <example_name> -- [example options] to see a list of options run cargo run --release --example <example_name> -- --help

Performance

Test System:

Traffic Generator:

Scenario 1: l2fwd-2link on a single core running userspace and NAPI

Small amounts of packet loss starts at about 6.5M PPS unidirectional and 6.0M PPS bi-directionally (3M each direction).

Little effort has been put into optimizing this so I expect there are some easy performance wins.

Supported Features

Required AF_XDP Features

Supported AF_XDP Features

Unsupported AF_XDP Features (for now)

To Do