From owner-freebsd-scsi@FreeBSD.ORG Tue May 24 18:20:27 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 981B11065670 for ; Tue, 24 May 2011 18:20:27 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 413838FC16 for ; Tue, 24 May 2011 18:20:26 +0000 (UTC) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.14.4/8.14.4) with ESMTP id p4OIJnUr040365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 May 2011 11:19:49 -0700 (PDT) (envelope-from mj@feral.com) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.14.4/8.14.4/Submit) with ESMTP id p4OIJmuQ040362; Tue, 24 May 2011 11:19:49 -0700 (PDT) (envelope-from mj@feral.com) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Tue, 24 May 2011 11:19:48 -0700 (PDT) From: Matthew Jacob To: Daniel Braniss In-Reply-To: Message-ID: References: <4DDBB3F7.20303@feral.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (ns1.feral.com [127.0.0.1]); Tue, 24 May 2011 11:19:49 -0700 (PDT) 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 Reply-To: mj@feral.com List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 18:20:27 -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; } 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. 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.