From: Max Gurtovoy <maxg@mellanox.com>
To: Jens Axboe <axboe@kernel.dk>, <keith.busch@intel.com>,
<linux-nvme@lists.infradead.org>, <sagi@grimberg.me>,
<hch@lst.de>, <martin.petersen@oracle.com>,
<linux-block@vger.kernel.org>
Cc: <vladimirk@mellanox.com>
Subject: Re: [PATCH v4 1/3] block: move ref_tag calculation func to the block layer
Date: Sun, 29 Jul 2018 01:12:04 +0300 [thread overview]
Message-ID: <f4fd6fd9-bc80-7c27-9a81-c09edbca8a4e@mellanox.com> (raw)
In-Reply-To: <165f5bbe-168f-cd15-8fd0-d464aca64414@kernel.dk>
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
}
extern const struct blk_integrity_profile t10_pi_type1_crc;
next prev parent reply other threads:[~2018-07-28 22:12 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 [this message]
2018-07-28 22:22 ` Jens Axboe
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=f4fd6fd9-bc80-7c27-9a81-c09edbca8a4e@mellanox.com \
--to=maxg@mellanox.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=martin.petersen@oracle.com \
--cc=sagi@grimberg.me \
--cc=vladimirk@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox