From: Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: "Martin K. Petersen"
<martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
Cc: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org,
linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
oren-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information
Date: Thu, 05 Jun 2014 20:29:12 +0300 [thread overview]
Message-ID: <5390A8E8.6080300@dev.mellanox.co.il> (raw)
In-Reply-To: <yq1wqcx3act.fsf-+q57XtR/GgMb6DWv4sQWN6xOck334EZe@public.gmane.org>
On 6/4/2014 1:18 AM, Martin K. Petersen wrote:
>>>>>> "Mike" == Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org> writes:
> Mike> On 06/01/2014 11:19 AM, Sagi Grimberg wrote:
>>> +/*
>>> + * data integrity helpers
>>> + */
>>> +static inline unsigned +iscsi_prot_len(unsigned data_len, unsigned
>>> sector_size) +{
>>> + switch (sector_size) {
>>> + case 512:
>>> + return (data_len >> 9) * 8;
>>> + case 1024:
>>> + return (data_len >> 10) * 8;
>>> + case 2048:
>>> + return (data_len >> 11) * 8;
>>> + case 4096:
>>> + return (data_len >> 12) * 8;
>>> + default:
>>> + return (data_len >> ilog2(sector_size)) * 8;
>>> + }
>>> +}
>>> #endif
> Mike> I do not think this should not be in the iscsi code.
>
> In the data integrity update I posted there's a flag saying "transfer PI
> on the wire". That was meant to be the thing driver's should key off of
> to adjust transfer length. But I'm also happy to provide a unsigned int
> scsi_transfer_length(struct scsi_cmnd *) thingy that returns the right
> byte count. Just bear in mind that the host-facing DIX transfer length
> may be different.
>
OK, let me prepare v1 moving this logic to a scsi helper and we'll have
another round of comments.
Thanks,
Sagi.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-06-05 17:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-01 16:19 [PATCH 0/2] Include protection information in iscsi header Sagi Grimberg
2014-06-01 16:19 ` [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information Sagi Grimberg
[not found] ` <1401639581-20111-2-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-06-03 16:06 ` Mike Christie
[not found] ` <538DF27F.50903-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2014-06-03 22:18 ` Martin K. Petersen
[not found] ` <yq1wqcx3act.fsf-+q57XtR/GgMb6DWv4sQWN6xOck334EZe@public.gmane.org>
2014-06-05 17:29 ` Sagi Grimberg [this message]
2014-06-03 16:11 ` Mike Christie
2014-06-05 17:26 ` Sagi Grimberg
2014-06-01 16:19 ` [PATCH 2/2] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire Sagi Grimberg
2014-06-02 16:54 ` Martin K. Petersen
2014-06-05 17:22 ` Sagi Grimberg
2014-06-03 6:16 ` [PATCH 0/2] Include protection information in iscsi header Roland Dreier
2014-06-03 7:56 ` Or Gerlitz
2014-06-05 17:25 ` Sagi Grimberg
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=5390A8E8.6080300@dev.mellanox.co.il \
--to=sagig-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org \
--cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org \
--cc=oren-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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