Skip to contentSkip to conversation

storvsc: Set up correct queue depth values for IDE devices

PATCH Applied Long Li 4 participants 6 messages Mar 22, 2018 – Apr 20, 2018

Subsystems (2)
lore
Share & tools
lore

Long Li

author
#0 lore raw

PATCH v2 1/1 storvsc: Set up correct queue depth values for IDE devices

From: Long Li <[email protected]>

Unlike SCSI and FC, we don't use multiple channels for IDE. Also fix the calculation for sub-channels.

Change log:
v2: Addressed comment on incorrect number of sub-channels. (Michael Kelley <[email protected]>)

---
 drivers/scsi/storvsc_drv.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +5 -2
index 8c51d628b52e..a2ec0bc9e9fa 100644
@@ -1722,11 +1722,14 @@ static int storvsc_probe(struct hv_device *device,
 		max_targets = STORVSC_MAX_TARGETS;
 		max_channels = STORVSC_MAX_CHANNELS;
 		/*
-		 * On Windows8 and above, we support sub-channels for storage.
+		 * On Windows8 and above, we support sub-channels for storage
+		 * on SCSI and FC controllers.
 		 * The number of sub-channels offerred is based on the number of
 		 * VCPUs in the guest.
 		 */
-		max_sub_channels = (num_cpus / storvsc_vcpus_per_sub_channel);
+		if (!dev_is_ide)
+			max_sub_channels =
+				(num_cpus - 1) / storvsc_vcpus_per_sub_channel;
 	}
 
 	scsi_driver.can_queue = (max_outstanding_req_per_channel *
Signature · 1 line
2.14.1
Reviewed-by Michael Kelley on v2 1/1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Long Li
Sent: Thursday, March 22, 2018 2:47 PM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Stephen Hemminger <[email protected]>; James E . J . Bottomley <[email protected]>; Martin K . Petersen <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Cc: Long Li <[email protected]>
Subject: [PATCH v2] storvsc: Set up correct queue depth values for IDE devices

From: Long Li <[email protected]>

Quoted 8 lines

Unlike SCSI and FC, we don't use multiple channels for IDE. Also fix the calculation for sub-channels.

Change log:
v2: Addressed comment on incorrect number of sub-channels. (Michael Kelley <[email protected]>)

Quoted 27 lines
---
 drivers/scsi/storvsc_drv.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +5 -3
index 8c51d628b52e..a2ec0bc9e9fa 100644
@@ -1722,11 +1722,14 @@ static int storvsc_probe(struct hv_device *device,
 		max_targets = STORVSC_MAX_TARGETS;
 		max_channels = STORVSC_MAX_CHANNELS;
 		/*
-		 * On Windows8 and above, we support sub-channels for storage.
+		 * On Windows8 and above, we support sub-channels for storage
+		 * on SCSI and FC controllers.
 		 * The number of sub-channels offerred is based on the number of
 		 * VCPUs in the guest.
 		 */
-		max_sub_channels = (num_cpus / storvsc_vcpus_per_sub_channel);
+		if (!dev_is_ide)
+			max_sub_channels =
+				(num_cpus - 1) / storvsc_vcpus_per_sub_channel;
 	}
 
 	scsi_driver.can_queue = (max_outstanding_req_per_channel *
--

2.14.1

#2 lore raw

Hi Martin

Can you take a look at the following patch?

Long

Quoted 60 lines
Quoted 6 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Long Li
Sent: Thursday, March 22, 2018 2:47 PM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Stephen Hemminger

<[email protected]>;

Quoted 9 lines

James E . J . Bottomley <[email protected]>; Martin K . Petersen <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Cc: Long Li <[email protected]>
Subject: [PATCH v2] storvsc: Set up correct queue depth values for IDE devices

From: Long Li <[email protected]>

Quoted 8 lines

Unlike SCSI and FC, we don't use multiple channels for IDE. Also fix the calculation for sub-channels.

Change log:
v2: Addressed comment on incorrect number of sub-channels. (Michael Kelley <[email protected]>)

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device

Quoted 9 lines
---
 drivers/scsi/storvsc_drv.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +0 -0
index 8c51d628b52e..a2ec0bc9e9fa 100644
@@ -1722,11 +1722,14 @@ static int storvsc_probe(struct hv_device

*device,

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device,

Quoted 4 lines
drivers/scsi/storvsc_drv.c +0 -1
 		max_targets = STORVSC_MAX_TARGETS;
 		max_channels = STORVSC_MAX_CHANNELS;
 		/*
-		 * On Windows8 and above, we support sub-channels for

storage.

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device · line 1725

Quoted 1 line
drivers/scsi/storvsc_drv.c +1 -0
+		 * On Windows8 and above, we support sub-channels for

storage

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device · line 1727

Quoted 2 lines
drivers/scsi/storvsc_drv.c +1 -0
+		 * on SCSI and FC controllers.
 		 * The number of sub-channels offerred is based on the

number of

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device,

Quoted 3 lines
drivers/scsi/storvsc_drv.c +0 -1
 		 * VCPUs in the guest.
 		 */
-		max_sub_channels = (num_cpus /

storvsc_vcpus_per_sub_channel);

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device,

Quoted 3 lines
drivers/scsi/storvsc_drv.c +3 -0
+		if (!dev_is_ide)
+			max_sub_channels =
+				(num_cpus - 1) /

storvsc_vcpus_per_sub_channel;

Quoted 5 lines
drivers/scsi/storvsc_drv.c +0 -1
 	}
 
 	scsi_driver.can_queue = (max_outstanding_req_per_channel *
--

2.14.1

#3 lore raw

Long,

Quoted 4 lines

Can you take a look at the following patch?

Quoted 2 lines
Quoted 2 lines

+ max_sub_channels =

drivers/scsi/storvsc_drv.c +1 -0
+ 		(num_cpus - 1) / storvsc_vcpus_per_sub_channel;

What happens if num_cpus = 1?

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

Subject: Re: [PATCH v2] storvsc: Set up correct queue depth values for IDE devices

Quoted 8 lines

Long,

Quoted 4 lines

Can you take a look at the following patch?

Quoted 2 lines
Quoted 2 lines

+ max_sub_channels =

drivers/scsi/storvsc_drv.c +1 -0
+ 		(num_cpus - 1) / storvsc_vcpus_per_sub_channel;

What happens if num_cpus = 1?

If num_cpus=1, we don't have any sub channels.

The host offers one sub channel for VM with 5 CPUs, after that it offers an additional sub channel every 4 CPUs.

The primary channel is always offered.

Quoted 3 lines

--
Martin K. Petersen Oracle Linux Engineering

#5 lore raw

Long,

Quoted 6 lines

If num_cpus=1, we don't have any sub channels.

The host offers one sub channel for VM with 5 CPUs, after that it offers an additional sub channel every 4 CPUs.

The primary channel is always offered.

Applied to 4.17/scsi-fixes. Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering