Commit Graph

3 Commits

Author SHA1 Message Date
Bhasker Hariharan c06c9deb1c Add support for virtio net headers in sharedmem endpoint.
PiperOrigin-RevId: 416221825
2021-12-13 23:39:05 -08:00
Bhasker Hariharan 2d384f761c Change Notify() to use unix.RawSyscall.
eventfd.Notify() uses unix.Write which will eventually
call unix.Syscall which will yield the current go processor
resulting in the Go scheduler parking the current goroutine
till the syscall returns.

But in most cases where Notify() is called there is no reason
to yield as the caller probably wants to continue doing something
right afterwards. Like in the case of the sharedmem endpoint
which may still have more packets to write.

PiperOrigin-RevId: 405693801
2021-10-26 11:30:21 -07:00
Kevin Krakauer e44b100654 add convenient wrapper for eventfd
The same create/write/read pattern is copied around several places. It's easier
to understand in a package with names and comments, and we can reuse the smart
blocking code in package rawfile.

PiperOrigin-RevId: 401647108
2021-10-07 17:41:20 -07:00