All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	axboe@fb.com, nab@daterainc.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 05/14] block: Deprecate the use of the term sector in the context of block integrity
Date: Thu, 03 Jul 2014 13:19:37 +0300	[thread overview]
Message-ID: <53B52E39.1080309@dev.mellanox.co.il> (raw)
In-Reply-To: <53B523FA.2000001@dev.mellanox.co.il>

On 7/3/2014 12:35 PM, Sagi Grimberg wrote:
> On 5/29/2014 6:28 AM, Martin K. Petersen wrote:
>> The protection interval is not necessarily tied to the logical block
>> size of a block device. Stop using the terms sector and sectors.
>>
>> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
>> ---
>>   block/bio-integrity.c  | 46 
>> +++++++++++++++++++++-------------------------
>>   block/blk-integrity.c  | 10 +++++-----
>>   drivers/scsi/sd_dif.c  | 46 
>> +++++++++++++++++++++++-----------------------
>>   include/linux/blkdev.h |  6 +++---
>>   4 files changed, 52 insertions(+), 56 deletions(-)
>>
>> diff --git a/block/bio-integrity.c b/block/bio-integrity.c
>> index e06b3c807eef..c52a8fd98706 100644
>> --- a/block/bio-integrity.c
>> +++ b/block/bio-integrity.c
>> @@ -191,29 +191,25 @@ bool bio_integrity_enabled(struct bio *bio)
>>   EXPORT_SYMBOL(bio_integrity_enabled);
>>     /**
>> - * bio_integrity_hw_sectors - Convert 512b sectors to hardware ditto
>> + * bio_integrity_intervals - Return number of integrity intervals 
>> for a bio
>>    * @bi:        blk_integrity profile for device
>> - * @sectors:    Number of 512 sectors to convert
>> + * @sectors:    Size of the bio in 512-byte sectors
>>    *
>>    * Description: The block layer calculates everything in 512 byte
>> - * sectors but integrity metadata is done in terms of the hardware
>> - * sector size of the storage device.  Convert the block layer sectors
>> - * to physical sectors.
>> + * sectors but integrity metadata is done in terms of the data 
>> integrity
>> + * interval size of the storage device.  Convert the block layer 
>> sectors
>> + * to the appropriate number of integrity intervals.
>>    */
>> -static inline unsigned int bio_integrity_hw_sectors(struct 
>> blk_integrity *bi,
>> -                            unsigned int sectors)
>> +static inline unsigned int bio_integrity_intervals(struct 
>> blk_integrity *bi,
>> +                           unsigned int sectors)
>>   {
>> -    /* At this point there are only 512b or 4096b DIF/EPP devices */
>> -    if (bi->sector_size == 4096)
>> -        return sectors >>= 3;
>> -
>> -    return sectors;
>> +    return sectors >> (ilog2(bi->interval) - 9);
>>   }
>
> Now that protection information interval does not necessarily match 
> the sector_size, should this routine
> protect against bogus bi->interval (e.g. fail if bi->interval < 
> sector_size for example)? Not sure
> if this check is really needed here, but it might be useful to have 
> (although protection interval
> is still effectively sector_size).
>

For v1 scsi_transfer_length should also be modified to use protection 
interval.

Sagi.

  reply	other threads:[~2014-07-03 10:19 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29  3:28 Data integrity update Martin K. Petersen
2014-05-29  3:28 ` [PATCH 01/14] block: Get rid of bdev_integrity_enabled() Martin K. Petersen
2014-06-11 16:31   ` Christoph Hellwig
2014-07-03  9:18     ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 02/14] block: Replace bi_integrity with bi_special Martin K. Petersen
2014-06-11 16:32   ` Christoph Hellwig
2014-06-12  0:18     ` Martin K. Petersen
2014-07-03  9:19       ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 03/14] block: Deprecate integrity tagging functions Martin K. Petersen
2014-06-11 16:33   ` Christoph Hellwig
2014-06-12  0:18     ` Martin K. Petersen
2014-05-29  3:28 ` [PATCH 04/14] block: Remove bip_buf Martin K. Petersen
2014-06-11 16:35   ` Christoph Hellwig
2014-07-03  9:21     ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 05/14] block: Deprecate the use of the term sector in the context of block integrity Martin K. Petersen
2014-06-11 16:45   ` Christoph Hellwig
2014-06-12  0:26     ` Martin K. Petersen
2014-07-03  9:35   ` Sagi Grimberg
2014-07-03 10:19     ` Sagi Grimberg [this message]
2014-05-29  3:28 ` [PATCH 06/14] block: Clean up the code used to generate and verify integrity metadata Martin K. Petersen
2014-07-03  9:40   ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 07/14] block: Add prefix to block integrity profile flags Martin K. Petersen
2014-06-11 16:46   ` Christoph Hellwig
2014-07-03  9:42   ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 08/14] block: Add a disk flag to block integrity profile Martin K. Petersen
2014-06-11 16:48   ` Christoph Hellwig
2014-06-12  1:30     ` Martin K. Petersen
2014-06-25 10:24       ` Christoph Hellwig
2014-06-25 11:49         ` Martin K. Petersen
2014-07-03  9:58           ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 09/14] block: Relocate integrity flags Martin K. Petersen
2014-06-11 16:51   ` Christoph Hellwig
2014-06-12  1:51     ` Martin K. Petersen
2014-07-03 10:03   ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 10/14] block: Integrity checksum flag Martin K. Petersen
2014-06-11 16:52   ` Christoph Hellwig
2014-06-12  2:03     ` Martin K. Petersen
2014-05-29  3:28 ` [PATCH 11/14] block: Don't merge requests if integrity flags differ Martin K. Petersen
2014-06-11 16:53   ` Christoph Hellwig
2014-07-03 10:06   ` Sagi Grimberg
2014-05-29  3:28 ` [PATCH 12/14] block: Add specific data integrity errors Martin K. Petersen
2014-06-11 16:54   ` Christoph Hellwig
2014-06-12  2:16     ` Martin K. Petersen
2014-06-12  2:16       ` Martin K. Petersen
2014-05-29  3:28 ` [PATCH 13/14] lib: Add T10 Protection Information functions Martin K. Petersen
2014-06-11 16:56   ` Christoph Hellwig
2014-06-12  2:23     ` Martin K. Petersen
2014-05-29  3:28 ` [PATCH 14/14] sd: Honor block layer integrity handling flags Martin K. Petersen
2014-07-25 20:34 Block/SCSI data integrity update v2 Martin K. Petersen
2014-07-25 20:34 ` [PATCH 05/14] block: Deprecate the use of the term sector in the context of block integrity Martin K. Petersen
2014-07-26 15:25   ` Christoph Hellwig
2014-08-06 13:32   ` Sagi Grimberg
2014-08-06 13:43     ` Sagi Grimberg
2014-08-28 19:31 Block/SCSI data integrity update v3 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

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=53B52E39.1080309@dev.mellanox.co.il \
    --to=sagig@dev.mellanox.co.il \
    --cc=axboe@fb.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nab@daterainc.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.