![]() Note: this article describes how to use the kernel system call interface directly, and how to assemble BPF by hand. However, it should be generally applicable, and can for some maybe even serve as the documentation I wish I had when writing the Snabb XDP app (for a full picture, I encourage you to read its source). What follows is a step by step recipe for driving an XDP socket written from the point of view of a Snabb app. (Oh, and there is also this eBPF based filtering capability.) XDP might be a good option for users that want to offload parts of the traffic to the kernel. The XDP slow-path (software backend) seems to be ~10 times faster than AF_PACKET.XDP could be a performant way to use Linux drivers for hardware that supports it. Vendors often provide drivers for their devices to the Linux kernel. While the Snabb community prefers NICs with open hardware interface specifications there are a lot of networking devices out there that lack open specifications. ![]() I can think of two reasons why XDP might be interesting for Snabb users: In that sense, XDP can be seen as a more hardware centric sibling of AF_PACKET. I think it is fair to describe XDP as a generic interface to Linux network drivers that also has a virtual backend it integrates with: the Linux network stack. In fact the XDP ABI/API is so similar to a typical hardware interfaces that it feels a bit like driving a NIC, and not by accident. To Snabb XDP looks like just another network I/O device. XDP provides a new kind of network socket that allows userspace applications to do almost direct I/O with network device drivers while maintaining integration with the kernel’s native network stack. Recent Linux kernels ship with a feature called eXpress Data Path (XDP) that intends to consolidate kernel-bypass packet processing applications with the kernel’s networking stack. Networking in userspace is becoming mainstream. ![]() Attaching a BPF program to an interface.Forwarding packets from a queue to an XDP socket.Tuesday, 21 January 2020 Text PDF Source Changes How to XDP (with Snabb)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |