kadmin
87fc7aa6b0
Clean up tests a bit more
2021-07-08 20:15:05 +00:00
kadmin
34c5677308
add timeout?
...
This adds most likely broken timeout code. I have no idea where the docs are for adding
timeouts, and there is only a very brief mention in the spec.
2021-07-08 20:14:46 +00:00
julianknodt
6d10acc6dd
net/uring: add split for linux vs not for io_uring
...
This also adds a flag for checking whether it is active or not.
Signed-off-by: julianknodt <julianknodt@gmail.com>
2021-07-08 20:14:31 +00:00
kadmin
61e3d919ef
net/uring: add go ntohs
...
Instead of calling out to C for ntohs, just implement it in Go for effiency.
Signed-off-by: kadmin <julianknodt@gmail.com>
2021-07-08 12:58:58 -07:00
Josh Bleecher Snyder
cc5c696834
comment more
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
33c0997447
incorporate recvOut into recvReqs
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
08af39ae24
remove more dead code
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
43ccdc8879
document, cull dead code
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
e0abf1b3dd
WIP: clean shutdown for UDP conn
...
this appears to work, most of the time.
there's lots of documentation work remaining,
thinking through the structure remaining,
testing remaining,
porting to file remaining (if appropriate).
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
7642d9fafd
remove dead code
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
bf20f000fd
overhaul error handling of peek/waitcompletion
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
4679379ebe
refactor
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
f6b49d3e0e
set sin_family (oops)
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
ae2f24ec4e
remove some TODOs, make ip address extraction equally awful
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
ba49da429a
simplify change point
...
at the cost of some very, very naughty unsafe
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
83742afabf
convert manual tests into automated tests
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
b668e5d185
tewak
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
5410042dcd
start cleaning up code
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
75efd794a3
ipv6 support, UNTESTED, super hacky
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
36a4741bc5
comments
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
208e6eb0db
fix io_uring tun device reads
...
Well that's an interesting one!
Apparently if you issue multiple concurrent preadv calls on
a TUN device using io_uring, the TUN device falls over.
Possibly corrupting memory along the way.
Which might be why the kernel hung on shutdown...
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
fec66b4100
make it easy to toggle uring on/off
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
eff65381f2
switch file.go to test reads instead of writes
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
a8df9fa7cc
simpler init
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
78fd2b7880
stick closer to upstream tun reading code
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
001dec84de
make cgo pointer rules happy
...
well that was a mess
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
a8a7208dbd
use io_uring for sendmsg
...
and clean up some dead code and unify some things
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
f254f779b5
disable polling for now
...
we'll maybe bring it back with a token bucket or something.
and/or do multi-sqe submission.
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
3d91c5b369
they work with extra junk
...
thanks, dave
no thanks, kernel devs
write no work
use writev
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
2a2ed7cd17
tun writes...not working yet (but why not??)
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
55c1ce00be
use polling instead of syscall
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
4013c0edbb
smush together two return values from C
...
avoids a per-packet alloc
i will atone for my sins later
if only C let you return multiple values.
or Go let you pass in a pointer w/o it being on the heap.
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
783d2d4327
keep 8 requests in the queue at all times
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
71f35bda1a
remove all allocs
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
b83ac004f1
remove all allocations
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
59512181b5
mve sockaddr_in to Go
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
1ee40d1670
move iovec to go
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
bbccf68a76
sheesh
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
d7a7e2d17d
move msghdr to Go
2021-07-08 12:56:49 -07:00
Josh Bleecher Snyder
f26c0fcbd5
use io_uring
2021-07-08 12:56:49 -07:00
Christine Dodrill
1e83b97498
tstest/integration/vms: outgoing SSH test ( #2349 )
...
This does a few things:
1. Rewrites the tests so that we get a log of what individual tests
failed at the end of a test run.
2. Adds a test that runs an HTTP server via the tester tailscale node and
then has the VMs connect to that over Tailscale.
3. Dials the VM over Tailscale and ensures it answers SSH requests.
4. Other minor framework refactoring.
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-07-08 11:38:01 -04:00
Christine Dodrill
97279a0fe0
tstest/integration/vms: add Oracle Linux image ( #2328 )
...
Oracle Linux[1] is a CentOS fork. It is not very special. I am adding it
to the integration jungle because I am adding it to pkgs and the website
directions.
[1]: https://www.oracle.com/linux/
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-07-08 10:26:20 -04:00
Brad Fitzpatrick
a9fc583211
cmd/tailscale/cli: document the web subcommand a bit more
...
Fixes #2326
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 21:16:33 -07:00
Josh Bleecher Snyder
0ad92b89a6
net/tstun: fix data races
...
To remove some multi-case selects, we intentionally allowed
sends on closed channels (cc23049cd2
).
However, we also introduced concurrent sends and closes,
which is a data race.
This commit fixes the data race. The mutexes here are uncontended,
and thus very cheap.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-07-07 16:15:29 -07:00
Brad Fitzpatrick
7d417586a8
tstest/integration: help bust cmd/go's test caching
...
It was caching too aggressively, as it didn't see our deps due to our
running "go install tailscaled" as a child process.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 13:14:21 -07:00
Brad Fitzpatrick
3dcd18b6c8
tailcfg: note RegionID 900-999 reservation
2021-07-07 12:23:41 -07:00
Brad Fitzpatrick
ddb8726c98
util/deephash: don't reflect.Copy if element type is a defined uint8
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 11:58:04 -07:00
Brad Fitzpatrick
df176c82f5
util/deephash: skip alloc test under race detector
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 11:40:28 -07:00
Brad Fitzpatrick
6dc38ff25c
util/deephash: optimize hashing of byte arrays, reduce allocs in Hash
...
name old time/op new time/op delta
Hash-6 173µs ± 4% 101µs ± 3% -41.69% (p=0.000 n=10+9)
HashMapAcyclic-6 101µs ± 5% 105µs ± 3% +3.52% (p=0.001 n=9+10)
TailcfgNode-6 29.4µs ± 2% 16.4µs ± 3% -44.25% (p=0.000 n=8+10)
name old alloc/op new alloc/op delta
Hash-6 3.60kB ± 0% 1.13kB ± 0% -68.70% (p=0.000 n=10+10)
HashMapAcyclic-6 2.53kB ± 0% 2.53kB ± 0% ~ (p=0.137 n=10+8)
TailcfgNode-6 528B ± 0% 0B -100.00% (p=0.000 n=10+10)
name old allocs/op new allocs/op delta
Hash-6 84.0 ± 0% 40.0 ± 0% -52.38% (p=0.000 n=10+10)
HashMapAcyclic-6 202 ± 0% 202 ± 0% ~ (all equal)
TailcfgNode-6 11.0 ± 0% 0.0 -100.00% (p=0.000 n=10+10)
Updates tailscale/corp#2130
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 11:30:49 -07:00
Brad Fitzpatrick
3962744450
util/deephash: prevent infinite loop on map cycle
...
Fixes #2340
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-07-07 10:57:46 -07:00