From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, axboe@fb.com
Cc: hch@lst.de, sagig@mellanox.com
Subject: Re: [PATCH 14/14] sd: Honor block layer integrity handling flags
Date: Mon, 01 Sep 2014 00:17:51 +0300 [thread overview]
Message-ID: <540390FF.2040703@dev.mellanox.co.il> (raw)
In-Reply-To: <1409254292-2540-15-git-send-email-martin.petersen@oracle.com>
On 8/28/2014 10:31 PM, Martin K. Petersen wrote:
> A set of flags introduced in the block layer enable better control over
> how protection information is handled. These flags are useful for both
> error injection and data recovery purposes. Checking can be enabled and
> disabled for controller and disk, and the guard tag format is now a
> per-I/O property.
>
Hi Martin,
Not sure why I didn't post a review for this one...
Anyway sorry, I hope it's not too late...
just two comments below.
> Update sd_protect_op to communicate the relevant information to the
> low-level device driver via a set of flags in scsi_cmnd.
>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
> drivers/scsi/sd.c | 73 ++++++++++++++++++++++++++++--------------------
> drivers/scsi/sd.h | 66 +++++++++++++++++++++++++++++++++++++++++--
> drivers/scsi/sd_dif.c | 23 ++++++---------
> include/scsi/scsi_cmnd.h | 36 +++++++++++++++++-------
> 4 files changed, 142 insertions(+), 56 deletions(-)
>
<SNIP>
> +/*
> + * Returns a mask of the protection flags that are valid for a given DIX
> + * operation.
> + */
> +static inline unsigned int sd_prot_flag_mask(unsigned int prot_op)
> +{
> + const unsigned int flag_mask[] = {
> + [SCSI_PROT_NORMAL] = 0,
> +
> + [SCSI_PROT_READ_STRIP] = SCSI_PROT_TRANSFER_PI |
> + SCSI_PROT_GUARD_CHECK |
> + SCSI_PROT_REF_CHECK |
> + SCSI_PROT_REF_INCREMENT,
> +
> + [SCSI_PROT_READ_INSERT] = SCSI_PROT_REF_INCREMENT |
> + SCSI_PROT_IP_CHECKSUM,
> +
> + [SCSI_PROT_READ_PASS] = SCSI_PROT_TRANSFER_PI |
> + SCSI_PROT_GUARD_CHECK |
> + SCSI_PROT_REF_CHECK |
> + SCSI_PROT_REF_INCREMENT |
> + SCSI_PROT_IP_CHECKSUM,
> +
> + [SCSI_PROT_WRITE_INSERT] = SCSI_PROT_TRANSFER_PI |
> + SCSI_PROT_REF_INCREMENT,
> +
> + [SCSI_PROT_WRITE_STRIP] = SCSI_PROT_GUARD_CHECK |
> + SCSI_PROT_REF_CHECK |
> + SCSI_PROT_REF_INCREMENT |
> + SCSI_PROT_IP_CHECKSUM,
> +
> + [SCSI_PROT_WRITE_PASS] = SCSI_PROT_TRANSFER_PI |
> + SCSI_PROT_GUARD_CHECK |
> + SCSI_PROT_REF_CHECK |
> + SCSI_PROT_REF_INCREMENT |
> + SCSI_PROT_IP_CHECKSUM,
A bit strange to me that you put REF_CHECK & REF_INCREMENT flag
depending on the prot_op while it really depends on the prot_type.
It is &'nd with preset scmnd->prot_flags anyways.. so no worries...
> + };
> +
> + return flag_mask[prot_op];
> +}
> +
<SNIP>
> +/*
> +enum scsi_prot_flags {
> + SCSI_PROT_TRANSFER_PI = 1 << 0,
> + SCSI_PROT_GUARD_CHECK = 1 << 1,
> + SCSI_PROT_REF_CHECK = 1 << 2,
> + SCSI_PROT_REF_INCREMENT = 1 << 3,
> + SCSI_PROT_IP_CHECKSUM = 1 << 4,
I have a question here,
What are your plans with explicit ref/app escape flags?
Were these just left behind on this series?
Other than that, looks good.
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Sagi.
next prev parent reply other threads:[~2014-08-31 21:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 19:31 Block/SCSI data integrity update v3 Martin K. Petersen
2014-08-28 19:31 ` [PATCH 01/14] block: Get rid of bdev_integrity_enabled() Martin K. Petersen
2014-08-28 19:31 ` [PATCH 02/14] block: Replace bi_integrity with bi_special Martin K. Petersen
2014-08-28 19:31 ` [PATCH 03/14] block: Remove integrity tagging functions Martin K. Petersen
2014-08-28 19:31 ` [PATCH 04/14] block: Remove bip_buf Martin K. Petersen
2014-08-28 19:31 ` [PATCH 05/14] block: Deprecate the use of the term sector in the context of block integrity Martin K. Petersen
2014-08-28 19:31 ` [PATCH 06/14] block: Make protection interval calculation generic Martin K. Petersen
2014-08-28 19:31 ` [PATCH 07/14] block: Clean up the code used to generate and verify integrity metadata Martin K. Petersen
2014-08-28 19:31 ` [PATCH 08/14] block: Add prefix to block integrity profile flags Martin K. Petersen
2014-08-28 19:31 ` [PATCH 09/14] block: Add a disk flag to block integrity profile Martin K. Petersen
2014-08-28 19:31 ` [PATCH 10/14] block: Relocate bio integrity flags Martin K. Petersen
2014-08-28 19:31 ` [PATCH 11/14] block: Integrity checksum flag Martin K. Petersen
2014-08-28 19:31 ` [PATCH 12/14] block: Don't merge requests if integrity flags differ Martin K. Petersen
2014-08-28 19:31 ` [PATCH 13/14] block: Add T10 Protection Information functions Martin K. Petersen
2014-08-28 19:31 ` [PATCH 14/14] sd: Honor block layer integrity handling flags Martin K. Petersen
2014-08-31 21:17 ` Sagi Grimberg [this message]
2014-09-11 0:07 ` Martin K. Petersen
2014-09-11 7:09 ` Sagi Grimberg
2014-09-12 1:35 ` Martin K. Petersen
2014-09-12 13:20 ` Sagi Grimberg
2014-09-12 18:09 ` Martin K. Petersen
2014-08-28 20:10 ` Block/SCSI data integrity update v3 Jens Axboe
2014-08-29 0:43 ` Christoph Hellwig
2014-09-07 16:29 ` Christoph Hellwig
2014-09-08 15:50 ` Jens Axboe
2014-09-11 0:23 ` Martin K. Petersen
2014-09-12 18:16 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2014-07-25 20:34 Block/SCSI data integrity update v2 Martin K. Petersen
2014-07-25 20:34 ` [PATCH 14/14] sd: Honor block layer integrity handling flags Martin K. Petersen
2014-05-29 3:28 Data integrity update Martin K. Petersen
2014-05-29 3:28 ` [PATCH 14/14] sd: Honor block layer integrity handling flags 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=540390FF.2040703@dev.mellanox.co.il \
--to=sagig@dev.mellanox.co.il \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sagig@mellanox.com \
/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.