linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH v4 1/3] block: move ref_tag calculation func to the block layer
Date: Sat, 28 Jul 2018 16:22:42 -0600	[thread overview]
Message-ID: <d8fba6ff-c4c2-7a0f-5a8d-01aaf979f16e@kernel.dk> (raw)
In-Reply-To: <f4fd6fd9-bc80-7c27-9a81-c09edbca8a4e@mellanox.com>

On 7/28/18 4:12 PM, Max Gurtovoy wrote:
> 
> 
> On 7/27/2018 6:38 PM, Jens Axboe wrote:
>> On 7/27/18 9:21 AM, Jens Axboe wrote:
>>> On 7/25/18 9:46 AM, Max Gurtovoy wrote:
>>>> Currently this function is implemented in the scsi layer, but it's
>>>> actual place should be the block layer since T10-PI is a general
>>>> data integrity feature that is used in the nvme protocol as well.
>>>
>>> Applied 1-3 for 4.19.
>>
>> This:
>>
>> static inline u32 t10_pi_ref_tag(struct request *rq)
>> {
>>          return blk_rq_pos(rq) >>
>>                  (rq->q->integrity.interval_exp - 9) & 0xffffffff;
>> }
>>
>> won't work for !CONFIG_BLK_DEV_INTEGRITY. I didn't want to make the
>> change, but looks like it should either return -1U as we the value
>> should mean nothing if BLK_DEV_INTEGRITY isn't set, or just ignore the
>> shift and return blk_rq_pos(rq) & 0xffffffff.
>>
>> Please fixup and resend the series.
>>
> 
> will this be good enough:
> 
> diff --git a/include/linux/t10-pi.h b/include/linux/t10-pi.h
> index 81ae4c4..5a427c2 100644
> --- a/include/linux/t10-pi.h
> +++ b/include/linux/t10-pi.h
> @@ -39,8 +39,12 @@ struct t10_pi_tuple {
> 
>   static inline u32 t10_pi_ref_tag(struct request *rq)
>   {
> +#ifdef CONFIG_BLK_DEV_INTEGRITY
>          return blk_rq_pos(rq) >>
>                  (rq->q->integrity.interval_exp - 9) & 0xffffffff;
> +#else
> +       return -1U;
> +#endif
>   }

I think so, that looks fine to me.

-- 
Jens Axboe

      reply	other threads:[~2018-07-28 22:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 15:46 [PATCH v4 1/3] block: move ref_tag calculation func to the block layer Max Gurtovoy
2018-07-25 15:46 ` [PATCH v4 2/3] block: move dif_prepare/dif_complete functions to " Max Gurtovoy
2018-07-26  1:12   ` Martin K. Petersen
2018-07-25 15:46 ` [PATCH v4 3/3] nvme: use blk API to remap ref tags for IOs with metadata Max Gurtovoy
2018-07-25 17:58   ` Keith Busch
2018-07-26  1:12   ` Martin K. Petersen
2018-07-26  1:11 ` [PATCH v4 1/3] block: move ref_tag calculation func to the block layer Martin K. Petersen
2018-07-27 15:21 ` Jens Axboe
2018-07-27 15:38   ` Jens Axboe
2018-07-28 22:12     ` Max Gurtovoy
2018-07-28 22:22       ` Jens Axboe [this message]

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=d8fba6ff-c4c2-7a0f-5a8d-01aaf979f16e@kernel.dk \
    --to=axboe@kernel.dk \
    /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).