You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conn, device, tun: implement vectorized I/O on Linux
This commit changes the tun.Device and conn.Bind interfaces to accept
packet vectors for reading and writing. Internal plumbing between
these interfaces now passes a vector of packets. Vectors move untouched
between these interfaces, i.e. if 128 packets are received from
conn.Bind.Read(), 128 packets are passed to tun.Device.Write(). There
is no internal buffering.
Platform-specific implementations of tun.Device have been updated to
the new tun.Device interface, but only Linux supports passing more than
one packet for now. The Linux tun.Device implementation accomplishes
this via TSO and GRO, which is made possible by virtio extensions in
the TUN driver.
conn.LinuxSocketEndpoint has been deleted in favor of a collapsed
conn.StdNetBind. conn.StdNetBind makes use of recvmmsg() and sendmmsg()
on Linux. All platforms fall under conn.StdNetBind, except for Windows,
which remains in conn.WinRingBind. Sticky sockets support has been
refactored as part of this work to eventually be applicable on
platforms other than just Linux, however Linux remains the sole
platform that fully implements it. The conn.Bind UDP socket buffer is
now being sized to 7MB, whereas it was previously inheriting the system
default.
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: James Tucker <james@tailscale.com>
Co-authored-by: James Tucker <james@tailscale.com>
0 commit comments