Page MenuHomeFreeBSD

bhyve/virtio-scsi: Implement task management functions
Needs ReviewPublic

Authored by rosenfeld_grumpf.hope-2000.org on Oct 20 2025, 5:46 PM.
Tags
None
Referenced Files
F146502214: D53222.id.diff
Tue, Mar 3, 4:53 AM
F146502200: D53222.id164635.diff
Tue, Mar 3, 4:53 AM
F146502195: D53222.id165413.diff
Tue, Mar 3, 4:53 AM
F146502194: D53222.id165414.diff
Tue, Mar 3, 4:53 AM
F146502168: D53222.id172277.diff
Tue, Mar 3, 4:53 AM
F146502166: D53222.id165406.diff
Tue, Mar 3, 4:53 AM
F146502150: D53222.id167545.diff
Tue, Mar 3, 4:53 AM
Unknown Object (File)
Wed, Feb 25, 3:52 AM
Subscribers

Details

Reviewers
jhb
corvink
markj
Group Reviewers
bhyve
Summary

Currently, all I/O requests are queued internally, and a number of
threads will pick I/O requests of the queue and send them to CTL with
a synchronous CTL_IO ioctl. On the other hand, TMF requests are sent
to CTL immediately using the same synchronous ioctl.

Besides being unworkable for non-CTL backends such as for SCSI
passthrough, this simple approach may easily run into situations
where a TMF request operating on a particular I/O request is sent
to CTL while it is still on our queue and thus unknown to CTL.
In addition, for target and/or LUN resets we should really clear
our queue and return all outstanding I/O requests with a proper
status.

This is currently also under review in illumos: https://code.illumos.org/c/illumos-gate/+/4424

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70797
Build 67680: arc lint + arc unit

Event Timeline

Reword comment in pci_vtscsi_tmf_handle().

rosenfeld_grumpf.hope-2000.org retitled this revision from bhyve/virtio-scsi: implement task management functions to bhyve/virtio-scsi: Implement task management functions.Thu, Feb 19, 7:35 PM
usr.sbin/bhyve/pci_virtio_scsi.c
717

Is it possible this will return false negatives if the task is actively being processed by a worker thread? In that case the corresponding request won't be on a queue anymore, so this search won't find it.

781

The commit log message should also briefly explain what's actually changing in the patch.