linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [SCSI] mpt2sas T10 DIF fixes
@ 2012-02-21  1:36 Martin K. Petersen
  2012-02-21  1:36 ` [PATCH 1/3] mpt2sas: Return the correct sense key for DIF errors Martin K. Petersen
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-02-21  1:36 UTC (permalink / raw)
  To: linux-scsi; +Cc: James.Bottomley


This is a repost of the T10 DIF patches against mpt2sas that I posted a
while back:

 - Patch 1 fixes a bug where the driver reports the wrong error code to
   the SCSI layer when a T10 DIF error is detected.

 - Patch 2 adds a module parameter that allows the host protection mask
   to be specified at runtime so DIF can be disabled for mpt2sas if
   needed.

 - Patch 3 fixes the use of mpt2sas in combination with drives formatted
   with protecton information. This is the bug reported by Doug Gilbert
   here:   

   	http://marc.info/?l=linux-scsi&m=132154754616596

   The patch is required due to a change in default behavior with latest
   LSI firmware versions.

-- 
Martin K. Petersen	Oracle Linux Engineering


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

* [PATCH 1/3] mpt2sas: Return the correct sense key for DIF errors
  2012-02-21  1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
@ 2012-02-21  1:36 ` Martin K. Petersen
  2012-02-21  1:36 ` [PATCH 2/3] mpt2sas: Add a module parameter that permits overriding protection capabilities Martin K. Petersen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-02-21  1:36 UTC (permalink / raw)
  To: linux-scsi
  Cc: James.Bottomley, Martin K. Petersen, Nagalakshmi.Nandigama,
	Eric.Moore

From: "Martin K. Petersen" <martin.petersen@oracle.com>

Only a target device should return ABORTED COMMAND when a PI error is
discovered. The HBA should always set the sense key to ILLEGAL REQUEST.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Nagalakshmi.Nandigama@lsi.com
Cc: Eric.Moore@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index d953a57..9085d3e 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3736,8 +3736,6 @@ static void
 _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
 {
 	u8 ascq;
-	u8 sk;
-	u8 host_byte;
 
 	switch (ioc_status) {
 	case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
@@ -3754,16 +3752,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
 		break;
 	}
 
-	if (scmd->sc_data_direction == DMA_TO_DEVICE) {
-		sk = ILLEGAL_REQUEST;
-		host_byte = DID_ABORT;
-	} else {
-		sk = ABORTED_COMMAND;
-		host_byte = DID_OK;
-	}
-
-	scsi_build_sense_buffer(0, scmd->sense_buffer, sk, 0x10, ascq);
-	scmd->result = DRIVER_SENSE << 24 | (host_byte << 16) |
+	scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq);
+	scmd->result = DRIVER_SENSE << 24 | (DID_ABORT << 16) |
 	    SAM_STAT_CHECK_CONDITION;
 }
 
-- 
1.7.8.3.21.gab8a7


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

* [PATCH 2/3] mpt2sas: Add a module parameter that permits overriding protection capabilities
  2012-02-21  1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
  2012-02-21  1:36 ` [PATCH 1/3] mpt2sas: Return the correct sense key for DIF errors Martin K. Petersen
