tailscale/net/tstun
Josh Bleecher Snyder cc23049cd2 net/tstun: remove multi-case selects from hot code
Every TUN Read went through several multi-case selects.
We know from past experience with wireguard-go that these are slow
and cause scheduler churn.

The selects served two purposes: they separated errors from data and
gracefully handled shutdown. The first is fairly easy to replace by sending
errors and data over a single channel. The second, less so.

We considered a few approaches: Intricate webs of channels,
global condition variables. They all get ugly fast.

Instead, let's embrace the ugly and handle shutdown ungracefully.
It's horrible, but the horror is simple and localized.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-07-02 11:02:12 -07:00
..
fake.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
ifstatus_noop.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
ifstatus_windows.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
tun.go net/tstun: add a debug envvar to override tun MTU. 2021-06-04 11:55:11 -07:00
tun_notwindows.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
tun_windows.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
wrap.go net/tstun: remove multi-case selects from hot code 2021-07-02 11:02:12 -07:00
wrap_test.go go.mod: update netaddr 2021-06-02 09:05:06 -07:00