[GSoC'20 Introduction] eBPF XDP Hook
Ankur Kothiwal
ankur at freebsd.org
Tue Jun 2 17:19:48 UTC 2020
Hello everyone,
Project: Implement eBPF XDP for FreeBSD by extending VirtIO ethernet
driver if_vtnet
The goal of this project is to extend an existing FreeBSD network
driver ,VirtIO if_vtnet to be able to call into an eBPF program when
processing a newly received packet. The driver will perform the basic
actions of XDP like PASS, DROP, TX or REDIRECT the packet as
specified by the program. The project will also implement new map type
and other eBPF helper functions.The aim of this project is to add new
probe sites into the kernel that will call eBPF functions
Mentors: Ryan Stone <rstone@> and Hiroki Sato <hrs@>
Approach for the project:
The project aims to extend the NIC driver “if_vtnet” to support XDP.
The approach is to write a XDP hook as a pfil (packet filter) hook
(https://svnweb.freebsd.org/changeset/base/356613) in the
vtnet_rxq_eof() function which is the function that deals with
receiving the packets from the driver. This approach will help the XDP
hook to work on any driver that supports pfil (like mlx5en).
The function will take XDP actions (like PASS, DROP etc) on the packet
which will further be processed by the eBPF program.
Project GSoC Wiki: https://wiki.freebsd.org/SummerOfCodeIdeas#eBPF_XDP_Hooks
Github Repo for the code:
https://github.com/rysto32/freebsd/tree/ebpf-import
FreeBSD Wiki
Student: https://wiki.freebsd.org/AnkurKothiwal
Project: https://wiki.freebsd.org/SummerOfCode2020Projects/eBPFXDPHooks
Thank you for giving your time to read. Please feel free to share your
feedback and suggestion.
Thanks and Regards
Ankur Kothiwal
More information about the freebsd-hackers
mailing list