@ 2012-02-21  1:36 ` Martin K. Petersen
  2012-02-21  1:36 ` [PATCH 3/3] mpt2sas: Do not check DIF for unwritten blocks Martin K. Petersen
  2012-08-09  8:14 ` [SCSI] mpt2sas T10 DIF fixes Ankit Jain
  3 siblings, 0 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-02-21  1:36 UTC (permalink / raw)
  To: linux-scsi
  Cc: James.Bottomley, Martin K. Petersen, Nagalakshmi.Nandigama,
	Eric.Moore

From: "Martin K. Petersen" <martin.petersen@oracle.com>

Add a parameter that allows the host protection capabilities mask to be
provided at module load time.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Nagalakshmi.Nandigama@lsi.com
Cc: Eric.Moore@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 9085d3e..f398300 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -119,6 +119,11 @@ module_param(diag_buffer_enable, int, 0);
 MODULE_PARM_DESC(diag_buffer_enable, " post diag buffers "
 	"(TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)");
 
+/* permit overriding the host protection capabilities mask (EEDP/T10 PI) */
+static int prot_mask = 0;
+module_param(prot_mask, int, 0);
+MODULE_PARM_DESC(prot_mask, " host protection capabilities mask, def=7 ");
+
 /**
  * struct sense_info - common structure for obtaining sense keys
  * @skey: sense key
@@ -8007,8 +8012,14 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto out_add_shost_fail;
 	}
 
-	scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
-	    | SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE3_PROTECTION);
+	/* register EEDP capabilities with SCSI layer */
+	if (prot_mask)
+		scsi_host_set_prot(shost, prot_mask);
+	else
+		scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
+				   | SHOST_DIF_TYPE2_PROTECTION
+				   | SHOST_DIF_TYPE3_PROTECTION);
+
 	scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
 
 	/* event thread */
-- 
1.7.8.3.21.gab8a7


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

* [PATCH 3/3] mpt2sas: Do not check DIF for unwritten blocks
  2012-02-21  1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
  2012-02-21  1:36 ` [PATCH 1/3] mpt2sas: Return the correct sense key for DIF errors Martin K. Petersen
  2012-02-21  1:36 ` [PATCH 2/3] mpt2sas: Add a module parameter that permits overriding protection capabilities Martin K. Petersen
@ 2012-02-21  1:36 ` Martin K. Petersen
  2012-08-09  8:14 ` [SCSI] mpt2sas T10 DIF fixes Ankit Jain
  3 siblings, 0 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-02-21  1:36 UTC (permalink / raw)
  To: linux-scsi
  Cc: James.Bottomley, Martin K. Petersen, Nagalakshmi.Nandigama,
	Eric.Moore

From: "Martin K. Petersen" <martin.petersen@oracle.com>

Blocks that have never been written contain all ones in the protection
information. When reading, a target device will disable checking for any
block whose application tag contains 0xFFFF.

Some MPT adapters, however, enable checking for all blocks by
default. This causes reads to previously unwritten sectors to fail.

Tweak the relevant bit in the MPT configuration page that causes the HBA
to disable PI checking when a received app tag contains 0xFFFF.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Nagalakshmi.Nandigama@lsi.com
Cc: Eric.Moore@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c   |   15 +++++++
 drivers/scsi/mpt2sas/mpt2sas_base.h   |   19 +++++++++
 drivers/scsi/mpt2sas/mpt2sas_config.c |   72 +++++++++++++++++++++++++++++++++
 3 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 82fa6ce..a56926f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -2269,6 +2269,21 @@ _base_static_config_pages(struct MPT2SAS_ADAPTER *ioc)
 	if (ioc->ir_firmware)
 		mpt2sas_config_get_manufacturing_pg10(ioc, &mpi_reply,
 		    &ioc->manu_pg10);
+
+	/*
+	 * Ensure correct T10 PI operation if vendor left EEDPTagMode
+	 * flag unset in NVDATA.
+	 */
+	mpt2sas_config_get_manufacturing_pg11(ioc, &mpi_reply, &ioc->manu_pg11);
+	if (ioc->manu_pg11.EEDPTagMode == 0) {
+		printk(KERN_ERR "%s: overriding NVDATA EEDPTagMode setting\n",
+		       ioc->name);
+		ioc->manu_pg11.EEDPTagMode &= ~0x3;
+		ioc->manu_pg11.EEDPTagMode |= 0x1;
+		mpt2sas_config_set_manufacturing_pg11(ioc, &mpi_reply,
+						      &ioc->manu_pg11);
+	}
+
 	mpt2sas_config_get_bios_pg2(ioc, &mpi_reply, &ioc->bios_pg2);
 	mpt2sas_config_get_bios_pg3(ioc, &mpi_reply, &ioc->bios_pg3);
 	mpt2sas_config_get_ioc_pg8(ioc, &mpi_reply, &ioc->ioc_pg8);
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h
index c7459fd..f68195f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -296,6 +296,19 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_10 {
 #define MFG_PAGE10_EXPOSE_ALL_DISKS	(0x01)
 #define MFG_PAGE10_HIDE_IF_VOL_PRESENT	(0x02)
 
+/* Miscellaneous options */
+typedef struct _MPI2_CONFIG_PAGE_MAN_11 {
+    MPI2_CONFIG_PAGE_HEADER Header;                                 /* 00h */
+    U32                     Reserved1;                              /* 04h */
+    U8                      Reserved2;                              /* 08h */
+    U8                      EEDPTagMode;                            /* 09h */
+    U8                      Reserved3;                              /* 0Ah */
+    U8                      Reserved4;                              /* 0Bh */
+    U32                     Reserved5[23];                          /* 0Ch-60h*/
+} MPI2_CONFIG_PAGE_MAN_11,
+  MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_11,
+  Mpi2ManufacturingPage11_t, MPI2_POINTER pMpi2ManufacturingPage11_t;
+
 
 struct MPT2SAS_DEVICE {
 	struct MPT2SAS_TARGET *sas_target;
@@ -706,6 +719,7 @@ typedef void (*MPT2SAS_FLUSH_RUNNING_CMDS)(struct MPT2SAS_ADAPTER *ioc);
  * @pfacts: static port facts data
  * @manu_pg0: static manufacturing page 0
  * @manu_pg10: static manufacturing page 10
+ * @manu_pg11: static manufacturing page 11
  * @bios_pg2: static bios page 2
  * @bios_pg3: static bios page 3
  * @ioc_pg8: static ioc page 8
@@ -978,6 +992,7 @@ struct MPT2SAS_ADAPTER {
 	u8		diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT];
 	u32		unique_id[MPI2_DIAG_BUF_TYPE_COUNT];
 	Mpi2ManufacturingPage10_t manu_pg10;
+	Mpi2ManufacturingPage11_t manu_pg11;
 	u32		product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23];
 	u32		diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT];
 	u32		ring_buffer_offset;
@@ -1078,6 +1093,10 @@ int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc,
     Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page);
 int mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc,
     Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page);
+int mpt2sas_config_get_manufacturing_pg11(struct MPT2SAS_ADAPTER *ioc,
+    Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage11_t *config_page);
+int mpt2sas_config_set_manufacturing_pg11(struct MPT2SAS_ADAPTER *ioc,
+    Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage11_t *config_page);
 int mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
     *mpi_reply, Mpi2BiosPage2_t *config_page);
 int mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c
index 36ea0b2..fb737bb 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_config.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_config.c
@@ -503,6 +503,78 @@ mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc,
 }
 
 /**
+ * mpt2sas_config_get_manufacturing_pg11 - obtain manufacturing page 11
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt2sas_config_get_manufacturing_pg11(struct MPT2SAS_ADAPTER *ioc,
+    Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage11_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING;
+	mpi_request.Header.PageNumber = 11;
+	mpi_request.Header.PageVersion = MPI2_MANUFACTURING0_PAGEVERSION;
+	mpt2sas_base_build_zero_len_sge(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt2sas_config_set_manufacturing_pg11 - set manufacturing page 11
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt2sas_config_set_manufacturing_pg11(struct MPT2SAS_ADAPTER *ioc,
+    Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage11_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING;
+	mpi_request.Header.PageNumber = 11;
+	mpi_request.Header.PageVersion = MPI2_MANUFACTURING0_PAGEVERSION;
+	mpt2sas_base_build_zero_len_sge(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
  * mpt2sas_config_get_bios_pg2 - obtain bios page 2
  * @ioc: per adapter object
  * @mpi_reply: reply mf payload returned from firmware
-- 
1.7.8.3.21.gab8a7


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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-02-21  1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
                   ` (2 preceding siblings ...)
  2012-02-21  1:36 ` [PATCH 3/3] mpt2sas: Do not check DIF for unwritten blocks Martin K. Petersen
@ 2012-08-09  8:14 ` Ankit Jain
  2012-08-17 16:00   ` Martin K. Petersen
  3 siblings, 1 reply; 21+ messages in thread
From: Ankit Jain @ 2012-08-09  8:14 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-scsi, James.Bottomley

On 02/21/2012 07:06 AM, Martin K. Petersen wrote:
> This is a repost of the T10 DIF patches against mpt2sas that I posted a
> while back:

Will these patches be merged? Or have they been superseded by some other
patchset?

Thanks,
-- 
Ankit Jain
SUSE Labs


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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-09  8:14 ` [SCSI] mpt2sas T10 DIF fixes Ankit Jain
@ 2012-08-17 16:00   ` Martin K. Petersen
  2012-08-19 14:49     ` Pasi Kärkkäinen
  2012-10-01  9:17     ` Pasi Kärkkäinen
  0 siblings, 2 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-08-17 16:00 UTC (permalink / raw)
  To: Ankit Jain; +Cc: Martin K. Petersen, linux-scsi, James.Bottomley, Eric.Moore

>>>>> "Ankit" == Ankit Jain <jankit@suse.com> writes:

Ankit> Will these patches be merged? Or have they been superseded by
Ankit> some other patchset?

Sorry, I've been out on vacation.

2 of the patches are absolutely trivial and should just be applied.
However, LSI objects to patch #3 which tweaks an incorrect NVDATA flag
from within the driver.

Instead LSI has promised to revert to the original behavior in their
firmware/NVDATA updates. Eric, can you give us an update? There was
another bug report on linux-scsi just a couple of weeks ago.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-17 16:00   ` Martin K. Petersen
@ 2012-08-19 14:49     ` Pasi Kärkkäinen
  2012-08-19 15:18       ` Martin K. Petersen
  2012-10-01  9:17     ` Pasi Kärkkäinen
  1 sibling, 1 reply; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-19 14:49 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Fri, Aug 17, 2012 at 12:00:55PM -0400, Martin K. Petersen wrote:
> >>>>> "Ankit" == Ankit Jain <jankit@suse.com> writes:
> 
> Ankit> Will these patches be merged? Or have they been superseded by
> Ankit> some other patchset?
> 
> Sorry, I've been out on vacation.
> 
> 2 of the patches are absolutely trivial and should just be applied.
> However, LSI objects to patch #3 which tweaks an incorrect NVDATA flag
> from within the driver.
> 
> Instead LSI has promised to revert to the original behavior in their
> firmware/NVDATA updates. Eric, can you give us an update? There was
> another bug report on linux-scsi just a couple of weeks ago.
> 

Btw do you know which LSI mpt2sas HBAs support T10 DIF stuff? 
(using 520 or 528 bytes/sector drives with checkums).

LSI SAS2008 based? SAS2308 based? 

Thanks,

-- Pasi


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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-19 14:49     ` Pasi Kärkkäinen
@ 2012-08-19 15:18       ` Martin K. Petersen
  2012-08-19 15:30         ` Pasi Kärkkäinen
  0 siblings, 1 reply; 21+ messages in thread
