Lurker News
What are you working on? Any new ideas that you're thinking about?

Comments (1,152) 576 threads

Show all comments

Showing thread 180 of 576

database64128#
I just finished adding UDP GRO & GSO support to my WireGuard proxy software. The work involved rewriting a large part of the program.

https://github.com/database64128/swgp-go
For those who don't know, UDP Generic Receive Offload and Generic Segmentation Offload allow you to receive and send multiple same-sized UDP packets coalesced in a single buffer (or many in an iovec but you really shouldn't). Compared to calling sendmsg(2) on individual packets, sending them coalesced in one call traverses the kernel network stack exactly once, thus has significantly lower overhead.
wireguard-go and many QUIC implementations use the same trick to improve throughput. Unfortunately the in-kernel WireGuard driver does not take advantage of UDP GSO, and swgp-go had to cope with that by attempting to coalesce multiple unsegmented messages received in a single recvmmsg(2) call.