]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/qla2xxx-disable-automatic-queue-tracking
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / qla2xxx-disable-automatic-queue-tracking
1 From: Mike Reed <mdr@sgi.com>
2 Subject: qla2xxx: Conditionally disable queue_full tracking
3 References: bnc#449386
4
5 Changing a lun's queue depth (/sys/block/sdX/device/queue_depth) isn't
6 sticky when the device is connected via a QLogic fibre channel adapter.
7
8 The QLogic qla2xxx fibre channel driver dynamically adjusts a lun's queue
9 depth. If a user has a specific need to limit the number of commands issued
10 to a lun (say a tape drive, or a shared raid where the total commands issued
11 to all luns is limited at the controller level, for example) and writes a
12 limiting value to /sys/block/sdXX/device/queue_depth, the qla2xxx driver will
13 silently and gradually increase the queue depth back to the driver limit
14 of ql2xmaxqdepth. While reducing this value (module parameter) or increasing
15 the interval between ramp ups (ql2xqfullrampup) offers the potential for a
16 work around it would be better to have the option of just disabling the
17 dynamic adjustment of queue depth.
18
19 This patch implements an "off switch" as a module parameter. Applies to
20 2.6.28-rc6-git1.
21
22 Signed-off-by: Michael Reed <mdr@sgi.com>
23 Signed-off-by: Hannes Reinecke <hare@suse.de>
24
25 ---
26 drivers/scsi/qla2xxx/qla_gbl.h | 1 +
27 drivers/scsi/qla2xxx/qla_isr.c | 10 ++++++++++
28 drivers/scsi/qla2xxx/qla_os.c | 8 ++++++++
29 3 files changed, 19 insertions(+)
30
31 --- a/drivers/scsi/qla2xxx/qla_gbl.h
32 +++ b/drivers/scsi/qla2xxx/qla_gbl.h
33 @@ -63,6 +63,7 @@ extern int ql2xallocfwdump;
34 extern int ql2xextended_error_logging;
35 extern int ql2xqfullrampup;
36 extern int ql2xiidmaenable;
37 +extern int ql2xqfulltracking;
38
39 extern int qla2x00_loop_reset(scsi_qla_host_t *);
40 extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
41 --- a/drivers/scsi/qla2xxx/qla_isr.c
42 +++ b/drivers/scsi/qla2xxx/qla_isr.c
43 @@ -691,6 +691,9 @@ qla2x00_adjust_sdev_qdepth_up(struct scs
44 {
45 fc_port_t *fcport = data;
46
47 + if (!ql2xqfulltracking)
48 + return;
49 +
50 if (fcport->ha->max_q_depth <= sdev->queue_depth)
51 return;
52
53 @@ -729,6 +732,9 @@ qla2x00_ramp_up_queue_depth(scsi_qla_hos
54 fc_port_t *fcport;
55 struct scsi_device *sdev;
56
57 + if (!ql2xqfulltracking)
58 + return;
59 +
60 sdev = sp->cmd->device;
61 if (sdev->queue_depth >= ha->max_q_depth)
62 return;
63 @@ -1043,6 +1049,8 @@ qla2x00_status_entry(scsi_qla_host_t *ha
64 scsi_status));
65
66 /* Adjust queue depth for all luns on the port. */
67 + if (!ql2xqfulltracking)
68 + break;
69 fcport->last_queue_full = jiffies;
70 starget_for_each_device(cp->device->sdev_target,
71 fcport, qla2x00_adjust_sdev_qdepth_down);
72 @@ -1102,6 +1110,8 @@ qla2x00_status_entry(scsi_qla_host_t *ha
73 * Adjust queue depth for all luns on the
74 * port.
75 */
76 + if (!ql2xqfulltracking)
77 + break;
78 fcport->last_queue_full = jiffies;
79 starget_for_each_device(
80 cp->device->sdev_target, fcport,
81 --- a/drivers/scsi/qla2xxx/qla_os.c
82 +++ b/drivers/scsi/qla2xxx/qla_os.c
83 @@ -79,6 +79,14 @@ module_param(ql2xmaxqdepth, int, S_IRUGO
84 MODULE_PARM_DESC(ql2xmaxqdepth,
85 "Maximum queue depth to report for target devices.");
86
87 +int ql2xqfulltracking = 1;
88 +module_param(ql2xqfulltracking, int, S_IRUGO|S_IWUSR);
89 +MODULE_PARM_DESC(ql2xqfulltracking,
90 + "Controls whether the driver tracks queue full status "
91 + "returns and dynamically adjusts a scsi device's queue "
92 + "depth. Default is 1, perform tracking. Set to 0 to "
93 + "disable dynamic tracking and adjustment of queue depth.");
94 +
95 int ql2xqfullrampup = 120;
96 module_param(ql2xqfullrampup, int, S_IRUGO|S_IWUSR);
97 MODULE_PARM_DESC(ql2xqfullrampup,