From owner-svn-src-all@freebsd.org Thu Jan 23 10:13:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF6932346F0; Thu, 23 Jan 2020 10:13:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483J5c5JHDz4QVC; Thu, 23 Jan 2020 10:13:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13CFD0C9; Thu, 23 Jan 2020 10:13:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00NADuoG052235; Thu, 23 Jan 2020 10:13:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NADuBS052233; Thu, 23 Jan 2020 10:13:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202001231013.00NADuBS052233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Jan 2020 10:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357040 - head/sys/dev/virtio/scsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/virtio/scsi X-SVN-Commit-Revision: 357040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jan 2020 10:13:56 -0000 Author: avg Date: Thu Jan 23 10:13:56 2020 New Revision: 357040 URL: https://svnweb.freebsd.org/changeset/base/357040 Log: 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 Modified: head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/virtio/scsi/virtio_scsivar.h Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jan 23 09:46:45 2020 (r357039) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jan 23 10:13:56 2020 (r357040) @@ -937,7 +937,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: head/sys/dev/virtio/scsi/virtio_scsivar.h ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jan 23 09:46:45 2020 (r357039) +++ head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jan 23 10:13:56 2020 (r357040) @@ -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