aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bhyve/pci_virtio_scsi.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2018-12-07 20:55:29 +0000
committerAlexander Motin <mav@FreeBSD.org>2018-12-07 20:55:29 +0000
commit6810fd0acf61502cadf69af67e581068e1beaa5f (patch)
tree0d0ab909dbf95bac7e1d0e7ac4c5ffe466deece7 /usr.sbin/bhyve/pci_virtio_scsi.c
parent99fa47de81c19e6066d0bd8e8732e452a4823de6 (diff)
downloadsrc-6810fd0acf61502cadf69af67e581068e1beaa5f.tar.gz
src-6810fd0acf61502cadf69af67e581068e1beaa5f.zip
Make virtio-scsi pass SCSI Task Attributes to CTL.
MFC after: 1 week Sponsored by: iXsystems, Inc.
Notes
Notes: svn path=/head/; revision=341706
Diffstat (limited to 'usr.sbin/bhyve/pci_virtio_scsi.c')
-rw-r--r--usr.sbin/bhyve/pci_virtio_scsi.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c
index 78e109bc936d..531073ffd6a3 100644
--- a/usr.sbin/bhyve/pci_virtio_scsi.c
+++ b/usr.sbin/bhyve/pci_virtio_scsi.c
@@ -499,7 +499,21 @@ pci_vtscsi_request_handle(struct pci_vtscsi_queue *q, struct iovec *iov_in,
io->scsiio.sense_len = sc->vss_config.sense_size;
io->scsiio.tag_num = (uint32_t)cmd_rd->id;
- io->scsiio.tag_type = CTL_TAG_SIMPLE;
+ switch (cmd_rd->task_attr) {
+ case VIRTIO_SCSI_S_ORDERED:
+ io->scsiio.tag_type = CTL_TAG_ORDERED;
+ break;
+ case VIRTIO_SCSI_S_HEAD:
+ io->scsiio.tag_type = CTL_TAG_HEAD_OF_QUEUE;
+ break;
+ case VIRTIO_SCSI_S_ACA:
+ io->scsiio.tag_type = CTL_TAG_ACA;
+ break;
+ case VIRTIO_SCSI_S_SIMPLE:
+ default:
+ io->scsiio.tag_type = CTL_TAG_SIMPLE;
+ break;
+ }
io->scsiio.ext_sg_entries = ext_sg_entries;
io->scsiio.ext_data_ptr = ext_data_ptr;
io->scsiio.ext_data_len = ext_data_len;