]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Increase the VirtIO segment count to support modern Windows guests.
authorjhb <jhb@FreeBSD.org>
Thu, 2 May 2019 22:46:37 +0000 (22:46 +0000)
committerjhb <jhb@FreeBSD.org>
Thu, 2 May 2019 22:46:37 +0000 (22:46 +0000)
commit52426f5c74906597648813c707dd1bf555079114
tree5f5c49326f601ef0cdfd903ddcf6ba7ea1246b80
parent7918072058ffd8612e9c372c7d6a99c64a57b0f5
Increase the VirtIO segment count to support modern Windows guests.

The Windows virtio driver ignores the advertized seg_max field and
assumes the host can accept up to 67 segments in indirect descriptors,
triggering an assert in the bhyve process.

This brings back r282922 but with a couple of changes:
- It raises the block interface segment limit to 128 instead of 67.
- Linux's virtio driver assumes that the segment limit is no
  larger than the ring size.  To avoid breaking Linux guests,
  raise the VirtIO ring size to 128, and cap the VirtIO segment
  limit at ring size - 2 (effectively 126).

Reviewed by: rgrimes, Patrick Mooney <pmooney@pfmooney.com>
Obtained from: Joyent (Linux workaround)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18831
usr.sbin/bhyve/block_if.c
usr.sbin/bhyve/block_if.h
usr.sbin/bhyve/pci_virtio_block.c