← Back to context

Comment by lokar

18 hours ago

Kernel networking is not automatically faster then userspace.

You're correct, kernel isn't faster by default. With that said, the following is true:

1) the WireGuard kernel implementation, despite not even being zero-copy, exceeds the performance of the userspace implementation

2) implementations utilizing the userspace network stack have a maximum potential performance (context switch + memcpy is very slow, and that affects UDP disproportionately). It's the wrong approach for meaningful improvement.

  • Io_uring doesn’t have context switching and may not have memcpy. The trickier thing I suspect to get with wireguard is the encryption and GSO offload

    • That is not true unfortunately. io_uring only avoids the userspace copy/switch. There are many other copies in the Linux userspace network stack.

      1 reply →