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
deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
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.

2 comments to virtio NIC on OpenBSD 5.5-current

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>