Re: Best way to reduce system call overhead for tun device I/O?

2016-04-04 Thread Guus Sliepen
case, but I did try using socket(AF_PACKET) bound to a tun interface, just to see if sendmmsg()/recvmmsg() works then. It does, but indeed for packets that are sent to the socket, they need to be reinjected into the kernel receive path. So I'll be happy to test out your preliminary code. -- Met vriendelijke groet / with kind regards, Guus Sliepen

Re: Best way to reduce system call overhead for tun device I/O?

2016-04-04 Thread Guus Sliepen
UDP packets, those will never be optimized. So I think GSO/GRO is not the way to go, but there really should be a way to receive and send many individual packets in one system call. -- Met vriendelijke groet / with kind regards, Guus Sliepen

Re: Best way to reduce system call overhead for tun device I/O?

2016-03-31 Thread Guus Sliepen
et data as tun seems to be doing now. > > Agreed. Ok. So how should the userspace API work? Creating an AF_PACKET socket and then using a tun ioctl to create a tun interface and bind it to the socket? int fd = socket(AF_PACKET, ...) struct ifreq ifr = {...}; ioctl(fd, TUNSETIFF, &ifr); -- Met vriendelijke groet / with kind regards, Guus Sliepen

Best way to reduce system call overhead for tun device I/O?

2016-03-29 Thread Guus Sliepen
o userspace, so regular sendmmsg()/recvmmsg() can be used. There is tun_get_socket() which is used internally in the kernel, but this is not exposed to userspace, and doesn't look trivial to do either. What would be the right way to do this? -- Met vriendelijke groet / with kind regards, Guus Sliepen