alternatives to readv() and writev() when the file descriptor is a TUN device
Description
I want to find a faster PacketDispatchMode supported by TUN device.
Is this feature related to a specific bug?
No response
Do you have a specific solution in mind?
io_uring or Linux AIO
There's sendmmsg/recvmmsg and PACKET_MMAP. io_uring would be interesting -- we haven't explored that and I'm not sure how it would perform.
But TUN device doesn't support sendmmsg/recvmmsg.
In some cases, calling readv() on a TUN device can be replaced with calling recvmmsg() on a packet socket, calling writev() on a TUN device can be replaced with calling sendmmsg() on a packet socket (send packets to the loopback interface). If the file descriptor is TUN or TAP, can gvisor handle and generate virtioNetHdr?