All of lore.kernel.org
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: minoura@valinux.co.jp
Cc: stgt@vger.kernel.org
Subject: Re: ExpCmdSn and MaxCmdSn in ISCSI_OP_R2T
Date: Mon, 26 Jan 2015 12:58:57 +0900 (JST)	[thread overview]
Message-ID: <20150126.125857.1568838937885762852.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <kk5twzeb3q2.fsf@brer.local.valinux.co.jp>

On Mon, 26 Jan 2015 12:49:57 +0900
MINOURA Makoto / 箕浦 真 <minoura@valinux.co.jp> wrote:

> 
> |> In <kk5iofyfjem.fsf@brer.local.valinux.co.jp>
> |>  "MINOURA Makoto / 箕浦 真" <minoura@valinux.co.jp> wrote:
> 
>> tgtd does not send ExpCmdSn and MaxCmdSn with OP_R2T (Ready
>> To Transfer) operations.  Is this behaviour correct?
> 
> I found the following in 3.5.1.6. Ready To Transfer (R2T),
> RFC 3720.
> 
> ---- 
> R2T also carries information required for proper operation
> of the iSCSI protocol, such as:
> 
>      - R2TSN (to enable an initiator to detect a missing R2T)
>      - StatSN
>      - ExpCmdSN
>      - MaxCmdSN
> ---- 
> 
> Thus I think it is a bug in tgtd not in the Linux initiator.
> 
> 
>> At least Linux (RHEL6.2) initiators take 0 MaxCmdSn value
>> and get confused.
> 
> Linux initiator ensures on updating CmdSn's that the new
> value is greater (in terms of RFC1982) than the previous.
> When the previous value is less than 0x80000000 the new
> value 0 is less than the previous and is simply ignored.
> Once the session's MaxCmdSn counts up to 0x80000000, it is
> updated to 0 (greater than the previous) when tgtd sends an
> R2T.  The next CmdSn should be around 0x7fffff80, which is
> greater than the MaxCmdSn value (0), and flow control works
> to prevent sending the next command.
> 
> If there's no R2T in the small window where MaxCmdSn >= 0x80000000
> and CmdSn < 0x80000000 probably nothing happens except
> that MaxCmdSn flow control would not work (no limit) until
> the actual MaxCmdSn wraps to 0.

Applied, thanks a lot for the detailed investigation!

  reply	other threads:[~2015-01-26  3:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  0:08 ExpCmdSn and MaxCmdSn in ISCSI_OP_R2T MINOURA Makoto / 箕浦 真
2015-01-26  3:49 ` MINOURA Makoto / 箕浦 真
2015-01-26  3:58   ` FUJITA Tomonori [this message]
2015-01-26  6:53     ` MINOURA Makoto / 箕浦 真

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=20150126.125857.1568838937885762852.fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=minoura@valinux.co.jp \
    --cc=stgt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.