From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: Quinn Tran <quinn.tran@qlogic.com>,
"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
Sagi Grimberg <sagig@mellanox.com>
Cc: "michaelc@cs.wisc.edu" <michaelc@cs.wisc.edu>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"roland@kernel.org" <roland@kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire
Date: Wed, 11 Jun 2014 10:24:36 +0300 [thread overview]
Message-ID: <53980434.1000306@dev.mellanox.co.il> (raw)
In-Reply-To: <504EB66DAC8D234EB8E8560985C2D7AD46D1D00E@avmb2.qlogic.org>
On 6/11/2014 12:17 AM, Quinn Tran wrote:
<SNIP>
> QT> Instead of using existing value within cmd->data_length, can we
> calculated data_length based on secstors & blocksize.
>
> cmd->data_length = sectors * dev->dev_attrib.block_size;
We can do that I suppose...
Although it seems weird that the core discards the transport byte-count...
Just wandering if we should recalc on the DIF case only or always.
>
> From the QLogic perfective, the cmd->data_length is pull directly from the
> wire (i.e. FCP header) when cmd is received. In essence, it's whatever
> the Initiator is set it to. We does not have any indicator to spot DIF vs
> none-DIF cmd when 1st received, unless the code do a peek.
Same for all transports I assume...
>
> With that said, the cmd->data_length does not guarantee to contain both
> "data length" & "protection length" when cmd is submit to
> TCM/target_submit_cmd(). In Dif-Insert mode, data_length will only
> contain the actual data(no Dif).
No, in the DOUT_INSERT/DIN_STRIP case, protect bits are off and the core
will take the data length as is.
This case is covered.
> It's best that the SBC code re-calculate the actual data length and dif
> data length based on the number of sectors derived from the cmd.
Nic, what's your take on this?
Sagi.
next prev parent reply other threads:[~2014-06-11 7:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-08 10:27 [PATCH v1 0/3] Include protection information in iscsi header Sagi Grimberg
2014-06-08 10:27 ` [PATCH v1 1/3] scsi_cmnd: Introduce scsi_transfer_length helper Sagi Grimberg
[not found] ` <1402223228-23768-2-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-06-10 19:02 ` Martin K. Petersen
2014-06-10 19:16 ` Sagi Grimberg
[not found] ` <yq1fvjcvb8f.fsf-+q57XtR/GgMb6DWv4sQWN6xOck334EZe@public.gmane.org>
2014-06-10 20:19 ` Or Gerlitz
2014-06-10 20:21 ` Martin K. Petersen
[not found] ` <1402223228-23768-1-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-06-08 10:27 ` [PATCH v1 2/3] libiscsi, iser: Adjust data_length to include protection information Sagi Grimberg
2014-06-10 18:19 ` Mike Christie
2014-06-10 8:10 ` [PATCH v1 0/3] Include protection information in iscsi header Nicholas A. Bellinger
2014-06-08 10:27 ` [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire Sagi Grimberg
2014-06-10 8:04 ` Nicholas A. Bellinger
2014-06-10 8:12 ` Paolo Bonzini
2014-06-10 21:17 ` Quinn Tran
2014-06-11 7:24 ` Sagi Grimberg [this message]
2014-06-11 21:30 ` Nicholas A. Bellinger
2014-06-11 22:32 ` Quinn Tran
[not found] ` <504EB66DAC8D234EB8E8560985C2D7AD46D1D8C7-vcA9p2Eq0686wu3ARrlbmA@public.gmane.org>
2014-06-12 4:01 ` Nicholas A. Bellinger
[not found] ` <1402522215.17740.29.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
2014-06-11 23:20 ` Martin K. Petersen
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=53980434.1000306@dev.mellanox.co.il \
--to=sagig@dev.mellanox.co.il \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michaelc@cs.wisc.edu \
--cc=mst@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=pbonzini@redhat.com \
--cc=quinn.tran@qlogic.com \
--cc=roland@kernel.org \
--cc=sagig@mellanox.com \
--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).