]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
conn, device, tun: implement vectorized I/O plumbing
authorJordan Whited <jordan@tailscale.com>
Thu, 2 Mar 2023 22:48:02 +0000 (14:48 -0800)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 10 Mar 2023 13:52:13 +0000 (14:52 +0100)
commit3bb8fec7e41fcc2138ddb4cba3f46100814fc523
treee6c83a2ae0178ffee5dde657cbbdd17ee427dbbe
parent21636207a6756120f56f836b06c086b627f7b911
conn, device, tun: implement vectorized I/O plumbing

Accept packet vectors for reading and writing in the tun.Device and
conn.Bind interfaces, so that the 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.

Currently, existing implementations are only adjusted to have vectors
of length one. Subsequent patches will improve that.

Also, as a related fixup, use the unix and windows packages rather than
the syscall package when possible.

Co-authored-by: James Tucker <james@tailscale.com>
Signed-off-by: James Tucker <james@tailscale.com>
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
25 files changed:
conn/bind_linux.go
conn/bind_std.go
conn/bind_windows.go
conn/bindtest/bindtest.go
conn/conn.go
conn/conn_test.go [new file with mode: 0644]
device/channels.go
device/device.go
device/device_test.go
device/peer.go
device/pools.go
device/pools_test.go
device/receive.go
device/send.go
main.go
main_windows.go
tun/errors.go [new file with mode: 0644]
tun/netstack/tun.go
tun/tun.go
tun/tun_darwin.go
tun/tun_freebsd.go
tun/tun_linux.go
tun/tun_openbsd.go
tun/tun_windows.go
tun/tuntest/tuntest.go