aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2020-01-23 10:13:56 +0000
committerAndriy Gapon <avg@FreeBSD.org>2020-01-23 10:13:56 +0000
commitadbf6af741c7ae2892b8462860b50f9478eb517d (patch)
treee312d5d3c70cdce1662b74b92596705cb29c4677 /sys
parentab15488f12af338306900d645da9796f472bf097 (diff)
downloadsrc-adbf6af741c7ae2892b8462860b50f9478eb517d.tar.gz
src-adbf6af741c7ae2892b8462860b50f9478eb517d.zip
virtio_scsi: use max target ID plus one as the initiator ID
This bus does not really have a concept of the initiator ID, so use a guaranteed dummy one that won't conflict with any real target. This change fixes a problem with virtio_scsi on GCE where disks get sequential target IDs starting from one. If there are seven or more disks, then a disk with the target ID of seven would not be discovered by FreeBSD as that ID was reserved as the initiator ID -- see scsi_scan_bus(). Discussed with: bryanv MFC after: 2 weeks Sponsored by: Panzura
Notes
Notes: svn path=/head/; revision=357040
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/virtio/scsi/virtio_scsi.c2
-rw-r--r--sys/dev/virtio/scsi/virtio_scsivar.h5
2 files changed, 1 insertions, 6 deletions
diff --git a/sys/dev/virtio/scsi/virtio_scsi.c b/sys/dev/virtio/scsi/virtio_scsi.c
index 6f2dfbcac5a4..76a065ecb338 100644
--- a/sys/dev/virtio/scsi/virtio_scsi.c
+++ b/sys/dev/virtio/scsi/virtio_scsi.c
@@ -937,7 +937,7 @@ vtscsi_cam_path_inquiry(struct vtscsi_softc *sc, struct cam_sim *sim,
cpi->max_target = sc->vtscsi_max_target;
cpi->max_lun = sc->vtscsi_max_lun;
- cpi->initiator_id = VTSCSI_INITIATOR_ID;
+ cpi->initiator_id = cpi->max_target + 1;
strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strlcpy(cpi->hba_vid, "VirtIO", HBA_IDLEN);
diff --git a/sys/dev/virtio/scsi/virtio_scsivar.h b/sys/dev/virtio/scsi/virtio_scsivar.h
index 3e4109e65870..064b1245a565 100644
--- a/sys/dev/virtio/scsi/virtio_scsivar.h
+++ b/sys/dev/virtio/scsi/virtio_scsivar.h
@@ -205,11 +205,6 @@ struct vtscsi_request {
#define VTSCSI_RESERVED_REQUESTS 10
/*
- * Specification doesn't say, use traditional SCSI default.
- */
-#define VTSCSI_INITIATOR_ID 7
-
-/*
* How to wait (or not) for request completion.
*/
#define VTSCSI_EXECUTE_ASYNC 0