From: Martin K. Petersen @ 2012-08-19 15:18 UTC (permalink / raw)
  To: Pasi Kärkkäinen
  Cc: Martin K. Petersen, Ankit Jain, linux-scsi, James.Bottomley,
	Eric.Moore

>>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:

Pasi> Btw do you know which LSI mpt2sas HBAs support T10 DIF stuff?
Pasi> (using 520 or 528 bytes/sector drives with checkums).

Pasi> LSI SAS2008 based? SAS2308 based?

SAS2008 and beyond. 512-byte logical blocks + 8 bytes of PI. Linux does
not support logical block sizes that are not powers of two.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-19 15:18       ` Martin K. Petersen
@ 2012-08-19 15:30         ` Pasi Kärkkäinen
  2012-08-19 16:38           ` Martin K. Petersen
  0 siblings, 1 reply; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-19 15:30 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Sun, Aug 19, 2012 at 11:18:57AM -0400, Martin K. Petersen wrote:
> >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> 
> Pasi> Btw do you know which LSI mpt2sas HBAs support T10 DIF stuff?
> Pasi> (using 520 or 528 bytes/sector drives with checkums).
> 
> Pasi> LSI SAS2008 based? SAS2308 based?
> 
> SAS2008 and beyond.
>

Ok, good.

> 512-byte logical blocks + 8 bytes of PI. 
>

So physically the disk is using 520 bytes/sector (and needs to support that),
but logically the HBA presents 512 bytes/sector + PI.. is that correct? 

I guess what I'm asking is: Can I use sg_format to enable checksums/protection
on any disk that physically supports 520 bytes/sector,
or does the disk need to have special T10 data protection support aswell? 

> Linux does not support logical block sizes that are not powers of two.
> 

Yep.

Thanks,

-- Pasi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-19 15:30         ` Pasi Kärkkäinen
@ 2012-08-19 16:38           ` Martin K. Petersen
  2012-08-19 20:19             ` Pasi Kärkkäinen
  2012-08-20 10:48             ` Pasi Kärkkäinen
  0 siblings, 2 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-08-19 16:38 UTC (permalink / raw)
  To: Pasi Kärkkäinen
  Cc: Martin K. Petersen, Ankit Jain, linux-scsi, James.Bottomley,
	Eric.Moore

>>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:

Pasi> So physically the disk is using 520 bytes/sector (and needs to
Pasi> support that), but logically the HBA presents 512 bytes/sector +
Pasi> PI.. is that correct?

Yep. The beauty of PI is that we can store the extra stuff without
having to deal with weird block sizes.


Pasi> I guess what I'm asking is: Can I use sg_format to enable
Pasi> checksums/protection on any disk that physically supports 520
Pasi> bytes/sector, or does the disk need to have special T10 data
Pasi> protection support aswell?

The disk needs to support T10 PI (PROTECT=1 in the Standard Inquiry VPD
page). We don't support driving the HBA in PI mode with a non-PI target.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-19 16:38           ` Martin K. Petersen
@ 2012-08-19 20:19             ` Pasi Kärkkäinen
  2012-08-20 10:48             ` Pasi Kärkkäinen
  1 sibling, 0 replies; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-19 20:19 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Sun, Aug 19, 2012 at 12:38:43PM -0400, Martin K. Petersen wrote:
