Commit Graph

21 Commits

Author SHA1 Message Date
Josh Bleecher Snyder 83742afabf convert manual tests into automated tests 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 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 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