From owner-svn-src-stable-12@freebsd.org Thu Feb 27 14:52:56 2020 Return-Path: Delivered-To: svn-src-stable-12@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 DF631243A1D; Thu, 27 Feb 2020 14:52: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 48SwdN41yyz4KMq; Thu, 27 Feb 2020 14:52: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 57E041A724; Thu, 27 Feb 2020 14:52: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 01REqu6a066427; Thu, 27 Feb 2020 14:52:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01REqtiF066425; Thu, 27 Feb 2020 14:52:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202002271452.01REqtiF066425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Feb 2020 14:52:55 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/virtio/scsi X-SVN-Commit-Revision: 358385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 14:52:57 -0000 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