I'm not really expecting tun to provide blistering performance, but
one of the things that keeps it slower than need be is the one packet
per read/write implementation. It'd be pretty cool to have
something like readv() or writev() provide the ability to operate on
multiple packets at once. Unfortunately the v interfaces don't provide
quite enough information, but we can create a new one with ioctl.
The TUNDOIOVEC ioctl takes a struct consisting of two iov arrays, one
for read and one for write, and the relevant counts. One syscall will
(without blocking) receive and send up to 8 packets in each direction.
Then it updates the structure so userland knows how many packets went
* Matthew Dempsky <[hidden email]> [2014-07-10 22:56]:
> On Thu, Jul 10, 2014 at 1:20 PM, Ted Unangst <[hidden email]> wrote:
> > Thoughts?
> Seems kind of hacky to me, but if it results in significant
> performance improvements in real world uses, then I could be swayed
> since it's not very intrusive either.