6 Commits
Author SHA1 Message Date
Etienne PerotandgVisor bot d59375d82e Break //pkg/tcpip/link/rawfile's dep on //pkg/tcpip & move it to //pkg.
`//pkg/tcpip/link/rawfile` is a package to deal with raw socket and file FDs.
It is not only used for Netstack, but rather just generally useful raw file
manipulation stuff.

This change removes the Unix-error-to-`//pkg/tcpip`-error translation step
from its functions; this is now the responsibility of its callers. Callers
within Netstack now do the translation by themselves; the translation
function is moved to `//pkg/tcpip`.

This allows the `//pkg/tcpip/link/rawfile` package to not depend on
`//pkg/tcpip`, which in turn means the `//pkg/eventfd` package
(which depends on `rawfile`) no longer transitively depends on
`//pkg/tcpip`, which in turns means the `//pkg/unet` package (which
depends on `//pkg/eventfd`) no longer transitively depends on
`//pkg/tcpip`, which in turns means that the `//pkg/eventchannel`
package (which depends on `//pkg/unet`) no longer transitively
depends on `//pkg/tcpip`, which in turns means that the `//pkg/metric`
package (which depends on `//pkg/eventchannel`) no longer transitively
depends on `//pkg/tcpip`, which finally means that the `//pkg/metric`
package can be used within `//pkg/tcpip`. \o/

This changes does not make it use it, it just moves `rawfile`.

PiperOrigin-RevId: 647943618
2024-06-29 05:11:53 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Kevin KrakauerandgVisor bot af99fcb280 eventfd: more detailed error message
PiperOrigin-RevId: 506948082
2023-02-03 11:13:36 -08:00
Bhasker HariharanandgVisor bot c06c9deb1c Add support for virtio net headers in sharedmem endpoint.
PiperOrigin-RevId: 416221825
2021-12-13 23:39:05 -08:00
Bhasker HariharanandgVisor bot 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 KrakauerandgVisor bot 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