From owner-freebsd-scsi@FreeBSD.ORG Wed May 25 07:20:46 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45EA3106566C for ; Wed, 25 May 2011 07:20:46 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id 02BAA8FC1B for ; Wed, 25 May 2011 07:20:45 +0000 (UTC) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1QP8OZ-000CmK-GP; Wed, 25 May 2011 10:20:43 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: mj@feral.com In-reply-to: References: <4DDBB3F7.20303@feral.com> Comments: In-reply-to Matthew Jacob message dated "Tue, 24 May 2011 11:19:48 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 25 May 2011 10:20:43 +0300 From: Daniel Braniss Message-ID: Cc: freebsd-scsi@freebsd.org Subject: Re: iscsi_initiator and tag opening problem X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 07:20:46 -0000 > > > > it's a CAM thing not PDU/BHS, or at least that is my undertanding. > > myabe it's time to read the RFC again > > > > No, what I meant can be seen in the following from iscsi_subr.c: > > /* > | map tag option, default is UNTAGGED > */ > switch(csio->tag_action) { > case MSG_SIMPLE_Q_TAG: cmd->attr = iSCSI_TASK_SIMPLE; break; > case MSG_HEAD_OF_Q_TAG: cmd->attr = iSCSI_TASK_HOFQ; break; > case MSG_ORDERED_Q_TAG: cmd->attr = iSCSI_TASK_ORDER; break; > case MSG_ACA_TASK: cmd->attr = iSCSI_TASK_ACA; break; > } > how emabarrassing! in my defense I wrote this back in 2004 and never looked at it again :-) > > That is, you're translating from CAM to iSCSI task attributes. Or, rather, > iSCSI transport related task attributes. The same thing can be seen in the > isp FibreChannel driver: > > if (ttype == REQFLAG_OTAG) { > ttype = FCP_CMND_TASK_ATTR_ORDERED; > } else if (ttype == REQFLAG_HTAG) { > ttype = FCP_CMND_TASK_ATTR_HEAD; > } else { > ttype = FCP_CMND_TASK_ATTR_SIMPLE; > } > ((ispreqt7_t *)reqp)->req_task_attribute = ttype; > > (yes, mine is skipping ACA, oops) > > These are attributes of SAM task management. CAM, like any other SCSI > midlayer, is quite right to attach the specified attribute. Whether the > underlying transport can faithfully support those attributes is another > matter. is this somehow detectable? or a list of '[non]complaint' targets is needed? > > The RFC has the following: > > 3.5.1.1. SCSI-Command > > This request carries the SCSI CDB and all the other SCSI execute > command procedure call (see [SAM2]) IN arguments such as task > attributes, Expected Data Transfer Length for one or both transfer > directions > > This would imply that iSCSI is supposed to support task attributes. > > Now, it turns out that the linux openiscsi implementation only uses the > iSCSI_TASK_SIMPLE attribute, so perhaps the simplest fix here is to just > do that for the FreeBSD initiator driver. any side effects? or should I make it tunable? Thanks Matthew, you made my day! danny