Girls Just Wanna Have Fast MPMC Queues with bounded waiting

Disclaimer: An earlier version of this post claimed the structure is wait-free, this is incorrect. Being wait-free requires that failure or suspension of any thread can’t cause failure or suspension of another thread. This queue in fact does not fulfill that requirement. The main section which discusses the wait bounds of queue operations has been amended to reflect this, but other parts of this article have not been. As such there may be parts of the text which refer to this as a wait-free queue, which it is not. I chose to keep those sections to avoid rewriting chunks of this post after it was already posted. Thanks for the correction Reddit user matthieum!

Packets at Line Rate: How to Actually Use AF_XDP

About 5 months ago I decided to create my own (minimal) TCP/IP implementation in user space. After spending some time looking over my options, I decided that I would build it atop AF_XDP sockets. They offer amazing performance, are very well supported, and unlike certain other options (DPDK) they don’t take ownership of the NIC in a way that is disruptive to other processes. The fact that it would also give me a chance to learn a bit more about eBPF was just the cherry on top.