> >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> 
> Pasi> So physically the disk is using 520 bytes/sector (and needs to
> Pasi> support that), but logically the HBA presents 512 bytes/sector +
> Pasi> PI.. is that correct?
> 
> Yep. The beauty of PI is that we can store the extra stuff without
> having to deal with weird block sizes.
> 

Yep.

> 
> Pasi> I guess what I'm asking is: Can I use sg_format to enable
> Pasi> checksums/protection on any disk that physically supports 520
> Pasi> bytes/sector, or does the disk need to have special T10 data
> Pasi> protection support aswell?
> 
> The disk needs to support T10 PI (PROTECT=1 in the Standard Inquiry VPD
> page). We don't support driving the HBA in PI mode with a non-PI target.
> 

Ok, good to know. 

Thanks!

-- Pasi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-19 16:38           ` Martin K. Petersen
  2012-08-19 20:19             ` Pasi Kärkkäinen
@ 2012-08-20 10:48             ` Pasi Kärkkäinen
  2012-08-20 11:06               ` Pasi Kärkkäinen
  2012-08-21  0:40               ` Martin K. Petersen
  1 sibling, 2 replies; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-20 10:48 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Sun, Aug 19, 2012 at 12:38:43PM -0400, Martin K. Petersen wrote:
> >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> 
> Pasi> So physically the disk is using 520 bytes/sector (and needs to
> Pasi> support that), but logically the HBA presents 512 bytes/sector +
> Pasi> PI.. is that correct?
> 
> Yep. The beauty of PI is that we can store the extra stuff without
> having to deal with weird block sizes.
> 
> 
> Pasi> I guess what I'm asking is: Can I use sg_format to enable
> Pasi> checksums/protection on any disk that physically supports 520
> Pasi> bytes/sector, or does the disk need to have special T10 data
> Pasi> protection support aswell?
> 
> The disk needs to support T10 PI (PROTECT=1 in the Standard Inquiry VPD
> page). We don't support driving the HBA in PI mode with a non-PI target.
> 

Btw do you know the current status of T10 PI support in md/dm raid? 
If I understood correctly there's some support for raid0/raid1 implemented..

Are there any docs how to enable/disable/configure T10 PI for md/dm raid?
Perhaps the <bdev>/integrite/{write_enable|read_verify} work directly for the md/dm device? 

Thanks a lot!

-- Pasi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-20 10:48             ` Pasi Kärkkäinen
@ 2012-08-20 11:06               ` Pasi Kärkkäinen
  2012-08-21  0:43                 ` Martin K. Petersen
  2012-08-21  0:40               ` Martin K. Petersen
  1 sibling, 1 reply; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-20 11:06 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Mon, Aug 20, 2012 at 01:48:19PM +0300, Pasi Kärkkäinen wrote:
> On Sun, Aug 19, 2012 at 12:38:43PM -0400, Martin K. Petersen wrote:
> > >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> > 
> > Pasi> So physically the disk is using 520 bytes/sector (and needs to
> > Pasi> support that), but logically the HBA presents 512 bytes/sector +
> > Pasi> PI.. is that correct?
> > 
> > Yep. The beauty of PI is that we can store the extra stuff without
> > having to deal with weird block sizes.
> > 
> > 
> > Pasi> I guess what I'm asking is: Can I use sg_format to enable
> > Pasi> checksums/protection on any disk that physically supports 520
> > Pasi> bytes/sector, or does the disk need to have special T10 data
> > Pasi> protection support aswell?
> > 
> > The disk needs to support T10 PI (PROTECT=1 in the Standard Inquiry VPD
> > page). We don't support driving the HBA in PI mode with a non-PI target.
> > 
> 
> Btw do you know the current status of T10 PI support in md/dm raid? 
> If I understood correctly there's some support for raid0/raid1 implemented..
> 
> Are there any docs how to enable/disable/configure T10 PI for md/dm raid?
> Perhaps the <bdev>/integrite/{write_enable|read_verify} work directly for the md/dm device? 
> 

.. and I probably need to sg_format the backing devices to enable PI before enabling PI for the md/dm device? 

-- Pasi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-20 10:48             ` Pasi Kärkkäinen
  2012-08-20 11:06               ` Pasi Kärkkäinen
@ 2012-08-21  0:40               ` Martin K. Petersen
  2012-08-21  6:12                 ` Pasi Kärkkäinen
  2012-08-21 15:50                 ` Jiang, Dave
  1 sibling, 2 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-08-21  0:40 UTC (permalink / raw)
  To: Pasi Kärkkäinen
  Cc: Martin K. Petersen, Ankit Jain, linux-scsi, James.Bottomley,
	Eric.Moore

