Skip to contentSkip to conversation

scsi:storvsc enable reading from VPD pages on SPC-2

PATCH In review Long Li 4 participants 10 messages Dec 10, 2014 – Dec 16, 2014

Subsystems (2)
lore
Share & tools
lore

Long Li

author
#0 lore raw

PATCH 1/1 scsi:storvsc enable reading from VPD pages on SPC-2

MSFT targets currently claim SPC-2 compliance while they implement post SPC-2 features. With this patch we can correctly handle WRITE_SAME_16 issues.

This patch fixes an issue where the flag is setup too late in drive initialization process.

---
 drivers/scsi/scsi_devinfo.c |  1 +
 drivers/scsi/storvsc_drv.c  | 10 ----------
 2 files changed, 1 insertion(+), 10 deletions(-)
drivers/scsi/scsi_devinfo.c +1 -0
index c1d04d4..f6fe0b2 100644
@@ -211,6 +211,7 @@ static struct {
 	{"Medion", "Flash XL  MMC/SD", "2.6D", BLIST_FORCELUN},
 	{"MegaRAID", "LD", NULL, BLIST_FORCELUN},
 	{"MICROP", "4110", NULL, BLIST_NOTQ},
+	{"Msft", "Virtual Disk", "1.0", BLIST_TRY_VPD_PAGES},
 	{"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2},
 	{"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
 	{"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
drivers/scsi/storvsc_drv.c +0 -10
index e3ba251..2452bb4 100644
@@ -327,8 +327,6 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
  */
 static int storvsc_timeout = 180;
 
-static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
-
 #define STORVSC_MAX_IO_REQUESTS				200
 
 static void storvsc_on_channel_callback(void *context);
@@ -1439,14 +1437,6 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 
 	sdevice->no_write_same = 1;
 
-	/*
-	 * Add blist flags to permit the reading of the VPD pages even when
-	 * the target may claim SPC-2 compliance. MSFT targets currently
-	 * claim SPC-2 compliance while they implement post SPC-2 features.
-	 * With this patch we can correctly handle WRITE_SAME_16 issues.
-	 */
-	sdevice->sdev_bflags |= msft_blist_flags;
-
 	return 0;
 }
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 6 lines · Long Li

MSFT targets currently claim SPC-2 compliance while they implement post SPC-2 features. With this patch we can correctly handle WRITE_SAME_16 issues.

This patch fixes an issue where the flag is setup too late in drive initialization process.

Li, is this a fix for the issue I keep whinging about over in
https://lkml.org/lkml/2014/10/21/23 ?

If is the same issue you may want to CC Martin on this...

Signature · 1 line
Sitsofe | http://sucs.org/~sits/
author
#2 lore raw
Quoted 14 lines

-----Original Message-----
From: Sitsofe Wheeler [mailto:[email protected]]
Sent: Wednesday, December 10, 2014 12:58 PM
To: Long Li
Cc: KY Srinivasan; Haiyang Zhang; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

Quoted 4 lines · Long Li

MSFT targets currently claim SPC-2 compliance while they implement post SPC-2 features. With this patch we can correctly handle WRITE_SAME_16 issues.

Quoted 7 lines
Quoted 2 lines

This patch fixes an issue where the flag is setup too late in drive initialization process.

Li, is this a fix for the issue I keep whinging about over in
https://lkml.org/lkml/2014/10/21/23 ?

If is the same issue you may want to CC Martin on this...

This is only for fixing WRITE_SAME_16. The rest of the thin provisioning (e.g. UNMAP) is still broken on SPC-2.

Quoted 3 lines

--
Sitsofe | http://sucs.org/~sits/

#3 lore raw
In reply to Long Li
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Long" == Long Li <[email protected]> writes:

Long> MSFT targets currently claim SPC-2 compliance while they implement Long> post SPC-2 features. With this patch we can correctly handle Long> WRITE_SAME_16 issues.

Handle the issues or handle WRITE SAME(10/16)?

+ {"Msft", "Virtual Disk", "1.0", BLIST_TRY_VPD_PAGES},

Is that version field meaningful or is it safe for us to inquire about VPD pages without problems on older versions?

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
author
#4 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Long" == Long Li <[email protected]> writes:

Long> MSFT targets currently claim SPC-2 compliance while they implement Long> post SPC-2 features. With this patch we can correctly handle Long> WRITE_SAME_16 issues.

Handle the issues or handle WRITE SAME(10/16)?

With this patch, the SCSI layer will be able to correctly send WRITE_SAME_16 to the Hyper-V host. It will not send WRITE_SAME_10: it has been disabled in the driver template. Do you want me to send another patch with these details?

Quoted 5 lines
drivers/scsi/scsi_devinfo.c +1 -0
+	{"Msft", "Virtual Disk", "1.0", BLIST_TRY_VPD_PAGES},

Is that version field meaningful or is it safe for us to inquire about VPD pages without problems on older versions?

This version is used in all current Hyper-V hosts: Windows 2008 R2, 2012 and 2012 R2. However it may change in future Windows releases.

Quoted 3 lines

--
Martin K. Petersen Oracle Linux Engineering

#5 lore raw
Quoted 26 lines

-----Original Message-----
From: Long Li
Sent: Wednesday, December 10, 2014 2:28 PM
To: Martin K. Petersen
Cc: KY Srinivasan; Haiyang Zhang; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]
Subject: RE: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Long" == Long Li <[email protected]> writes:

Long> MSFT targets currently claim SPC-2 compliance while they Long> implement post SPC-2 features. With this patch we can correctly Long> handle
Long> WRITE_SAME_16 issues.

Handle the issues or handle WRITE SAME(10/16)?

With this patch, the SCSI layer will be able to correctly send WRITE_SAME_16 to the Hyper-V host. It will not send WRITE_SAME_10: it has been disabled in the driver template. Do you want me to send another patch with these details?

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
drivers/scsi/scsi_devinfo.c +1 -0
+	{"Msft", "Virtual Disk", "1.0", BLIST_TRY_VPD_PAGES},

Is that version field meaningful or is it safe for us to inquire about VPD pages without problems on older versions?

This version is used in all current Hyper-V hosts: Windows 2008 R2, 2012 and 2012 R2. However it may change in future Windows releases.

The next version of the host will be claiming conformance to SPC-3

K. Y

Quoted 4 lines
Quoted 4 lines

--
Martin K. Petersen Oracle Linux Engineering

#6 lore raw
Quoted 11 lines · KY Srinivasan
Quoted 9 lines
Quoted 6 lines
drivers/scsi/scsi_devinfo.c +1 -0
+	{"Msft", "Virtual Disk", "1.0", BLIST_TRY_VPD_PAGES},

Is that version field meaningful or is it safe for us to inquire about VPD pages without problems on older versions?

This version is used in all current Hyper-V hosts: Windows 2008 R2, 2012 and 2012 R2. However it may change in future Windows releases.

The next version of the host will be claiming conformance to SPC-3

Will the version number ("1.0") of Virtual Disks also be changed? Part of me hopes it will as it will mean certain quirks for virtual disks will be easier to apply and won't need host version (are you 2008, 2012, 2016) version logic...

Signature · 1 line
Sitsofe | http://sucs.org/~sits/
#7 lore raw
Quoted 23 lines

-----Original Message-----
From: Sitsofe Wheeler [mailto:[email protected]]
Sent: Thursday, December 11, 2014 2:54 AM
To: KY Srinivasan
Cc: Long Li; Martin K. Petersen; Haiyang Zhang; [email protected]; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

Quoted 11 lines · KY Srinivasan
Quoted 10 lines
Quoted 6 lines
drivers/scsi/scsi_devinfo.c +1 -0
+	{"Msft", "Virtual Disk", "1.0", BLIST_TRY_VPD_PAGES},

Is that version field meaningful or is it safe for us to inquire about VPD pages without problems on older versions?

This version is used in all current Hyper-V hosts: Windows 2008 R2, 2012 and
2012 R2. However it may change in future Windows releases.

Quoted 6 lines
Quoted 1 line

The next version of the host will be claiming conformance to SPC-3

Will the version number ("1.0") of Virtual Disks also be changed? Part of me hopes it will as it will mean certain quirks for virtual disks will be easier to apply and won't need host version (are you 2008, 2012,
2016) version logic...

Spoke to the folks on Windows side of the house. They currently don't have plans to Change the version number ("1.0").

K. Y

Quoted 3 lines

--
Sitsofe | http://sucs.org/~sits/

#8 lore raw
In reply to Long Li
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Long" == Long Li <[email protected]> writes:

Handle the issues or handle WRITE SAME(10/16)?

Long> With this patch, the SCSI layer will be able to correctly send Long> WRITE_SAME_16 to the Hyper-V host. It will not send WRITE_SAME_10:
Long> it has been disabled in the driver template. Do you want me to Long> send another patch with these details?

no_write_same prevents us from attempting to use WRITE SAME(10/16) to zero block ranges.

This is completely orthogonal to using the WRITE SAME(10/16) commands with the UNMAP bit set to discard block ranges. The latter is controlled by the logical block provisioning heuristics and is not affected by no_write_same at all.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
author
#9 lore raw

Thanks Martin for the explanation.

I'll send out another patch.

Quoted 27 lines

-----Original Message-----
From: Martin K. Petersen [mailto:[email protected]]
Sent: Thursday, December 11, 2014 7:04 PM
To: Long Li
Cc: Martin K. Petersen; KY Srinivasan; Haiyang Zhang; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Long" == Long Li <[email protected]> writes:

Handle the issues or handle WRITE SAME(10/16)?

Long> With this patch, the SCSI layer will be able to correctly send Long> WRITE_SAME_16 to the Hyper-V host. It will not send WRITE_SAME_10:
Long> it has been disabled in the driver template. Do you want me to Long> send another patch with these details?

no_write_same prevents us from attempting to use WRITE SAME(10/16) to zero block ranges.

This is completely orthogonal to using the WRITE SAME(10/16) commands with the UNMAP bit set to discard block ranges. The latter is controlled by the logical block provisioning heuristics and is not affected by no_write_same at all.

--
Martin K. Petersen Oracle Linux Engineering