Utilize separate threads for RX and TX in vmd(8)'s vionet.
authordv <dv@openbsd.org>
Tue, 20 Feb 2024 21:40:37 +0000 (21:40 +0000)
committerdv <dv@openbsd.org>
Tue, 20 Feb 2024 21:40:37 +0000 (21:40 +0000)
commita246f7a0bc5ae64e47a2d63ae5fa3e50d02d5962
tree6bfaace7b680d1339e9426b912efcaf4051e88d0
parent74fdd320a82dc1e8732967197f6d81cd58e40a11
Utilize separate threads for RX and TX in vmd(8)'s vionet.

This commit adds multithreading to allow both virtqueues to be
processed in parallel along with additional synchronization primitives
to protect device configuration state. Allowing RX and TX to operate
independently reduces overall network latency for guests and helps
alleviate the TX side dominating cpu time.

Tested with help from phessler@, kn@, and mlarkin@. ok mlarkin@.
usr.sbin/vmd/proc.c
usr.sbin/vmd/proc.h
usr.sbin/vmd/vioblk.c
usr.sbin/vmd/vionet.c
usr.sbin/vmd/virtio.c
usr.sbin/vmd/virtio.h
usr.sbin/vmd/vm.c
usr.sbin/vmd/vmd.h