Finally got multi-queue batch-io linux kernel tun interface in C!

Thanks to Google’s AI code snippets, I was able to finally implement multiple threads all reading from a singular tun interface as well as each thread performing larger multiple batch reads/writes in one singular syscall (up to 65536 bytes per call)! Here are the parameters (IFF_MULTI_QUEUE | IFF_VNET_HDR) and calls you need to set to get it:

~

Source Code: github.com/stoops/vpn/blob/main/gtun.c

Leave a comment