diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2009-12-02 13:36:54 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-10 09:54:18 -0500 |
commit | c45dd30551c371cb1e7a742136b8b36f6aba63f8 (patch) | |
tree | aaeb5ed7563dfd6d562393b4ba0eba5c7149cb95 /drivers | |
parent | 1486400f7edd009d49550da968d5744e246dc7f8 (diff) |
[SCSI] qla2xxx: Queue depth ramp up/down modification changes.
Removed the module parameters ql2xqfulltracking and ql2xqfullrampup
since the queue depth ramp up/down functionality is moved to scsi-ml.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 92 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 69 |
4 files changed, 51 insertions, 115 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 6b9bf23c7735..7a81e988fffe 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -1570,9 +1570,6 @@ typedef struct fc_port { | |||
1570 | struct fc_rport *rport, *drport; | 1570 | struct fc_rport *rport, *drport; |
1571 | u32 supported_classes; | 1571 | u32 supported_classes; |
1572 | 1572 | ||
1573 | unsigned long last_queue_full; | ||
1574 | unsigned long last_ramp_up; | ||
1575 | |||
1576 | uint16_t vp_idx; | 1573 | uint16_t vp_idx; |
1577 | } fc_port_t; | 1574 | } fc_port_t; |
1578 | 1575 | ||
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index e21851358509..0b6801fc6389 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -72,8 +72,6 @@ extern int ql2xloginretrycount; | |||
72 | extern int ql2xfdmienable; | 72 | extern int ql2xfdmienable; |
73 | extern int ql2xallocfwdump; | 73 | extern int ql2xallocfwdump; |
74 | extern int ql2xextended_error_logging; | 74 | extern int ql2xextended_error_logging; |
75 | extern int ql2xqfullrampup; | ||
76 | extern int ql2xqfulltracking; | ||
77 | extern int ql2xiidmaenable; | 75 | extern int ql2xiidmaenable; |
78 | extern int ql2xmaxqueues; | 76 | extern int ql2xmaxqueues; |
79 | extern int ql2xmultique_tag; | 77 | extern int ql2xmultique_tag; |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 804987397b77..bc07d8392ac3 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -811,78 +811,6 @@ skip_rio: | |||
811 | qla2x00_alert_all_vps(rsp, mb); | 811 | qla2x00_alert_all_vps(rsp, mb); |
812 | } | 812 | } |
813 | 813 | ||
814 | static void | ||
815 | qla2x00_adjust_sdev_qdepth_up(struct scsi_device *sdev, void *data) | ||
816 | { | ||
817 | fc_port_t *fcport = data; | ||
818 | struct scsi_qla_host *vha = fcport->vha; | ||
819 | struct qla_hw_data *ha = vha->hw; | ||
820 | struct req_que *req = NULL; | ||
821 | |||
822 | if (!ql2xqfulltracking) | ||
823 | return; | ||
824 | |||
825 | req = vha->req; | ||
826 | if (!req) | ||
827 | return; | ||
828 | if (req->max_q_depth <= sdev->queue_depth) | ||
829 | return; | ||
830 | |||
831 | if (sdev->ordered_tags) | ||
832 | scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, | ||
833 | sdev->queue_depth + 1); | ||
834 | else | ||
835 | scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, | ||
836 | sdev->queue_depth + 1); | ||
837 | |||
838 | fcport->last_ramp_up = jiffies; | ||
839 | |||
840 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
841 | "scsi(%ld:%d:%d:%d): Queue depth adjusted-up to %d.\n", | ||
842 | fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun, | ||
843 | sdev->queue_depth)); | ||
844 | } | ||
845 | |||
846 | static void | ||
847 | qla2x00_adjust_sdev_qdepth_down(struct scsi_device *sdev, void *data) | ||
848 | { | ||
849 | fc_port_t *fcport = data; | ||
850 | |||
851 | if (!scsi_track_queue_full(sdev, sdev->queue_depth - 1)) | ||
852 | return; | ||
853 | |||
854 | DEBUG2(qla_printk(KERN_INFO, fcport->vha->hw, | ||
855 | "scsi(%ld:%d:%d:%d): Queue depth adjusted-down to %d.\n", | ||
856 | fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun, | ||
857 | sdev->queue_depth)); | ||
858 | } | ||
859 | |||
860 | static inline void | ||
861 | qla2x00_ramp_up_queue_depth(scsi_qla_host_t *vha, struct req_que *req, | ||
862 | srb_t *sp) | ||
863 | { | ||
864 | fc_port_t *fcport; | ||
865 | struct scsi_device *sdev; | ||
866 | |||
867 | if (!ql2xqfulltracking) | ||
868 | return; | ||
869 | |||
870 | sdev = sp->cmd->device; | ||
871 | if (sdev->queue_depth >= req->max_q_depth) | ||
872 | return; | ||
873 | |||
874 | fcport = sp->fcport; | ||
875 | if (time_before(jiffies, | ||
876 | fcport->last_ramp_up + ql2xqfullrampup * HZ)) | ||
877 | return; | ||
878 | if (time_before(jiffies, | ||
879 | fcport->last_queue_full + ql2xqfullrampup * HZ)) | ||
880 | return; | ||
881 | |||
882 | starget_for_each_device(sdev->sdev_target, fcport, | ||
883 | qla2x00_adjust_sdev_qdepth_up); | ||
884 | } | ||
885 | |||
886 | /** | 814 | /** |
887 | * qla2x00_process_completed_request() - Process a Fast Post response. | 815 | * qla2x00_process_completed_request() - Process a Fast Post response. |
888 | * @ha: SCSI driver HA context | 816 | * @ha: SCSI driver HA context |
@@ -913,8 +841,6 @@ qla2x00_process_completed_request(struct scsi_qla_host *vha, | |||
913 | 841 | ||
914 | /* Save ISP completion status */ | 842 | /* Save ISP completion status */ |
915 | sp->cmd->result = DID_OK << 16; | 843 | sp->cmd->result = DID_OK << 16; |
916 | |||
917 | qla2x00_ramp_up_queue_depth(vha, req, sp); | ||
918 | qla2x00_sp_compl(ha, sp); | 844 | qla2x00_sp_compl(ha, sp); |
919 | } else { | 845 | } else { |
920 | DEBUG2(printk("scsi(%ld) Req:%d: Invalid ISP SCSI completion" | 846 | DEBUG2(printk("scsi(%ld) Req:%d: Invalid ISP SCSI completion" |
@@ -1435,13 +1361,6 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
1435 | "scsi(%ld): QUEUE FULL status detected " | 1361 | "scsi(%ld): QUEUE FULL status detected " |
1436 | "0x%x-0x%x.\n", vha->host_no, comp_status, | 1362 | "0x%x-0x%x.\n", vha->host_no, comp_status, |
1437 | scsi_status)); | 1363 | scsi_status)); |
1438 | |||
1439 | /* Adjust queue depth for all luns on the port. */ | ||
1440 | if (!ql2xqfulltracking) | ||
1441 | break; | ||
1442 | fcport->last_queue_full = jiffies; | ||
1443 | starget_for_each_device(cp->device->sdev_target, | ||
1444 | fcport, qla2x00_adjust_sdev_qdepth_down); | ||
1445 | break; | 1364 | break; |
1446 | } | 1365 | } |
1447 | if (lscsi_status != SS_CHECK_CONDITION) | 1366 | if (lscsi_status != SS_CHECK_CONDITION) |
@@ -1516,17 +1435,6 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
1516 | "scsi(%ld): QUEUE FULL status detected " | 1435 | "scsi(%ld): QUEUE FULL status detected " |
1517 | "0x%x-0x%x.\n", vha->host_no, comp_status, | 1436 | "0x%x-0x%x.\n", vha->host_no, comp_status, |
1518 | scsi_status)); | 1437 | scsi_status)); |
1519 | |||
1520 | /* | ||
1521 | * Adjust queue depth for all luns on the | ||
1522 | * port. | ||
1523 | */ | ||
1524 | if (!ql2xqfulltracking) | ||
1525 | break; | ||
1526 | fcport->last_queue_full = jiffies; | ||
1527 | starget_for_each_device( | ||
1528 | cp->device->sdev_target, fcport, | ||
1529 | qla2x00_adjust_sdev_qdepth_down); | ||
1530 | break; | 1438 | break; |
1531 | } | 1439 | } |
1532 | if (lscsi_status != SS_CHECK_CONDITION) | 1440 | if (lscsi_status != SS_CHECK_CONDITION) |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 58edc0deb74b..2f873d237325 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -78,21 +78,6 @@ module_param(ql2xmaxqdepth, int, S_IRUGO|S_IWUSR); | |||
78 | MODULE_PARM_DESC(ql2xmaxqdepth, | 78 | MODULE_PARM_DESC(ql2xmaxqdepth, |
79 | "Maximum queue depth to report for target devices."); | 79 | "Maximum queue depth to report for target devices."); |
80 | 80 | ||
81 | int ql2xqfulltracking = 1; | ||
82 | module_param(ql2xqfulltracking, int, S_IRUGO|S_IWUSR); | ||
83 | MODULE_PARM_DESC(ql2xqfulltracking, | ||
84 | "Controls whether the driver tracks queue full status " | ||
85 | "returns and dynamically adjusts a scsi device's queue " | ||
86 | "depth. Default is 1, perform tracking. Set to 0 to " | ||
87 | "disable dynamic tracking and adjustment of queue depth."); | ||
88 | |||
89 | int ql2xqfullrampup = 120; | ||
90 | module_param(ql2xqfullrampup, int, S_IRUGO|S_IWUSR); | ||
91 | MODULE_PARM_DESC(ql2xqfullrampup, | ||
92 | "Number of seconds to wait to begin to ramp-up the queue " | ||
93 | "depth for a device after a queue-full condition has been " | ||
94 | "detected. Default is 120 seconds."); | ||
95 | |||
96 | int ql2xiidmaenable=1; | 81 | int ql2xiidmaenable=1; |
97 | module_param(ql2xiidmaenable, int, S_IRUGO|S_IRUSR); | 82 | module_param(ql2xiidmaenable, int, S_IRUGO|S_IRUSR); |
98 | MODULE_PARM_DESC(ql2xiidmaenable, | 83 | MODULE_PARM_DESC(ql2xiidmaenable, |
@@ -1217,13 +1202,61 @@ qla2xxx_slave_destroy(struct scsi_device *sdev) | |||
1217 | sdev->hostdata = NULL; | 1202 | sdev->hostdata = NULL; |
1218 | } | 1203 | } |
1219 | 1204 | ||
1205 | static void qla2x00_handle_queue_full(struct scsi_device *sdev, int qdepth) | ||
1206 | { | ||
1207 | fc_port_t *fcport = (struct fc_port *) sdev->hostdata; | ||
1208 | |||
1209 | if (!scsi_track_queue_full(sdev, qdepth)) | ||
1210 | return; | ||
1211 | |||
1212 | DEBUG2(qla_printk(KERN_INFO, fcport->vha->hw, | ||
1213 | "scsi(%ld:%d:%d:%d): Queue depth adjusted-down to %d.\n", | ||
1214 | fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun, | ||
1215 | sdev->queue_depth)); | ||
1216 | } | ||
1217 | |||
1218 | static void qla2x00_adjust_sdev_qdepth_up(struct scsi_device *sdev, int qdepth) | ||
1219 | { | ||
1220 | fc_port_t *fcport = sdev->hostdata; | ||
1221 | struct scsi_qla_host *vha = fcport->vha; | ||
1222 | struct qla_hw_data *ha = vha->hw; | ||
1223 | struct req_que *req = NULL; | ||
1224 | |||
1225 | req = vha->req; | ||
1226 | if (!req) | ||
1227 | return; | ||
1228 | |||
1229 | if (req->max_q_depth <= sdev->queue_depth || req->max_q_depth < qdepth) | ||
1230 | return; | ||
1231 | |||
1232 | if (sdev->ordered_tags) | ||
1233 | scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, qdepth); | ||
1234 | else | ||
1235 | scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, qdepth); | ||
1236 | |||
1237 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
1238 | "scsi(%ld:%d:%d:%d): Queue depth adjusted-up to %d.\n", | ||
1239 | fcport->vha->host_no, sdev->channel, sdev->id, sdev->lun, | ||
1240 | sdev->queue_depth)); | ||
1241 | } | ||
1242 | |||
1220 | static int | 1243 | static int |
1221 | qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason) | 1244 | qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason) |
1222 | { | 1245 | { |
1223 | if (reason != SCSI_QDEPTH_DEFAULT) | 1246 | switch (reason) { |
1224 | return -EOPNOTSUPP; | 1247 | case SCSI_QDEPTH_DEFAULT: |
1248 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth); | ||
1249 | break; | ||
1250 | case SCSI_QDEPTH_QFULL: | ||
1251 | qla2x00_handle_queue_full(sdev, qdepth); | ||
1252 | break; | ||
1253 | case SCSI_QDEPTH_RAMP_UP: | ||
1254 | qla2x00_adjust_sdev_qdepth_up(sdev, qdepth); | ||
1255 | break; | ||
1256 | default: | ||
1257 | return EOPNOTSUPP; | ||
1258 | } | ||
1225 | 1259 | ||
1226 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth); | ||
1227 | return sdev->queue_depth; | 1260 | return sdev->queue_depth; |
1228 | } | 1261 | } |
1229 | 1262 | ||