From: Mike Christie <michaelc@cs.wisc.edu>
To: Christof Schmitt <christof.schmitt@de.ibm.com>
Cc: linux-scsi@vger.kernel.org, James Smart <James.Smart@Emulex.Com>,
Andrew Vasquez <linux-driver@qlogic.com>
Subject: Re: [RFC PATCH 2/4] scsi error: have scsi-ml call change_queue_depth to handle QUEUE_FULL
Date: Mon, 15 Jun 2009 12:34:49 -0500 [thread overview]
Message-ID: <4A368639.20701@cs.wisc.edu> (raw)
In-Reply-To: <20090612124849.GA8017@schmichrtp.de.ibm.com>
On 06/12/2009 07:48 AM, Christof Schmitt wrote:
> On Tue, May 19, 2009 at 12:52:45AM -0500, michaelc@cs.wisc.edu wrote:
>> From: Mike Christie<michaelc@cs.wisc.edu>
>>
>> This has scsi-ml call the change_queue_depth functions when
>> we get a QUEUE_FULL. It will only change the queue depth if
>> change_queue_depth is set because the LLD may have to
>> modify some internal resources, so I thought this would
>> be the safest route.
>>
>>
>> Signed-off-by: Mike Christie<michaelc@cs.wisc.edu>
>> ---
>> drivers/scsi/scsi_error.c | 26 +++++++++++++++++++++++++-
>> 1 files changed, 25 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
>> index 0c2c73b..792644e 100644
>> --- a/drivers/scsi/scsi_error.c
>> +++ b/drivers/scsi/scsi_error.c
>> @@ -331,6 +331,27 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
>> }
>> }
>>
>> +static void scsi_handle_queue_full(struct scsi_device *sdev)
>> +{
>> + struct scsi_host_template *sht = sdev->host->hostt;
>> + struct scsi_device *tmp_sdev;
>> +
>> + if (!sht->change_queue_depth)
>> + return;
>> +
>> + shost_for_each_device(tmp_sdev, sdev->host) {
>> + if (tmp_sdev->id != sdev->id)
>> + continue;
>> + /*
>> + * We do not know the number of commands that were at
>> + * the device when we got the queue full so we start
>> + * from the highest possible value and work our way down.
>> + */
>> + sht->change_queue_depth(tmp_sdev, tmp_sdev->queue_depth - 1,
>> + SCSI_QDEPTH_QFULL);
>> + }
>> +}
>> +
>
> This was called because of a "queue full" for one SCSI device. Why do
> you decrement the queue depth for all SCSI devices on the same host
> and not only for one device?
It should actually do it for only the devices on the same target where
the problem occurred. I copied the code from lpfc and qla2xxx and cannot
remember the reason why this is done now. I am ccing AndrewV and JamesS.
next prev parent reply other threads:[~2009-06-15 17:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 5:52 RFC: handle queue_depth adjustments because of QUEUE_FULLs in scsi_error.c michaelc
2009-05-19 5:52 ` michaelc
2009-05-19 5:52 ` [RFC PATCH 1/4] scsi-ml: modify change_queue_depth to take in reason why it is being called michaelc
2009-05-19 5:52 ` [RFC PATCH 2/4] scsi error: have scsi-ml call change_queue_depth to handle QUEUE_FULL michaelc
2009-05-19 5:52 ` [RFC PATCH 3/4] drivers: convert drivers setting the change_queue_depth callback michaelc
2009-05-19 5:52 ` [RFC PATCH 4/4] drivers: convert fc drivers calling scsi_track_queue_full michaelc
2009-06-12 12:57 ` Christof Schmitt
2009-06-12 12:48 ` [RFC PATCH 2/4] scsi error: have scsi-ml call change_queue_depth to handle QUEUE_FULL Christof Schmitt
2009-06-15 17:34 ` Mike Christie [this message]
2009-06-16 13:16 ` James Smart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A368639.20701@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=James.Smart@Emulex.Com \
--cc=christof.schmitt@de.ibm.com \
--cc=linux-driver@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).