>>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:

Pasi> Btw do you know the current status of T10 PI support in md/dm
Pasi> raid?  If I understood correctly there's some support for
Pasi> raid0/raid1 implemented..

Yes. The only thing that doesn't work is RAID5/6.


Pasi> Are there any docs how to enable/disable/configure T10 PI for
Pasi> md/dm raid?  Perhaps the
Pasi> <bdev>/integrite/{write_enable|read_verify} work directly for the
Pasi> md/dm device?

You don't have to configure anything. If all component devices are
capable the md/dm device will register a suitable integrity profile.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-20 11:06               ` Pasi Kärkkäinen
@ 2012-08-21  0:43                 ` Martin K. Petersen
  2012-08-21  6:13                   ` Pasi Kärkkäinen
  0 siblings, 1 reply; 21+ messages in thread
From: Martin K. Petersen @ 2012-08-21  0:43 UTC (permalink / raw)
  To: Pasi Kärkkäinen
  Cc: Martin K. Petersen, Ankit Jain, linux-scsi, James.Bottomley,
	Eric.Moore

>>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:

Pasi> .. and I probably need to sg_format the backing devices to enable
Pasi> PI

Yes. Unless the drive is already formatted with PI. The latter is
becoming increasingly common as a PI-drive will work just fine in a
"legacy" setup. Many current drives provide the same LBA count
regardless of whether PI is enabled or not. So there isn't much point in
not enabling it.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-21  0:40               ` Martin K. Petersen
@ 2012-08-21  6:12                 ` Pasi Kärkkäinen
  2012-08-21 15:50                 ` Jiang, Dave
  1 sibling, 0 replies; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-21  6:12 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Mon, Aug 20, 2012 at 08:40:21PM -0400, Martin K. Petersen wrote:
