All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
@ 2016-04-09  3:04 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 10+ messages in thread
From: Nicholas A. Bellinger @ 2016-04-09  3:04 UTC (permalink / raw)
  To: linux-nvme
  Cc: target-devel, linux-kernel, Nicholas Bellinger, Keith Busch,
	Jay Freyensee, Martin K. Petersen, Sagi Grimberg,
	Christoph Hellwig, Jens Axboe

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
@ 2016-04-09  3:04 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 10+ messages in thread
From: Nicholas A. Bellinger @ 2016-04-09  3:04 UTC (permalink / raw)


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 at intel.com>
Cc: Jay Freyensee <james.p.freyensee at intel.com>
Cc: Martin K. Petersen <martin.petersen at oracle.com>
Cc: Sagi Grimberg <sagig at grimberg.me>
Cc: Christoph Hellwig <hch at lst.de>
Cc: Jens Axboe <axboe at fb.com>
Signed-off-by: Nicholas Bellinger <nab at 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
  2016-04-09  3:04 ` Nicholas A. Bellinger
@ 2016-04-10 13:47   ` Sagi Grimberg
  -1 siblings, 0 replies; 10+ messages in thread
From: Sagi Grimberg @ 2016-04-10 13:47 UTC (permalink / raw)
  To: Nicholas A. Bellinger, linux-nvme
  Cc: target-devel, linux-kernel, Nicholas Bellinger, Keith Busch,
	Jay Freyensee, Martin K. Petersen, Sagi Grimberg,
	Christoph Hellwig, Jens Axboe

Looks fine,

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
@ 2016-04-10 13:47   ` Sagi Grimberg
  0 siblings, 0 replies; 10+ messages in thread
From: Sagi Grimberg @ 2016-04-10 13:47 UTC (permalink / raw)


Looks fine,

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
  2016-04-09  3:04 ` Nicholas A. Bellinger
@ 2016-04-10 14:59   ` Christoph Hellwig
  -1 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2016-04-10 14:59 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: linux-nvme, target-devel, linux-kernel, Nicholas Bellinger,
	Keith Busch, Jay Freyensee, Martin K. Petersen, Sagi Grimberg,
	Christoph Hellwig, Jens Axboe

Does NVMe really force ATO=1?  Sorry, didn't have much time to spend
with that part of the spec.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
@ 2016-04-10 14:59   ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2016-04-10 14:59 UTC (permalink / raw)


Does NVMe really force ATO=1?  Sorry, didn't have much time to spend
with that part of the spec.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
  2016-04-09  3:04 ` Nicholas A. Bellinger
@ 2016-04-11 20:27   ` Martin K. Petersen
  -1 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2016-04-11 20:27 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: linux-nvme, target-devel, linux-kernel, Nicholas Bellinger,
	Keith Busch, Jay Freyensee, Martin K. Petersen, Sagi Grimberg,
	Christoph Hellwig, Jens Axboe

>>>>> "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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
@ 2016-04-11 20:27   ` Martin K. Petersen
  0 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2016-04-11 20:27 UTC (permalink / raw)


>>>>> "Nicholas" == Nicholas A Bellinger <nab at 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 at oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
  2016-04-10 14:59   ` Christoph Hellwig
@ 2016-04-11 20:28     ` Martin K. Petersen
  -1 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2016-04-11 20:28 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Nicholas A. Bellinger, linux-nvme, target-devel, linux-kernel,
	Nicholas Bellinger, Keith Busch, Jay Freyensee,
	Martin K. Petersen, Sagi Grimberg, Jens Axboe

>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

Christoph> Does NVMe really force ATO=1?

It does.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments
@ 2016-04-11 20:28     ` Martin K. Petersen
  0 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2016-04-11 20:28 UTC (permalink / raw)


>>>>> "Christoph" == Christoph Hellwig <hch at lst.de> writes:

Christoph> Does NVMe really force ATO=1?

It does.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-11 20:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-09  3:04 [PATCH] nvme/host: Add missing blk_integrity tag_size + flags assignments Nicholas A. Bellinger
2016-04-09  3:04 ` Nicholas A. Bellinger
2016-04-10 13:47 ` Sagi Grimberg
2016-04-10 13:47   ` Sagi Grimberg
2016-04-10 14:59 ` Christoph Hellwig
2016-04-10 14:59   ` Christoph Hellwig
2016-04-11 20:28   ` Martin K. Petersen
2016-04-11 20:28     ` Martin K. Petersen
2016-04-11 20:27 ` Martin K. Petersen
2016-04-11 20:27   ` Martin K. Petersen

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.