virtio NIC on OpenBSD 5.5-current

My Ansible host is OpenBSD. Because if I’m going to have a host that can manage my network, it needs to be ridiculously secure. The OpenBSD host runs on KVM (through the SolusVM virtualization management system).

During heavy data transfers, the network card would occasionally stop passing traffic. I could run any Ansible command without issue, but downloading an ISO caused hangs. This was most obvious during upgrades. Downloads would stall. I could restart them with ^Z, then a “ifconfig vio0 down && ifconfig vio0 up && fg” but this still isn’t desirable.

The vio(4) man page includes the following text:

     Setting flags to 0x02 disables the RingEventIndex feature.  This can be
     tried as a workaround for possible bugs in host implementations or vio at
     the cost of slightly reduced performance.

(Thanks to Philip Guenther for pointing that out. I would kind of expect this to have been in the BUGS section, or maybe say “Try this if you have weird problems,” but at least the info is there.)

So: download the new bsd.rd kernel, set the flag, and try to upgrade.

#config -ef /bsd.rd
OpenBSD 5.5-current (RAMDISK_CD) #147: Wed May 28 13:56:39 MDT 2014
Enter 'help' for information
ukc> find vio
146 vio* at virtio* flags 0x0
ukc> change 146
146 vio* at virtio* flags 0x0
change [n] y
flags [0] ? 2
146 vio* changed
146 vio* at virtio* flags 0x2
ukc> quit
Saving modified kernel.

The upgrade now runs flawlessly, and I can no longer reproduce the hangs.

Be sure to repeat this on the new kernel.

Stalk me on social media

2 Replies to “virtio NIC on OpenBSD 5.5-current”

Comments are closed.