libsas fixes discovered via isci-atapi enabling effort
Subsystems (4)
cover libsas fixes discovered via isci-atapi enabling effort
While enabling atapi device support for isci we encountered a condition whereby multiple srX devices (one for every possible LUN) were exported by the midlayer. Looking at other drivers showed that they had a local workaround for this and other conditions in custom ->slave_{alloc|configure} methods. Rather than add custom workaround for isci this patchset uplevels those workarounds to libsas proper.
Patch 3/5 is tagged RFC as I do not know the original history behind hard limiting libsas end devices to a queue_depth of 32. At least mvsas has been bumping this up to 64 on its own.
---
Dan Williams (5):
libsas: disable scanning lun > 0 on ata devices
libsas: fix ->change_queue_{depth|type} for sata devices
libsas: dynamic queue depth
mvsas: remove mvs_slave_{alloc|configure}
pm8001: remove pm8001_slave_{alloc|configure}drivers/ata/libata-core.c | 1 + drivers/ata/libata-scsi.c | 44 +++++++++++++++++++++++------------ drivers/scsi/libsas/sas_scsi_host.c | 42 +++++++++++++++++++-------------- drivers/scsi/mvsas/mv_init.c | 4 ++- drivers/scsi/mvsas/mv_sas.c | 30 ------------------------ drivers/scsi/mvsas/mv_sas.h | 2 -- drivers/scsi/pm8001/pm8001_init.c | 4 ++- drivers/scsi/pm8001/pm8001_sas.c | 31 +------------------------ drivers/scsi/pm8001/pm8001_sas.h | 2 -- drivers/scsi/scsi_transport_sas.c | 10 ++++++-- include/linux/libata.h | 2 ++ 11 files changed, 69 insertions(+), 103 deletions(-)
PATCH 1/5 libsas: disable scanning lun > 0 on ata devices
Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0.
Just do what Darrick suggested [1], and limit the scan for ata devices.
[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2
--- drivers/scsi/scsi_transport_sas.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_sas.c +8 -2
@@ -1545,8 +1545,14 @@ int sas_rphy_add(struct sas_rphy *rphy)if (identify->device_type ==SAS_END_DEVICE && rphy->scsi_target_id !=-1 ) { -scsi_scan_target (&rphy->dev,0 , - rphy->scsi_target_id,SCAN_WILD_CARD ,0 ); +int lun; + +if (identify->target_port_protocols &SAS_PROTOCOL_SSP ) + lun =SCAN_WILD_CARD ; +else + lun =0 ; + +scsi_scan_target (&rphy->dev,0 , rphy->scsi_target_id, lun,0 ); }return 0 ;
Re: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices
Quoted 7 lines · Dan Williams
Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0.
Just do what Darrick suggested [1], and limit the scan for ata devices.
Looks reasonable.
RE: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices
In reply to Dan WilliamsGood Stuff
-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:10 PM
To: [email protected]; [email protected]
Cc: Luben Tuikov; [email protected]; [email protected]; Jack Wang; Xiangliang Yu; Mark Salyzyn; Darrick Wong
Subject: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices
Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems
with atapi devices when scanning past lun0.
Just do what Darrick suggested [1], and limit the scan for ata devices.
[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2
--- drivers/scsi/scsi_transport_sas.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.
Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.
Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________
Re: [PATCH 1/5] libsas: disable scanning lun > 0 on ata devices
In reply to Dan WilliamsQuoted 26 lines · Dan Williams
Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0.
Just do what Darrick suggested [1], and limit the scan for ata devices.
[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2
Cc Darrick Wong<[email protected]>Cc Xiangliang Yu<[email protected]>Cc Jack Wang<[email protected]>Cc Mark Salyzyn<[email protected]>Cc Luben Tuikov<[email protected]>Signed-off-by Dan Williams<[email protected]>--- drivers/scsi/scsi_transport_sas.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)drivers/scsi/scsi_transport_sas.c +0
-0@@ -1545,8 +1545,14 @@ int sas_rphy_add(struct sas_rphy *rphy)if (identify->device_type ==SAS_END_DEVICE && rphy->scsi_target_id !=-1 ) {
drivers/scsi/scsi_transport_sas.c int sas_rphy_add(struct sas_rphy *rphy) · line 1555
Quoted 10 lines
drivers/scsi/scsi_transport_sas.c +8
-2-scsi_scan_target (&rphy->dev,0 , - rphy->scsi_target_id,SCAN_WILD_CARD ,0 ); +int lun; + +if (identify->target_port_protocols&SAS_PROTOCOL_SSP ) + lun =SCAN_WILD_CARD ; +else + lun =0 ; + +scsi_scan_target (&rphy->dev,0 , rphy->scsi_target_id, lun,0 );
PATCH 2/5 libsas: fix ->change_queue_{depth|type} for sata devices
In reply to Dan WilliamsPass queue_depth change requests to libata, and prevent queue_type changes for ATA devices.
Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not set sdev->tagged_supported are unable to
change the queue_depth of ata devices via sysfs
--- drivers/ata/libata-core.c | 1 + drivers/ata/libata-scsi.c | 44 +++++++++++++++++++++++------------ drivers/scsi/libsas/sas_scsi_host.c | 11 ++++++++- include/linux/libata.h | 2 ++ 4 files changed, 42 insertions(+), 16 deletions(-)
drivers/ata/libata-core.c +1 -0
@@ -6713,6 +6713,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);EXPORT_SYMBOL_GPL (ata_scsi_slave_config);EXPORT_SYMBOL_GPL (ata_scsi_slave_destroy);EXPORT_SYMBOL_GPL (ata_scsi_change_queue_depth); +EXPORT_SYMBOL_GPL (__ata_change_queue_depth);EXPORT_SYMBOL_GPL (sata_scr_valid);EXPORT_SYMBOL_GPL (sata_scr_read);EXPORT_SYMBOL_GPL (sata_scr_write);
drivers/ata/libata-scsi.c +29 -15
60 lines not on this page · raw message
drivers/scsi/libsas/sas_scsi_host.c +10 -1
@@ -831,8 +831,13 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)int sas_change_queue_depth (struct scsi_device *scsi_dev,int new_depth,int reason) { +struct domain_device *dev =sdev_to_domain_dev (scsi_dev);int res =min (new_depth,SAS_MAX_QD ); +if (dev_is_sata (dev)) +return __ata_change_queue_depth (dev->sata_dev.ap, scsi_dev, + new_depth, reason); +if (reason !=SCSI_QDEPTH_DEFAULT )return -EOPNOTSUPP ;
@@ -840,7 +845,6 @@ int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,scsi_adjust_queue_depth (scsi_dev,scsi_get_tag_type (scsi_dev), res); else { -struct domain_device *dev =sdev_to_domain_dev (scsi_dev);sas_printk ("device %llx LUN %x queue depth changed to 1\n" ,SAS_ADDR (dev->sas_addr), scsi_dev->lun);
@@ -853,6 +857,11 @@ int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth,int sas_change_queue_type (struct scsi_device *scsi_dev,int qt) { +struct domain_device *dev =sdev_to_domain_dev (scsi_dev); + +if (dev_is_sata (dev)) +return -EINVAL ; +if (!scsi_dev->tagged_supported)return 0 ;
include/linux/libata.h +2 -0
@@ -1052,6 +1052,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev);extern void ata_scsi_slave_destroy (struct scsi_device *sdev);extern int ata_scsi_change_queue_depth (struct scsi_device *sdev,int queue_depth,int reason); +extern int __ata_change_queue_depth (struct ata_port *ap,struct scsi_device *sdev, +int queue_depth,int reason);extern struct ata_device *ata_dev_pair (struct ata_device *adev);extern int ata_do_set_mode (struct ata_link *link,struct ata_device **r_failed_dev);extern void ata_scsi_port_error_handler (struct Scsi_Host *host,struct ata_port *ap);
Re: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices
Looks good.
RE: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices
In reply to Dan WilliamsGood Stuff
-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:11 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; Jack Wang; Tejun Heo; Xiangliang Yu; Mark Salyzyn
Subject: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices
Pass queue_depth change requests to libata, and prevent queue_type changes for ATA devices.
Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not set sdev->tagged_supported are unable to
change the queue_depth of ata devices via sysfs
--- drivers/ata/libata-core.c | 1 + drivers/ata/libata-scsi.c | 44 +++++++++++++++++++++++------------ drivers/scsi/libsas/sas_scsi_host.c | 11 ++++++++- include/linux/libata.h | 2 ++ 4 files changed, 42 insertions(+), 16 deletions(-)
______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.
Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.
Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________
Re: [PATCH 2/5] libsas: fix ->change_queue_{depth|type} for sata devices
In reply to Dan WilliamsQuoted 13 lines · Dan Williams
Pass
queue_depthchange requests to libata, and preventqueue_typechanges for ATA devices.Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth 2/ libsas drivers that do not setsdev->tagged_supportedare unable to
change thequeue_depthof ata devices via sysfsCc Tejun Heo<[email protected]>Cc Xiangliang Yu<[email protected]>Cc Jack Wang<[email protected]>Cc Mark Salyzyn<[email protected]>Signed-off-by Dan Williams<[email protected]>
Quoted 6 lines
--- drivers/ata/libata-core.c | 1 + drivers/ata/libata-scsi.c | 44 +++++++++++++++++++++++------------ drivers/scsi/libsas/sas_scsi_host.c | 11 ++++++++- include/linux/libata.h | 2 ++ 4 files changed, 42 insertions(+), 16 deletions(-)
RFC PATCH 3/5 libsas: dynamic queue depth
In reply to Dan WilliamsThe queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.
No performance regression was observed with this change on the isci driver.
--- drivers/scsi/libsas/sas_scsi_host.c | 39 ++++++++++++++++------------------- 1 files changed, 18 insertions(+), 21 deletions(-)
drivers/scsi/libsas/sas_scsi_host.c +18 -21
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)return 0 ; } -#define SAS_DEF_QD 32 -#define SAS_MAX_QD 64 +#define SAS_DEF_QD 256int sas_slave_configure (struct scsi_device *scsi_dev) {
@@ -828,31 +827,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev) dev->sata_dev.ap->link.device[0 ].class =ATA_DEV_NONE ; } -int sas_change_queue_depth (struct scsi_device *scsi_dev,int new_depth, -int reason) +int sas_change_queue_depth (struct scsi_device *sdev,int depth,int reason) { -struct domain_device *dev =sdev_to_domain_dev (scsi_dev); -int res =min (new_depth,SAS_MAX_QD ); +struct domain_device *dev =sdev_to_domain_dev (sdev);if (dev_is_sata (dev)) -return __ata_change_queue_depth (dev->sata_dev.ap, scsi_dev, - new_depth, reason); - -if (reason !=SCSI_QDEPTH_DEFAULT ) +return __ata_change_queue_depth (dev->sata_dev.ap, sdev, depth, + reason); + +switch (reason) { +case SCSI_QDEPTH_DEFAULT : +case SCSI_QDEPTH_RAMP_UP : +if (!sdev->tagged_supported) + depth =1 ; +scsi_adjust_queue_depth (sdev,scsi_get_tag_type (sdev), depth); +break ; +case SCSI_QDEPTH_QFULL : +scsi_track_queue_full (sdev, depth); +break ; +default :return -EOPNOTSUPP ; - -if (scsi_dev->tagged_supported) -scsi_adjust_queue_depth (scsi_dev,scsi_get_tag_type (scsi_dev), - res); -else { -sas_printk ("device %llx LUN %x queue depth changed to 1\n" , -SAS_ADDR (dev->sas_addr), - scsi_dev->lun); -scsi_adjust_queue_depth (scsi_dev,0 ,1 ); - res =1 ; } -return res; +return depth; }int sas_change_queue_type (struct scsi_device *scsi_dev,int qt)
Re: [RFC PATCH 3/5] libsas: dynamic queue depth
Quoted 7 lines · Dan Williams
The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.
No performance regression was observed with this change on the isci driver.
Looks reasonable to me.
Re: [RFC PATCH 3/5] libsas: dynamic queue depth
In reply to Dan WilliamsI suppose to prepare a similar patch, thanks for ding this.
[RFC PATCH 3/5] libsas: dynamic queue depth
Quoted 38 lines
The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.
No performance regression was observed with this change on the isci driver.
Cc Christoph Hellwig <[email protected]>Cc Mark Salyzyn <[email protected]>Cc Xiangliang Yu <[email protected]>Cc Jack Wang <[email protected]>Cc Mark Salyzyn <[email protected]>Cc Luben Tuikov <[email protected]>Tested-by Dave Jiang <[email protected]>Signed-off-by Dan Williams <[email protected]>--- drivers/scsi/libsas/sas_scsi_host.c | 39 ++++++++++++++++------------------- 1 files changed, 18 insertions(+), 21 deletions(-)drivers/scsi/libsas/sas_scsi_host.c +1
-2@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)return 0 ; } -#define SAS_DEF_QD 32 -#define SAS_MAX_QD 64 +#define SAS_DEF_QD 256int sas_slave_configure (struct scsi_device *scsi_dev) {
drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev) · line 830
Quoted 6 lines
drivers/scsi/libsas/sas_scsi_host.c +1
-2@@ -828,31 +827,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev) dev->sata_dev.ap->link.device[0 ].class =ATA_DEV_NONE ; } -int sas_change_queue_depth (struct scsi_device *scsi_dev,int new_depth, -int reason) +int sas_change_queue_depth(struct scsi_device *sdev, int depth, int
reason)
drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev)
Quoted 11 lines
drivers/scsi/libsas/sas_scsi_host.c +2
-6{ -struct domain_device *dev =sdev_to_domain_dev (scsi_dev); -int res =min (new_depth,SAS_MAX_QD ); +struct domain_device *dev =sdev_to_domain_dev (sdev);if (dev_is_sata (dev)) -return __ata_change_queue_depth (dev->sata_dev.ap, scsi_dev, - new_depth, reason); - -if (reason !=SCSI_QDEPTH_DEFAULT ) + return __ata_change_queue_depth(dev->sata_dev.ap, sdev,
depth,
drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev)
Quoted 8 lines
drivers/scsi/libsas/sas_scsi_host.c +8
-0+ reason); + +switch (reason) { +case SCSI_QDEPTH_DEFAULT : +case SCSI_QDEPTH_RAMP_UP : +if (!sdev->tagged_supported) + depth =1 ; + scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev),
depth);
drivers/scsi/libsas/sas_scsi_host.c void sas_slave_destroy(struct scsi_device *scsi_dev)
Quoted 9 lines
drivers/scsi/libsas/sas_scsi_host.c +5
-3+break ; +case SCSI_QDEPTH_QFULL : +scsi_track_queue_full (sdev, depth); +break ; +default :return -EOPNOTSUPP ; - -if (scsi_dev->tagged_supported) - scsi_adjust_queue_depth(scsi_dev,
scsi_get_tag_type(scsi_dev),
Quoted 19 lines
drivers/scsi/libsas/sas_scsi_host.c +1
-9- res); - else { -sas_printk ("device %llx LUN %x queue depth changed to 1\n" , -SAS_ADDR (dev->sas_addr), - scsi_dev->lun); -scsi_adjust_queue_depth (scsi_dev,0 ,1 ); - res =1 ; } -return res; +return depth; }int sas_change_queue_type (struct scsi_device *scsi_dev,int qt) --To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [RFC PATCH 3/5] libsas: dynamic queue depth
In reply to Dan WilliamsGood Stuff, 'cept I am worried about the host max queue depth of 128 on the pm8001 driver resulting in starvation. I defer to Jack Wang's judgement on that point (and will explore separately how we can increase the host queue depth reliably on the pm8001).
Consider this an Ack from me that has an interlock on Jack Wang's Ack
...
Sincerely -- Mark Salyzyn
-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:11 PM
To: [email protected]; [email protected]
Cc: Dave Jiang; Luben Tuikov; [email protected]; [email protected]; Jack Wang; Xiangliang Yu; Mark Salyzyn; Christoph Hellwig
Subject: [RFC PATCH 3/5] libsas: dynamic queue depth
The queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.
No performance regression was observed with this change on the isci driver.
--- drivers/scsi/libsas/sas_scsi_host.c | 39 ++++++++++++++++------------------- 1 files changed, 18 insertions(+), 21 deletions(-)
(quoted diff) +0 -0
b/drivers/scsi/libsas/sas_scsi_host.c
index 4c6923c..fe08ef0 100644
drivers/scsi/libsas/sas_scsi_host.c +1 -2
@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)return 0 ; } -#define SAS_DEF_QD 32 -#define SAS_MAX_QD 64 +#define SAS_DEF_QD 256int sas_slave_configure (struct scsi_device *scsi_dev) {
______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.
Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.
Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________
Re: [RFC PATCH 3/5] libsas: dynamic queue depth
Thanks Mark, I 'll post a patch to raise the default host can queue value, I'm OK with his change!
--Jack
RE: [RFC PATCH 3/5] libsas: dynamic queue depth
Quoted 56 lines
Good Stuff, 'cept I am worried about the host max queue depth of 128 on the pm8001 driver resulting in starvation. I defer to Jack Wang's judgement on that point (and will explore separately how we can increase the host queue depth reliably on the pm8001).
Consider this an Ack from me that has an interlock on Jack Wang's Ack
...Sincerely -- Mark Salyzyn
-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Tuesday, September 20, 2011 6:11 PM
To: [email protected]; [email protected]
Cc: Dave Jiang; Luben Tuikov; [email protected]; [email protected]; Jack Wang; Xiangliang Yu; Mark Salyzyn; Christoph Hellwig
Subject: [RFC PATCH 3/5] libsas: dynamic queue depthThe queue-depth for libsas-attached devices initializes to 32 and can only be increased manually via sysfs to a max of 64, while mpt2sas attached devices initialize to 254 and dynamically float via the midlayer ->change_queue_depth interface.
No performance regression was observed with this change on the isci driver.
Cc Christoph Hellwig <[email protected]>Cc Mark Salyzyn <[email protected]>Cc Xiangliang Yu <[email protected]>Cc Jack Wang <[email protected]>Cc Mark Salyzyn <[email protected]>Cc Luben Tuikov <[email protected]>Tested-by Dave Jiang <[email protected]>Signed-off-by Dan Williams <[email protected]>--- drivers/scsi/libsas/sas_scsi_host.c | 39 ++++++++++++++++------------------- 1 files changed, 18 insertions(+), 21 deletions(-)drivers/scsi/libsas/sas_scsi_host.c +1
-2@@ -784,8 +784,7 @@ int sas_target_alloc(struct scsi_target *starget)return 0 ; } -#define SAS_DEF_QD 32 -#define SAS_MAX_QD 64 +#define SAS_DEF_QD 256int sas_slave_configure (struct scsi_device *scsi_dev) {
Quoted 2 lines
______________________________________________________________________
This email may contain privileged or confidential information, which
should
Quoted 1 line
only be used for the purpose for which it was sent by Xyratex. No further
rights
Quoted 1 line
or licenses are granted to use such information. If you are not the
intended
Quoted 1 line
recipient of this message, please notify the sender by return and delete
it.
Quoted 1 line
You may not use, copy, disclose or rely on the information contained in
it.
Quoted 3 lines
Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While
we
Quoted 1 line
have taken reasonable precautions to ensure that this email is free of
viruses,
Quoted 1 line
Xyratex does not accept liability for the presence of any computer viruses
in
Quoted 8 lines
this email, nor for any losses caused as a result of viruses.
Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co
Ltd
Quoted 4 lines
registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________
PATCH 4/5 mvsas: remove mvs_slave_{alloc|configure}
In reply to Dan Williamslibsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only
supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices
--- drivers/scsi/mvsas/mv_init.c | 4 ++-- drivers/scsi/mvsas/mv_sas.c | 30 ------------------------------ drivers/scsi/mvsas/mv_sas.h | 2 -- 3 files changed, 2 insertions(+), 34 deletions(-)
drivers/scsi/mvsas/mv_init.c +2 -2
@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = { .name = DRV_NAME, .queuecommand = sas_queuecommand, .target_alloc = sas_target_alloc, - .slave_configure = mvs_slave_configure, + .slave_configure = sas_slave_configure, .slave_destroy = sas_slave_destroy, .scan_finished = mvs_scan_finished, .scan_start = mvs_scan_start,
@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = { .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, .eh_bus_reset_handler = sas_eh_bus_reset_handler, - .slave_alloc = mvs_slave_alloc, + .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = mvst_host_attrs,
drivers/scsi/mvsas/mv_sas.c +0 -30
@@ -276,36 +276,6 @@ static void mvs_bytes_dmaed(struct mvs_info *mvi, int i) PORTE_BYTES_DMAED); } -int mvs_slave_alloc (struct scsi_device *scsi_dev) -{ -struct domain_device *dev =sdev_to_domain_dev (scsi_dev); -if (dev_is_sata (dev)) { -/* We don't need to rescan targets -* if REPORT_LUNS request is failed -*/ -if (scsi_dev->lun >0 ) -return -ENXIO ; - scsi_dev->tagged_supported =1 ; - } - -return sas_slave_alloc (scsi_dev); -} - -int mvs_slave_configure (struct scsi_device *sdev) -{ -struct domain_device *dev =sdev_to_domain_dev (sdev); -int ret =sas_slave_configure (sdev); - -if (ret) -return ret; -if (!dev_is_sata (dev)) { -sas_change_queue_depth (sdev, -MVS_QUEUE_SIZE , -SCSI_QDEPTH_DEFAULT ); - } -return 0 ; -} -void mvs_scan_start (struct Scsi_Host *shost) {int i, j;
drivers/scsi/mvsas/mv_sas.h +0 -2
@@ -459,8 +459,6 @@ int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, void *funcdata);void __devinit mvs_set_sas_addr (struct mvs_info *mvi,int port_id,u32 off_lo,u32 off_hi,u64 sas_addr); -int mvs_slave_alloc (struct scsi_device *scsi_dev); -int mvs_slave_configure (struct scsi_device *sdev);void mvs_scan_start (struct Scsi_Host *shost);int mvs_scan_finished (struct Scsi_Host *shost,unsigned long time); int mvs_queue_command(struct sas_task *task, const int num,
RE: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
Quoted 40 lines
Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing thequeue_depthof sas devices (up to 256, mvsas only
supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devicesCc Xiangliang Yu <[email protected]>Signed-off-by Dan Williams <[email protected]>--- drivers/scsi/mvsas/mv_init.c | 4 ++-- drivers/scsi/mvsas/mv_sas.c | 30 ------------------------------ drivers/scsi/mvsas/mv_sas.h | 2 -- 3 files changed, 2 insertions(+), 34 deletions(-)drivers/scsi/mvsas/mv_init.c +2
-5@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = { .name = DRV_NAME, .queuecommand = sas_queuecommand, .target_alloc = sas_target_alloc, - .slave_configure = mvs_slave_configure, + .slave_configure = sas_slave_configure, .slave_destroy = sas_slave_destroy, .scan_finished = mvs_scan_finished, .scan_start = mvs_scan_start,@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = { .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, .eh_bus_reset_handler = sas_eh_bus_reset_handler, - .slave_alloc = mvs_slave_alloc, + .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, -int mvs_slave_configure(struct scsi_device *sdev) -{ -struct domain_device *dev =sdev_to_domain_dev (sdev);
drivers/scsi/mvsas/mv_init.c static struct scsi_host_template mvs_sht = {
Quoted 10 lines
drivers/scsi/mvsas/mv_init.c +0
-10-int ret =sas_slave_configure (sdev); - -if (ret) -return ret; -if (!dev_is_sata (dev)) { -sas_change_queue_depth (sdev, -MVS_QUEUE_SIZE , -SCSI_QDEPTH_DEFAULT ); - } -return 0 ;
Can you don't remove mvs_slave_configure function? Someday it will be useful, such as fixing some issue. Thanks!
Re: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
Quoted 44 lines · Xiangliang Yu
Quoted 44 lines
Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing thequeue_depthof sas devices (up to 256, mvsas only
supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devicesCc Xiangliang Yu<[email protected]>Signed-off-by Dan Williams<[email protected]>--- drivers/scsi/mvsas/mv_init.c | 4 ++-- drivers/scsi/mvsas/mv_sas.c | 30 ------------------------------ drivers/scsi/mvsas/mv_sas.h | 2 -- 3 files changed, 2 insertions(+), 34 deletions(-)drivers/scsi/mvsas/mv_init.c +2
-9@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = { .name = DRV_NAME, .queuecommand = sas_queuecommand, .target_alloc = sas_target_alloc, - .slave_configure = mvs_slave_configure, + .slave_configure = sas_slave_configure, .slave_destroy = sas_slave_destroy, .scan_finished = mvs_scan_finished, .scan_start = mvs_scan_start,@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = { .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, .eh_bus_reset_handler = sas_eh_bus_reset_handler, - .slave_alloc = mvs_slave_alloc, + .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, -int mvs_slave_configure(struct scsi_device *sdev) -{ -struct domain_device *dev =sdev_to_domain_dev (sdev); -int ret =sas_slave_configure (sdev); - -if (ret) -return ret;
Quoted 8 lines
drivers/scsi/mvsas/mv_init.c
Quoted 6 lines
drivers/scsi/mvsas/mv_init.c +0
-6-if (!dev_is_sata (dev)) { -sas_change_queue_depth (sdev, -MVS_QUEUE_SIZE , -SCSI_QDEPTH_DEFAULT ); - } -return 0 ;Can you don't remove
mvs_slave_configurefunction? Someday it will be useful, such as fixing some issue. Thanks!
There is no reason to keep a no-op function there.
Jeff
Re: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
In reply to Xiangliang YuQuoted 43 lines · Xiangliang Yu
Quoted 43 lines
Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing thequeue_depthof sas devices (up to 256, mvsas only supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devicesCc Xiangliang Yu <[email protected]>Signed-off-by Dan Williams <[email protected]>---
drivers/scsi/mvsas/mv_init.c | 4 ++--drivers/scsi/mvsas/mv_sas.c| 30 ------------------------------drivers/scsi/mvsas/mv_sas.h| 2 --3 files changed, 2 insertions(+), 34 deletions(-)drivers/scsi/mvsas/mv_init.c +2
-8@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = { .name = DRV_NAME, .queuecommand = sas_queuecommand, .target_alloc = sas_target_alloc, - .slave_configure = mvs_slave_configure, + .slave_configure = sas_slave_configure, .slave_destroy = sas_slave_destroy, .scan_finished = mvs_scan_finished, .scan_start = mvs_scan_start,@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = { .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, .eh_bus_reset_handler = sas_eh_bus_reset_handler, - .slave_alloc = mvs_slave_alloc, + .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, -int mvs_slave_configure (struct scsi_device *sdev) -{ - struct domain_device *dev = sdev_to_domain_dev(sdev); - int ret = sas_slave_configure(sdev); - - if (ret)
Quoted 8 lines
Quoted 7 lines
- return ret;
- if (!dev_is_sata(dev)) {
- sas_change_queue_depth(sdev,
-MVS_QUEUE_SIZE,
-SCSI_QDEPTH_DEFAULT);
- }
- return 0;Can you don't remove
mvs_slave_configurefunction? Someday it will be useful, such as fixing some issue.
That's exactly the point of the patch. The isci driver encountered a bug that the mvsas driver had fixed in its private mvs_slave_alloc() routine. If I had taken the same approach and "fixed" it with a isci_slave_alloc() routine that would still leave aic94xx or any other future libsas driver to rediscover the fix.
If you later find a problem with sas_slave_configure() there's a good chance the fix will be applicable to all libsas drivers. But if it is truly a mvsas specific issue you can always re-introduce mvs_slave_configure().
--
Dan
RE: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
Quoted 62 lines
Subject: Re: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
Quoted 43 lines · Xiangliang Yu
Quoted 43 lines
Subject: [PATCH 4/5] mvsas: remove mvs_slave_{alloc|configure}
libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing thequeue_depthof sas devices (up to 256, mvsas only supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devicesCc Xiangliang Yu <[email protected]>Signed-off-by Dan Williams <[email protected]>---
drivers/scsi/mvsas/mv_init.c | 4 ++--drivers/scsi/mvsas/mv_sas.c| 30 ------------------------------drivers/scsi/mvsas/mv_sas.h| 2 --3 files changed, 2 insertions(+), 34 deletions(-)drivers/scsi/mvsas/mv_init.c +2
-8@@ -59,7 +59,7 @@ static struct scsi_host_template mvs_sht = { .name = DRV_NAME, .queuecommand = sas_queuecommand, .target_alloc = sas_target_alloc, - .slave_configure = mvs_slave_configure, + .slave_configure = sas_slave_configure, .slave_destroy = sas_slave_destroy, .scan_finished = mvs_scan_finished, .scan_start = mvs_scan_start,@@ -74,7 +74,7 @@ static struct scsi_host_template mvs_sht = { .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, .eh_bus_reset_handler = sas_eh_bus_reset_handler, - .slave_alloc = mvs_slave_alloc, + .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, -int mvs_slave_configure (struct scsi_device *sdev) -{ - struct domain_device *dev = sdev_to_domain_dev(sdev); - int ret = sas_slave_configure(sdev); - - if (ret)Quoted 8 lines
Quoted 7 lines
- return ret;
- if (!dev_is_sata(dev)) {
- sas_change_queue_depth(sdev,
-MVS_QUEUE_SIZE,
-SCSI_QDEPTH_DEFAULT);
- }
- return 0;Can you don't remove
mvs_slave_configurefunction? Someday it will be useful,such as fixing some issue.
That's exactly the point of the patch. The isci driver encountered a bug that the mvsas driver had fixed in its private
mvs_slave_alloc()routine. If I had taken the same approach and "fixed" it with aisci_slave_alloc()routine that would still leave aic94xx or any other future libsas driver to rediscover the fix.
Quoted 4 lines
If you later find a problem with
sas_slave_configure()there's a good chance the fix will be applicable to all libsas drivers. But if it is truly a mvsas specific issue you can always re-introducemvs_slave_configure().
Sound good.
PATCH 5/5 pm8001: remove pm8001_slave_{alloc|configure}
In reply to Dan Williamslibsas handles:
1/ limiting ata scanning to lun0
2/ changes to /sys/block/<sdX>/device/queue_depth for ata devices
libata handles turning off ncq globally via kernel command line (libata.force=noncq) or sysfs (echo 1 > /sys/block/<sdX>/device/queue_depth). A lldd specific compile option is not necessary.
--- drivers/scsi/pm8001/pm8001_init.c | 4 ++-- drivers/scsi/pm8001/pm8001_sas.c | 31 +------------------------------ drivers/scsi/pm8001/pm8001_sas.h | 2 -- 3 files changed, 3 insertions(+), 34 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +2 -2
@@ -61,7 +61,7 @@ static struct scsi_host_template pm8001_sht = { .name = DRV_NAME, .queuecommand = sas_queuecommand, .target_alloc = sas_target_alloc, - .slave_configure = pm8001_slave_configure, + .slave_configure = sas_slave_configure, .slave_destroy = sas_slave_destroy, .scan_finished = pm8001_scan_finished, .scan_start = pm8001_scan_start,
@@ -76,7 +76,7 @@ static struct scsi_host_template pm8001_sht = { .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, .eh_bus_reset_handler = sas_eh_bus_reset_handler, - .slave_alloc = pm8001_slave_alloc, + .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = pm8001_host_attrs,
drivers/scsi/pm8001/pm8001_sas.c +1 -30
@@ -216,20 +216,6 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,return rc; } -int pm8001_slave_alloc (struct scsi_device *scsi_dev) -{ -struct domain_device *dev =sdev_to_domain_dev (scsi_dev); -if (dev_is_sata (dev)) { -/* We don't need to rescan targets -* if REPORT_LUNS request is failed -*/ -if (scsi_dev->lun >0 ) -return -ENXIO ; - scsi_dev->tagged_supported =1 ; - } -return sas_slave_alloc (scsi_dev); -} -/** * pm8001_scan_start - we should enable all HBA phys by sending the phy_start * command to HBA.
@@ -314,22 +300,7 @@ static int pm8001_task_prep_ssp(struct pm8001_hba_info *pm8001_ha, {return PM8001_CHIP_DISP ->ssp_io_req (pm8001_ha, ccb); } -int pm8001_slave_configure (struct scsi_device *sdev) -{ -struct domain_device *dev =sdev_to_domain_dev (sdev); -int ret =sas_slave_configure (sdev); -if (ret) -return ret; -if (dev_is_sata (dev)) { -#ifdef PM8001_DISABLE_NCQ -struct ata_port *ap = dev->sata_dev.ap; -struct ata_device *adev = ap->link.device; - adev->flags |=ATA_DFLAG_NCQ_OFF ; -scsi_adjust_queue_depth (sdev,MSG_SIMPLE_TAG ,1 ); -#endif - } -return 0 ; -} +/* Find the local port id that's attached to this device */ static int sas_find_local_port_id (struct domain_device *dev) {
drivers/scsi/pm8001/pm8001_sas.h +0 -2
@@ -471,8 +471,6 @@ void pm8001_ccb_task_free(struct pm8001_hba_info *pm8001_ha, struct sas_task *task, struct pm8001_ccb_info *ccb, u32 ccb_idx);int pm8001_phy_control (struct asd_sas_phy *sas_phy,enum phy_func func,void *funcdata); -int pm8001_slave_alloc (struct scsi_device *scsi_dev); -int pm8001_slave_configure (struct scsi_device *sdev);void pm8001_scan_start (struct Scsi_Host *shost);int pm8001_scan_finished (struct Scsi_Host *shost,unsigned long time); int pm8001_queue_command(struct sas_task *task, const int num,
Hi Dan
Thanks for doing this, I'm OK with the patchset.
[PATCH 0/5] libsas fixes discovered via isci-atapi enabling effort
Quoted 40 lines
While enabling atapi device support for isci we encountered a condition whereby multiple srX devices (one for every possible LUN) were exported by the midlayer. Looking at other drivers showed that they had a local workaround for this and other conditions in custom ->slave_{alloc|configure} methods. Rather than add custom workaround for isci this patchset uplevels those workarounds to libsas proper.
Patch 3/5 is tagged RFC as I do not know the original history behind hard limiting libsas end devices to a
queue_depthof 32. At least mvsas has been bumping this up to 64 on its own.---
Dan Williams (5):
libsas: disable scanning lun > 0 on ata devices libsas: fix ->change_queue_{depth|type} for sata devices libsas: dynamic queue depth mvsas: remove mvs_slave_{alloc|configure} pm8001: remove pm8001_slave_{alloc|configure}drivers/ata/libata-core.c | 1 + drivers/ata/libata-scsi.c | 44 +++++++++++++++++++++++------------ drivers/scsi/libsas/sas_scsi_host.c | 42 +++++++++++++++++++-------------- drivers/scsi/mvsas/mv_init.c | 4 ++- drivers/scsi/mvsas/mv_sas.c | 30 ------------------------ drivers/scsi/mvsas/mv_sas.h | 2 -- drivers/scsi/pm8001/pm8001_init.c | 4 ++- drivers/scsi/pm8001/pm8001_sas.c | 31 +------------------------ drivers/scsi/pm8001/pm8001_sas.h | 2 -- drivers/scsi/scsi_transport_sas.c | 10 ++++++-- include/linux/libata.h | 2 ++ 11 files changed, 69 insertions(+), 103 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html