From db2114b4b885d490c84416af27ec50add8a354fd Mon Sep 17 00:00:00 2001 From: Eric van Gyzen Date: Fri, 21 Jun 2019 18:57:33 +0000 Subject: [PATCH] bhyve: Fix vtscsi maximum segment config The seg_max value reported to the guest should be two less than the host's maximum, in order to leave room for the request and the response. This is analogous to r347033 for virtio_block. We hit the "too many segments to enqueue" assertion on OneFS because we increase MAXPHYS to 256 KB. Reviewed by: bryanv Discussed with: cem jhb rgrimes MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20529 --- usr.sbin/bhyve/pci_virtio_scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c index 283dd83b6e08..9d9fa822e01d 100644 --- a/usr.sbin/bhyve/pci_virtio_scsi.c +++ b/usr.sbin/bhyve/pci_virtio_scsi.c @@ -309,7 +309,8 @@ pci_vtscsi_reset(void *vsc) /* initialize config structure */ sc->vss_config = (struct pci_vtscsi_config){ .num_queues = VTSCSI_REQUESTQ, - .seg_max = VTSCSI_MAXSEG, + /* Leave room for the request and the response. */ + .seg_max = VTSCSI_MAXSEG - 2, .max_sectors = 2, .cmd_per_lun = 1, .event_info_size = sizeof(struct pci_vtscsi_event),