From owner-freebsd-scsi@freebsd.org Thu Feb 6 16:49:33 2020 Return-Path: Delivered-To: freebsd-scsi@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 1991F230444 for ; Thu, 6 Feb 2020 16:49:33 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D4Cc0qYCz4FnY for ; Thu, 6 Feb 2020 16:49:31 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3B3E9220F4 for ; Thu, 6 Feb 2020 11:49:31 -0500 (EST) Received: from imap36 ([10.202.2.86]) by compute6.internal (MEProxy); Thu, 06 Feb 2020 11:49:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=MYeJq0AIKVI6c8I8pRI3M3n5uc/EpNV QQdZ7HoChsGA=; b=CfZNKjbqz8Ok3agsEIYUg0kcNTxp4BeWgbZ/DQwTn8zvT1v UfTiXgAQWaBgn+QnRe/2ZRXqg5g2fWIdpTe8YOMp2cVx1sSbCsoxeR7Ts6FCfGda 5lNSchRU7cwD9z6aIdfCUJIduQHmvmjo3wrXTRea9ausdf/xwASHN/SOp9Y/3ZGe MtEwN1nBQSNmKIq8GZrRQBlErv7ttTlngA7o3Z5O/nq7bjOfqFQ0Uefhy+GtNTCb iVAn8AhSVOLcEMnir7q2h445rNg4Pc1dDcQg442ka2tQNKbBlRZLbno3GxdNL6oG +oGdhTwhAn2Ixs4EM6pIn4F8IfxfeWeFDYHSRNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=MYeJq0 AIKVI6c8I8pRI3M3n5uc/EpNVQQdZ7HoChsGA=; b=IFgrrw3E8EI+YvXFDfBVDS CebyYnBOCUKjelfU74aMFJNlvgGvNBB4oMHhB3hb87/CC8fGnzroKFANIwqTXLNQ 9IBvXKL5ITQ8e7PwBKyx9WfcJfAScJwidGiSAo+o9WWIP8aWbnzfaPpVC3ZjLBoh zLOAX6FIqG/3lef9YuPnnrl7SKItDw0u3/EPPg2S3kC102WtnHrn5L9qphfl+SXj W8eJw0blo92CalzAJoysdyO0v+9hU4m/PU+TmpmJoqMSVbZmJqUD/Voq7Q14EqON BQ1tBP3+CCb2CZ1Z3Niv4n+NsW3BgP41XBkaNj7/yBS8uIvc6dqszgslq200IeUg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrheefgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesthdtre dtreertdenucfhrhhomhepfdfutghothhtucfnohhnghdfuceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehsrghm shgtohdrohhrgh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id D66C0188005E; Thu, 6 Feb 2020 11:49:30 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-802-g7a41c81-fmstable-20200203v1 Mime-Version: 1.0 Message-Id: <120a0424-6998-4f7f-aef1-849f0b59aa0a@www.fastmail.com> In-Reply-To: References: Date: Thu, 06 Feb 2020 09:49:36 -0700 From: "Scott Long" To: freebsd-scsi@freebsd.org Subject: Re: [wtf] vtscsi aka virtio_scsi does not see disk at target 7 Content-Type: text/plain X-Rspamd-Queue-Id: 48D4Cc0qYCz4FnY X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm2 header.b=CfZNKjbq; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=IFgrrw3E; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.26 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-5.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm2,messagingengine.com:s=fm2]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[26.4.111.66.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.26]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-scsi@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[samsco.org]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; IP_SCORE(-3.49)[ip: (-9.81), ipnet: 66.111.4.0/24(-4.89), asn: 11403(-2.68), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[26.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 16:49:33 -0000 Hi Andre, sorry for the delay in responding. I agree that initiator_id needs to be ignored. This problem has been avoided in other controllers like mps/mpr by setting the intiator_id to a very high value. Setting it to 0 is liable to be problematic, so it could be set to 254, since 253 is the max target according to the spec. So which would you prefer for now, should vtscsi be changed to give a more correct initiator_id value, or should scsi_xpt.c be changed to ignore the value? Scott -- Scott Long scottl@samsco.org On Thu, Feb 6, 2020, at 3:06 AM, Andriy Gapon wrote: > > By the way, quite a long time ago, on Wed Sep 26 00:57:10 UTC 2012 Jim Harris > suggested this: > > I'm wondering if the scsi_xpt.c code > > should instead (or also) ignore the initiator_id if cpi->transport == > > XPORT_SAS? initiator_id isn't really valid for SAS transport. > > I think that that proposal still makes sense and we should go for it. > Any objections? > > > On 16/01/2020 17:27, Andriy Gapon wrote: > > > > I think I see what's going on, but it was a WTF moment for me. > > > > We use virtio_scsi driver on GCE VMs. We typically configure VMs with 6 or less > > disks, but recently we started to use VMs with 8+ disks. On some of them, after > > a reboot, one disk is missing. Here is an example: > > > > # camcontrol devlist -v > > scbus0 on vtscsi0 bus 0: > > at scbus0 target 1 lun 0 (pass0,da0) > > at scbus0 target 2 lun 0 (pass1,da1) > > at scbus0 target 3 lun 0 (pass2,da2) > > at scbus0 target 4 lun 0 (pass3,da3) > > at scbus0 target 5 lun 0 (pass4,da4) > > at scbus0 target 6 lun 0 (pass5,da5) > > at scbus0 target 8 lun 0 (pass6,da6) > > at scbus0 target 9 lun 0 (pass7,da7) > > > > We noticed that it is always target 7 that is missing. > > > > After looking at the code, the problem is kind of obvious. > > scsi_scan_bus: > > for (i = low_target; i <= max_target; i++) { > > cam_status status; > > > > if (i == initiator_id) > > continue; > > > > vtscsi_cam_path_inquiry: > > cpi->initiator_id = VTSCSI_INITIATOR_ID; > > > > /* > > * Specification doesn't say, use traditional SCSI default. > > */ > > #define VTSCSI_INITIATOR_ID 7 > > > > From what I see, on GCE at least, target 7 is a valid target and it is not > > reserved for the initiator. At the same time, I see that target 0 is never used > > for disks. Also, it seems that virtio configuration gives 253 as the maximum > > target ID on those instances. > > > > I would appreciate any suggestions on what to use for initiator_id in this > > driver. Thanks! > > > > > -- > Andriy Gapon > _______________________________________________ > freebsd-scsi@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" >