2014-12-10 07:28:56

by Long Li

[permalink] [raw]
Subject: [PATCH] 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.

Reviewed-by: K. Y. Srinivasan <[email protected]>
Signed-off-by: Long Li <[email protected]>
---
drivers/scsi/scsi_devinfo.c | 1 +
drivers/scsi/storvsc_drv.c | 10 ----------
2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index c1d04d4..f6fe0b2 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -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},
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e3ba251..2452bb4 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -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;
}

--
2.1.0


2014-12-10 20:57:51

by Sitsofe Wheeler

[permalink] [raw]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

On Wed, Dec 10, 2014 at 12:38:25AM -0800, Long Li wrote:
> 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...

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

2014-12-10 21:12:58

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

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

--
Martin K. Petersen Oracle Linux Engineering

2014-12-10 22:43:58

by Long Li

[permalink] [raw]
Subject: RE: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

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

>
> + {"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.

>
> --
> Martin K. Petersen Oracle Linux Engineering

2014-12-10 22:48:25

by Long Li

[permalink] [raw]
Subject: RE: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

> -----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
>
> On Wed, Dec 10, 2014 at 12:38:25AM -0800, Long Li wrote:
> > 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...

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

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

2014-12-10 23:30:33

by KY Srinivasan

[permalink] [raw]
Subject: RE: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2



> -----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
>
> > >>>>> "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?
>
> >
> > + {"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
>
> >
> > --
> > Martin K. Petersen Oracle Linux Engineering

2014-12-11 10:53:56

by Sitsofe Wheeler

[permalink] [raw]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

On Wed, Dec 10, 2014 at 11:30:30PM +0000, KY Srinivasan wrote:
>
> > >
> > > + {"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...

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

2014-12-11 19:05:51

by KY Srinivasan

[permalink] [raw]
Subject: RE: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2



> -----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
>
> On Wed, Dec 10, 2014 at 11:30:30PM +0000, KY Srinivasan wrote:
> >
> > > >
> > > > + {"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...

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
>
> --
> Sitsofe | http://sucs.org/~sits/

2014-12-12 03:04:03

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

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

2014-12-16 02:12:23

by Long Li

[permalink] [raw]
Subject: RE: [PATCH] scsi:storvsc enable reading from VPD pages on SPC-2

Thanks Martin for the explanation.

I'll send out another patch.

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