Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2020 14:52:55 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r358385 - stable/12/sys/dev/virtio/scsi
Message-ID:  <202002271452.01REqtiF066425@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Feb 27 14:52:55 2020
New Revision: 358385
URL: https://svnweb.freebsd.org/changeset/base/358385

Log:
  MFC r357040: 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().
  
  Sponsored by:	Panzura

Modified:
  stable/12/sys/dev/virtio/scsi/virtio_scsi.c
  stable/12/sys/dev/virtio/scsi/virtio_scsivar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/virtio/scsi/virtio_scsi.c
==============================================================================
--- stable/12/sys/dev/virtio/scsi/virtio_scsi.c	Thu Feb 27 14:50:02 2020	(r358384)
+++ stable/12/sys/dev/virtio/scsi/virtio_scsi.c	Thu Feb 27 14:52:55 2020	(r358385)
@@ -940,7 +940,7 @@ vtscsi_cam_path_inquiry(struct vtscsi_softc *sc, struc
 
 	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);

Modified: stable/12/sys/dev/virtio/scsi/virtio_scsivar.h
==============================================================================
--- stable/12/sys/dev/virtio/scsi/virtio_scsivar.h	Thu Feb 27 14:50:02 2020	(r358384)
+++ stable/12/sys/dev/virtio/scsi/virtio_scsivar.h	Thu Feb 27 14:52:55 2020	(r358385)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002271452.01REqtiF066425>