> >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> 
> Pasi> Btw do you know the current status of T10 PI support in md/dm
> Pasi> raid?  If I understood correctly there's some support for
> Pasi> raid0/raid1 implemented..
> 
> Yes. The only thing that doesn't work is RAID5/6.
> 

Ok, thanks for confirming that.

> 
> Pasi> Are there any docs how to enable/disable/configure T10 PI for
> Pasi> md/dm raid?  Perhaps the
> Pasi> <bdev>/integrite/{write_enable|read_verify} work directly for the
> Pasi> md/dm device?
> 
> You don't have to configure anything. If all component devices are
> capable the md/dm device will register a suitable integrity profile.
> 

Oh, nice! I'll have to try it once I get some drives with PI.

-- Pasi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-21  0:43                 ` Martin K. Petersen
@ 2012-08-21  6:13                   ` Pasi Kärkkäinen
  0 siblings, 0 replies; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-08-21  6:13 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Mon, Aug 20, 2012 at 08:43:49PM -0400, Martin K. Petersen wrote:
> >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> 
> Pasi> .. and I probably need to sg_format the backing devices to enable
> Pasi> PI
> 
> Yes. Unless the drive is already formatted with PI. The latter is
> becoming increasingly common as a PI-drive will work just fine in a
> "legacy" setup. Many current drives provide the same LBA count
> regardless of whether PI is enabled or not. So there isn't much point in
> not enabling it.
> 

