Skip to content

gierens/xdp-reflector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xdp-reflector

An XDP program to reflect ethernet frames.

Performance

With MoonGen I achieved about 1.6 Mpps on an Intel 82599-based NIC. I'm not entirely sure yet if and how one can achieve the 14 Mpps that would max out the 10 Gbps throughput of the card.

Dependencies

Initialize the libbpf submodule with:

git submodule update --init

Then install the remaining dependencies with:

sudo apt install -y clang llvm libelf-dev libpcap-dev gcc-multilib build-essential linux-headers-$(uname -r)

For installation instructions for non-Debian systems see XDP tutorial's setup instructions

Building

Just hit make:

make

Deploying

Due to the simplicity of this XDP program, it does not come with an extra loader. You can simply use the ip tool for this.

To attach the reflector to a device use:

sudo ip link set <DEV> xdpgeneric obj reflector.o sec xdp

And to remove it again use:

sudo ip link set <DEV> xdpgeneric off

Remarks

This is quite a tiny and almost trivial project. I wrote it because I needed a fast reflector to take MoonGen measurements on non-PCI devices in QEMU guests. Apart from such usecases it can serve as a minimal sample project for XDP programs.

This project is similarly structured as the XDP tutorial, which is a great resource for learning XDP prorgamming.

License

This project is distributed under MIT license.

About

An XDP program to reflect ethernet frames.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages