Discussion:
[PATCH] scsi: storvsc: Force SPC-3 for Win8 Hosts or Later
(too old to reply)
Jeff Leung
2014-10-21 05:39:24 UTC
Permalink
This patch forces SPC-3 for Hyper-V disks on the VMBus. As Windows 10's
virtual SAS bus is SPC-3 compliant and there are no negative side effects
on forcing SPC-3 compliance for Win8 hosts, this patch enables SPC-3
compliance by forcing it on for hosts with versions later than Win8.

Forcing SPC-3 compliance for hosts earlier than Win10 also enables
TRIM support.

Suggested by: James Bottomley <***@HansenPartnership.com>
Signed-off-by: Jeff Leung <***@v10networks.ca>
---
drivers/scsi/storvsc_drv.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index ed0f899..afcc68e 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1449,6 +1449,15 @@ static int storvsc_device_configure(struct scsi_device *sdevice)

sdevice->no_write_same = 1;

+ /*
+ * If the host is Win2k12 or later, we pretend to be SPC-3 compliant
+ * and send RC16 which activates TRIM. We will only enable this on a
+ * host with levels greater than VERSION_WIN8
+ */
+ if (vmbus_proto_version >= VERSION_WIN8) {
+ sdevice->scsi_level = SCSI_SPC_3;
+ }
+
return 0;
}
--
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeff Leung
2014-10-21 05:32:03 UTC
Permalink
This patch forces SPC-3 for Hyper-V disks on the VMBus. As Windows 10's
virtual SAS bus is SPC-3 compliant and there are no negative side effects
on forcing SPC-3 compliance for Win8 hosts, this patch enables SPC-3
compliance by forcing it on for hosts with versions later than Win8.

Forcing SPC-3 compliance for hosts earlier than Win10 also enables
TRIM support.

Suggested by: James Bottomley <***@HansenPartnership.com>
Signed-off-by: Jeff Leung <***@v10networks.ca>
---
drivers/scsi/storvsc_drv.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index ed0f899..afcc68e 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1449,6 +1449,15 @@ static int storvsc_device_configure(struct scsi_device *sdevice)

sdevice->no_write_same = 1;

+ /*
+ * If the host is Win2k12 or later, we pretend to be SPC-3 compliant
+ * and send RC16 which activates TRIM. We will only enable this on a
+ * host with levels greater than VERSION_WIN8
+ */
+ if (vmbus_proto_version >= VERSION_WIN8) {
+ sdevice->scsi_level = SCSI_SPC_3;
+ }
+
return 0;
}
--
1.7.2.5
KY Srinivasan
2014-10-21 18:46:43 UTC
Permalink
-----Original Message-----
Sent: Monday, October 20, 2014 10:39 PM
Subject: [PATCH] scsi: storvsc: Force SPC-3 for Win8 Hosts or Later
This patch forces SPC-3 for Hyper-V disks on the VMBus. As Windows 10's
virtual SAS bus is SPC-3 compliant and there are no negative side effects on
forcing SPC-3 compliance for Win8 hosts, this patch enables SPC-3 compliance
by forcing it on for hosts with versions later than Win8.
Forcing SPC-3 compliance for hosts earlier than Win10 also enables TRIM
support.
Suggested by: James Bottomley
---
drivers/scsi/storvsc_drv.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index
ed0f899..afcc68e 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1449,6 +1449,15 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
sdevice->no_write_same = 1;
+ /*
+ * If the host is Win2k12 or later, we pretend to be SPC-3 compliant
+ * and send RC16 which activates TRIM. We will only enable this on a
+ * host with levels greater than VERSION_WIN8
+ */
+ if (vmbus_proto_version >= VERSION_WIN8) {
I would want this hack not to be in Windows 10. We can have this hack if the host is either
Ws2012 or ws2012 r2 (VERSION_WIN8 or VERSION_WIN8_1). Also this hack should apply only
to VHD's being presented and not pass through devices.

K. Y
+ sdevice->scsi_level = SCSI_SPC_3;
+ }
+
return 0;
}
--
1.7.2.5
Loading...