Makes sense, thanks!

-- Pasi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [SCSI] mpt2sas T10 DIF fixes
  2012-08-21  0:40               ` Martin K. Petersen
  2012-08-21  6:12                 ` Pasi Kärkkäinen
@ 2012-08-21 15:50                 ` Jiang, Dave
  2012-08-22 18:36                   ` Martin K. Petersen
  1 sibling, 1 reply; 21+ messages in thread
From: Jiang, Dave @ 2012-08-21 15:50 UTC (permalink / raw)
  To: Martin K. Petersen, Pasi Kärkkäinen
  Cc: Ankit Jain, linux-scsi@vger.kernel.org,
	James.Bottomley@hansenpartnership.com, Eric.Moore@lsi.com

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Martin K. Petersen
> Sent: Monday, August 20, 2012 5:40 PM
> To: Pasi Kärkkäinen
> Cc: Martin K. Petersen; Ankit Jain; linux-scsi@vger.kernel.org;
> James.Bottomley@hansenpartnership.com; Eric.Moore@lsi.com
> Subject: Re: [SCSI] mpt2sas T10 DIF fixes
> 
> >>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:
> 
> Pasi> Btw do you know the current status of T10 PI support in md/dm
> Pasi> raid?  If I understood correctly there's some support for
> Pasi> raid0/raid1 implemented..
> 
> Yes. The only thing that doesn't work is RAID5/6.

Just curious, has any work been done on this? Wondering what the roadblocks are to get this support in.... 

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-21 15:50                 ` Jiang, Dave
@ 2012-08-22 18:36                   ` Martin K. Petersen
  0 siblings, 0 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-08-22 18:36 UTC (permalink / raw)
  To: Jiang, Dave
  Cc: Martin K. Petersen, Pasi Kärkkäinen, Ankit Jain,
	linux-scsi@vger.kernel.org, James.Bottomley@hansenpartnership.com,
	Eric.Moore@lsi.com

>>>>> "dj" == Jiang, Dave <dave.jiang@intel.com> writes:

>> Yes. The only thing that doesn't work is RAID5/6.

dj> Just curious, has any work been done on this? Wondering what the
dj> roadblocks are to get this support in....

