target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michael.christie@oracle.com
To: lduncan@suse.com, target-devel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	dbond@suse.com, hare@suse.de, cleech@redhat.com
Subject: Re: [PATCH 1/2] scsi: target: iscsi: handle SCSI immediate commands
Date: Mon, 11 Mar 2024 11:18:09 -0500	[thread overview]
Message-ID: <3e852dfa-6d21-4c68-89cc-43343d07e5e3@oracle.com> (raw)
In-Reply-To: <dc0006176e90cf3fb90e5b1c1917b54fe07c91cd.1701540918.git.lduncan@suse.com>

On 12/7/23 11:42 AM, lduncan@suse.com wrote:
> From: Lee Duncan <lduncan@suse.com>
> 
> Some iSCSI initiators send SCSI PDUs with the "immediate" bit
> set, and this is allowed according to RFC 3720. Commands with
> the "Immediate" bit set are called "immediate commands". From
> section 3.2.2.1. "Command Numbering and Acknowledging":
> 
>     The target MUST NOT transmit a MaxCmdSN that is less than
>     ExpCmdSN-1.  For non-immediate commands, the CmdSN field can take any
>     value from ExpCmdSN to MaxCmdSN inclusive.  The target MUST silently
>     ignore any non-immediate command outside of this range or non-
>     immediate duplicates within the range.  The CmdSN carried by
>     immediate commands may lie outside the ExpCmdSN to MaxCmdSN range.
>     For example, if the initiator has previously sent a non-immediate
>     command carrying the CmdSN equal to MaxCmdSN, the target window is
>     closed.  For group task management commands issued as immediate
>     commands, CmdSN indicates the scope of the group action (e.g., on
>     ABORT TASK SET indicates which commands are aborted).
> 
> This fixed an issue with fastlinq qedi Converged Network Adapter
> initiator firmware, trying to use an LIO target for booting. These
> changes made booting possible, with or without ImmediateData enabled.
> 

This is taking me a really long time to review because I've never looked 
at some of these code paths.

Have you tested the error cases?

What happens for a scsi command that's marked with the immediate bit and:
1. We get an abort and
	1.A The scsi command has completed?
	1.B The scsi command is being completed?

	For example, if the command we want to abort is not in the window, does 
iscsit_find_cmd_from_itt just not find the command and do we just return 
ISCSI_TMF_RSP_NO_TASK so the initiator will just escalate to lun reset.

2. For lun reset and abort, if the scsi command we want to abort/reset 
is not in the window (let's say it's cmdsn is higher than max_cmd_sn), 
does the iscsi layer complete the scsi command then complete the TMF or 
if the TMF has a lower cmdsn than the scsi command does the iscsi layer 
complete the scsi command then the TMF?

3. What happens for 1 and 2 and ERL 2 is used so we have 
ISCSI_TM_FUNC_TASK_REASSIGN and maybe are hitting the out of order code 
as well? Does it work ok?

  parent reply	other threads:[~2024-03-11 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 17:42 [PATCH 0/2] scsi: target: iscsi: Fix two protocol issues lduncan
2023-12-07 17:42 ` [PATCH 1/2] scsi: target: iscsi: handle SCSI immediate commands lduncan
2023-12-13 20:06   ` Chris Leech
2023-12-14  1:24     ` Lee Duncan
2023-12-14 20:29       ` Chris Leech
2024-01-17 21:09         ` Lee Duncan
2024-03-11 16:18   ` michael.christie [this message]
2023-12-07 17:42 ` [PATCH 2/2] scsi: target: iscsi: don't warn of R/W when no data lduncan
2024-03-09 18:05   ` Lee Duncan
2024-03-11 15:59   ` michael.christie
2024-01-26 17:42 ` [PATCH 0/2] scsi: target: iscsi: Fix two protocol issues Lee Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e852dfa-6d21-4c68-89cc-43343d07e5e3@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=cleech@redhat.com \
    --cc=dbond@suse.com \
    --cc=hare@suse.de \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).