[SCSI] qla2xxx: Conditionally disable automatic queue full tracking.
authorMichael Reed <mdr@sgi.com>
Tue, 7 Apr 2009 05:33:47 +0000 (22:33 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 20 May 2009 22:21:10 +0000 (17:21 -0500)
Changing a lun's queue depth (/sys/block/sdX/device/queue_depth)
isn't sticky when the device is connected via a QLogic fibre
channel adapter.

The QLogic qla2xxx fibre channel driver dynamically adjusts a
lun's queue depth.  If a user has a specific need to limit the
number of commands issued to a lun (say a tape drive, or a shared
raid where the total commands issued to all luns is limited at
the controller level, for example) and writes a limiting value to
/sys/block/sdXX/device/queue_depth, the qla2xxx driver will
silently and gradually increase the queue depth back to the
driver limit of ql2xmaxqdepth.  While reducing this value (module
parameter) or increasing the interval between ramp ups
(ql2xqfullrampup) offers the potential for a work around it would
be better to have the option of just disabling the dynamic
adjustment of queue depth.

This patch implements an "off switch" as a module parameter.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_os.c

index b12de017624675ef8096b584fc570d5863c80e2a..5347e35e7d6182295648515e2ddde11fb9b7e166 100644 (file)
@@ -65,6 +65,7 @@ extern int ql2xfdmienable;
 extern int ql2xallocfwdump;
 extern int ql2xextended_error_logging;
 extern int ql2xqfullrampup;
+extern int ql2xqfulltracking;
 extern int ql2xiidmaenable;
 extern int ql2xmaxqueues;
 extern int ql2xmultique_tag;
index 41e50c2bec0f55dde7674651de513424ecb3e038..eb35d2050f7af7d41746e07b302d1de8d8e65115 100644 (file)
@@ -765,6 +765,9 @@ qla2x00_adjust_sdev_qdepth_up(struct scsi_device *sdev, void *data)
        struct qla_hw_data *ha = vha->hw;
        struct req_que *req = NULL;
 
+       if (!ql2xqfulltracking)
+               return;
+
        req = vha->req;
        if (!req)
                return;
@@ -807,6 +810,9 @@ qla2x00_ramp_up_queue_depth(scsi_qla_host_t *vha, struct req_que *req,
        fc_port_t *fcport;
        struct scsi_device *sdev;
 
+       if (!ql2xqfulltracking)
+               return;
+
        sdev = sp->cmd->device;
        if (sdev->queue_depth >= req->max_q_depth)
                return;
@@ -1125,6 +1131,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                            scsi_status));
 
                        /* Adjust queue depth for all luns on the port. */
+                       if (!ql2xqfulltracking)
+                               break;
                        fcport->last_queue_full = jiffies;
                        starget_for_each_device(cp->device->sdev_target,
                            fcport, qla2x00_adjust_sdev_qdepth_down);
@@ -1183,6 +1191,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                                 * Adjust queue depth for all luns on the
                                 * port.
                                 */
+                               if (!ql2xqfulltracking)
+                                       break;
                                fcport->last_queue_full = jiffies;
                                starget_for_each_device(
                                    cp->device->sdev_target, fcport,
index 94e53a5fd9aa6aa7eb02ae6b15e7f7e7d9c530a9..155a204ed8e5e71c45ba0d307e907155b5f1ec64 100644 (file)
@@ -77,6 +77,14 @@ module_param(ql2xmaxqdepth, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xmaxqdepth,
                "Maximum queue depth to report for target devices.");
 
+int ql2xqfulltracking = 1;
+module_param(ql2xqfulltracking, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ql2xqfulltracking,
+               "Controls whether the driver tracks queue full status "
+               "returns and dynamically adjusts a scsi device's queue "
+               "depth.  Default is 1, perform tracking.  Set to 0 to "
+               "disable dynamic tracking and adjustment of queue depth.");
+
 int ql2xqfullrampup = 120;
 module_param(ql2xqfullrampup, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xqfullrampup,