Nobody has done the work, that's all. And it's not entirely trivial. The
8 bytes of metadata for a parity sector is not "valid" T10 protection
information, for instance.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-08-17 16:00   ` Martin K. Petersen
  2012-08-19 14:49     ` Pasi Kärkkäinen
@ 2012-10-01  9:17     ` Pasi Kärkkäinen
  2012-10-02 22:24       ` Martin K. Petersen
  1 sibling, 1 reply; 21+ messages in thread
From: Pasi Kärkkäinen @ 2012-10-01  9:17 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Ankit Jain, linux-scsi, James.Bottomley, Eric.Moore

On Fri, Aug 17, 2012 at 12:00:55PM -0400, Martin K. Petersen wrote:
> >>>>> "Ankit" == Ankit Jain <jankit@suse.com> writes:
> 
> Ankit> Will these patches be merged? Or have they been superseded by
> Ankit> some other patchset?
> 
> Sorry, I've been out on vacation.
> 
> 2 of the patches are absolutely trivial and should just be applied.
> However, LSI objects to patch #3 which tweaks an incorrect NVDATA flag
> from within the driver.
> 
> Instead LSI has promised to revert to the original behavior in their
> firmware/NVDATA updates. Eric, can you give us an update? There was
> another bug report on linux-scsi just a couple of weeks ago.
> 

Hello,

Hopefully these T10 patches can go in during the 3.7 merge window!

Thanks,

-- Pasi


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

* Re: [SCSI] mpt2sas T10 DIF fixes
  2012-10-01  9:17     ` Pasi Kärkkäinen
@ 2012-10-02 22:24       ` Martin K. Petersen
  0 siblings, 0 replies; 21+ messages in thread
From: Martin K. Petersen @ 2012-10-02 22:24 UTC (permalink / raw)
  To: Pasi Kärkkäinen
  Cc: Martin K. Petersen, Ankit Jain, linux-scsi, James.Bottomley,
	Eric.Moore

>>>>> "Pasi" == Pasi Kärkkäinen <pasik@iki.fi> writes:

>> 2 of the patches are absolutely trivial and should just be applied.
>> However, LSI objects to patch #3 which tweaks an incorrect NVDATA
>> flag from within the driver.
>> 
>> Instead LSI has promised to revert to the original behavior in their
>> firmware/NVDATA updates. Eric, can you give us an update? There was
>> another bug report on linux-scsi just a couple of weeks ago.

Pasi> Hopefully these T10 patches can go in during the 3.7 merge window!

The 2 trivial patches are queued for 3.7, yes. LSI are still working the
bad NVDATA default issue.

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-10-02 22:24 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21  1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
2012-02-21  1:36 ` [PATCH 1/3] mpt2sas: Return the correct sense key for DIF errors Martin K. Petersen
2012-02-21  1:36 ` [PATCH 2/3] mpt2sas: Add a module parameter that permits overriding protection capabilities Martin K. Petersen
2012-02-21  1:36 ` [PATCH 3/3] mpt2sas: Do not check DIF for unwritten blocks Martin K. Petersen
2012-08-09  8:14 ` [SCSI] mpt2sas T10 DIF fixes Ankit Jain
2012-08-17 16:00   ` Martin K. Petersen
2012-08-19 14:49     ` Pasi Kärkkäinen
2012-08-19 15:18       ` Martin K. Petersen
2012-08-19 15:30         ` Pasi Kärkkäinen
2012-08-19 16:38           ` Martin K. Petersen
2012-08-19 20:19             ` Pasi Kärkkäinen
2012-08-20 10:48             ` Pasi Kärkkäinen
2012-08-20 11:06               ` Pasi Kärkkäinen
2012-08-21  0:43                 ` Martin K. Petersen
2012-08-21  6:13                   ` Pasi Kärkkäinen
2012-08-21  0:40               ` Martin K. Petersen
2012-08-21  6:12                 ` Pasi Kärkkäinen
2012-08-21 15:50                 ` Jiang, Dave
2012-08-22 18:36                   ` Martin K. Petersen
2012-10-01  9:17     ` Pasi Kärkkäinen
2012-10-02 22:24       ` Martin K. Petersen

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).