Rewrite vmd(8)'s vionet to be zero-copy.
authordv <dv@openbsd.org>
Tue, 30 Jan 2024 23:01:49 +0000 (23:01 +0000)
committerdv <dv@openbsd.org>
Tue, 30 Jan 2024 23:01:49 +0000 (23:01 +0000)
commit4d307b04017eba85e037f3350f113b7c6017cee2
tree0170b5cf0f9bfcea2add1b2e916e92fb6a073c71
parent3f8f40b1e9b1d9063254abd185f9d0b6c0fdac7a
Rewrite vmd(8)'s vionet to be zero-copy.

Similar to the rewrite of the virtio block device to use zero-copy
semantics, this rewrites how the virtio network device works with
the virtqueue ring buffers to minimize data copying. For guests
that don't use the built-in DNS and mac filtering capabilities,
data can now be transfered to/from the virtqueue and the tap(4)
directly without temporary buffers.

A lot of the virtio semantics are cleaned up as well, including
proper error states.

Tested with help by mbuhl@, friehm@, mlarkin@, and others.

"go for it," mlarkin@
usr.sbin/vmd/vionet.c
usr.sbin/vmd/virtio.h