Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1374568 > unrolled thread

[PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments

Started by"Nicholas A. Bellinger" <nab@daterainc.com>
First post2016-04-09 05:20 +0200
Last post2016-04-11 22:40 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments "Nicholas A. Bellinger" <nab@daterainc.com> - 2016-04-09 05:20 +0200
    Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags  assignments Sagi Grimberg <sagi@grimberg.me> - 2016-04-10 15:50 +0200
    Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags  assignments Christoph Hellwig <hch@lst.de> - 2016-04-10 17:10 +0200
      Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-04-11 22:30 +0200
    Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-04-11 22:40 +0200

#1374568 — [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments

From"Nicholas A. Bellinger" <nab@daterainc.com>
Date2016-04-09 05:20 +0200
Subject[PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
Message-ID<rlRBf-78x-1@gated-at.bofh.it>
From: Nicholas Bellinger <nab@linux-iscsi.org>

While doing recent bring-up of nvme/host with target-core T10-PI,
I noticed /sys/block/nvme*/integrity/device_is_integrity_capable
was false, and /sys/block/nvme*/integrity/tag_size contained
a bogus value.

AFAICT outside of blk_integrity_compare() for DM + MD these
are informational values, but go ahead and add the missing
assignments for nvme/host to match what SCSI does within
sd_dif_config_host() for consistency's sake.

Cc: Keith Busch <keith.busch@intel.com>
Cc: Jay Freyensee <james.p.freyensee@intel.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Sagi Grimberg <sagig@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@fb.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index b8e22fe..cbd08f8 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -674,10 +674,14 @@ static void nvme_init_integrity(struct nvme_ns *ns)
 	switch (ns->pi_type) {
 	case NVME_NS_DPS_PI_TYPE3:
 		integrity.profile = &t10_pi_type3_crc;
+		integrity.tag_size = sizeof(u16) + sizeof(u32);
+		integrity.flags |= BLK_INTEGRITY_DEVICE_CAPABLE;
 		break;
 	case NVME_NS_DPS_PI_TYPE1:
 	case NVME_NS_DPS_PI_TYPE2:
 		integrity.profile = &t10_pi_type1_crc;
+		integrity.tag_size = sizeof(u16);
+		integrity.flags |= BLK_INTEGRITY_DEVICE_CAPABLE;
 		break;
 	default:
 		integrity.profile = NULL;
-- 
1.9.1

[toc] | [next] | [standalone]


#1374777 — Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments

FromSagi Grimberg <sagi@grimberg.me>
Date2016-04-10 15:50 +0200
SubjectRe: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
Message-ID<rmnUv-5P1-19@gated-at.bofh.it>
In reply to#1374568
Looks fine,

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

[toc] | [prev] | [next] | [standalone]


#1374799 — Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments

FromChristoph Hellwig <hch@lst.de>
Date2016-04-10 17:10 +0200
SubjectRe: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
Message-ID<rmp9U-6X6-1@gated-at.bofh.it>
In reply to#1374568
Does NVMe really force ATO=1?  Sorry, didn't have much time to spend
with that part of the spec.

[toc] | [prev] | [next] | [standalone]


#1376272

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-04-11 22:30 +0200
Message-ID<rmQD8-3mh-11@gated-at.bofh.it>
In reply to#1374799
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

Christoph> Does NVMe really force ATO=1?

It does.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [next] | [standalone]


#1376278

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-04-11 22:40 +0200
Message-ID<rmQMO-3pO-13@gated-at.bofh.it>
In reply to#1374568
>>>>> "Nicholas" == Nicholas A Bellinger <nab@daterainc.com> writes:

Nicholas> While doing recent bring-up of nvme/host with target-core
Nicholas> T10-PI, I noticed
Nicholas> /sys/block/nvme*/integrity/device_is_integrity_capable was
Nicholas> false, and /sys/block/nvme*/integrity/tag_size contained a
Nicholas> bogus value.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web