From: James Smart <James.Smart@Emulex.Com>
To: Seokmann Ju <seokmann.ju@qlogic.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"andrew.vasquez@qlogic.com" <andrew.vasquez@qlogic.com>,
"sven@linux.vnet.ibm.com" <sven@linux.vnet.ibm.com>
Subject: Re: [RFC] FC pass thru - Rev IV
Date: Mon, 24 Nov 2008 16:03:01 -0500 [thread overview]
Message-ID: <492B1685.4020709@emulex.com> (raw)
In-Reply-To: <C49C4ADF-8DA1-4D86-AEBB-AC46A04FCA62@qlogic.com>
Seokmann Ju wrote:
> A couple of questions.
> 1. Should 'loopback' considered at this time?
:)
This is a topic for the transport generically, independent of any
pass-thru thing.
> 2. Would it be valuable to consider sending requests with
> WWNN:WWPN?
I considered this, especially for the fchost ELS request. But it means
the LLDD has to do a nameserver query to find the n_port_id
corresponding to the names before it sent the ELS. It started to feel
like too much ancillary stuff for the LLDD to do to support the
request - so I punted. However, the app, where we typically don't
care if it has to do more work, is free to do this and resolve it to
the basic primitives. :)
>> +/**
>> + * fc_bsg_job_timeout - handler for when a bsg request timesout
>> + * @req: request that timed out
>> + */
>> +static enum blk_eh_timer_return
>> +fc_bsg_job_timeout(struct request *req)
>> +{
>> + struct fc_bsg_job *job = (void *) req->special;
>> + struct Scsi_Host *shost = job->shost;
>> + struct fc_internal *i = to_fc_internal(shost->transportt);
>> + unsigned long flags;
>> + int err = 0, done = 0;
>> +
>> + if (job->rport && job->rport->port_state == FC_PORTSTATE_BLOCKED)
>> + return BLK_EH_RESET_TIMER;
>> +
>> + spin_lock_irqsave(&job->job_lock, flags);
>> + if (job->state_flags & FC_RQST_STATE_DONE)
>> + done = 1;
>> + else
>> + job->ref_cnt++;
> Any reason to increase ref_cnt here?
> I think that the ref_cnt is already 1 when it came here so that we don't
> want to change it to destroy the job successfully.
Yes - I'm taking an additional reference on the job, so that if the
completion routine is completing in parallel to the timeout code path,
it won't free the job out from under the timeout call that calls back
into the LLDD.
>> +/**
>> + * fc_bsg_request_handler - generic handler for bsg requests
>> + * @q: request queue to manage
>> + * @shost: Scsi_Host related to the bsg object
>> + * @rport: FC remote port related to the bsg object (optional)
>> + * @dev: device structure for bsg object
>> + */
>> +static void
>> +fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host
>> *shost,
>> + struct fc_rport *rport, struct device *dev)
>> +{
>> + struct request *req;
>> + struct fc_bsg_job *job;
>> + enum fc_dispatch_result ret;
>> +
>> + if (!get_device(dev))
>> + return;
>> +
>> + while (!blk_queue_plugged(q)) {
>> + req = elv_next_request(q);
>> + if (!req)
>> + break;
>> +
>> + if (rport && (rport->port_state == FC_PORTSTATE_BLOCKED))
>> + break;
> Shouldn't this be moved to into fc_bsg_rport_dispatch()?
I had originally done this, but moved it back to this location.
Why ? if I moved this out, I also had to move out the code between this
and the call to fc_bsg_rport_dispatch() too. This was just a code
organization choice so I could keep the calls to allocate the job, etc
within this one routine. It also created a nice division on which
code-path-on-error had to be dealt with when it fails. Now, this
generic routine is the only one that would call blk_complete_request()
or leave the request queued, while the rport/fchost dispatch functions
*always* call the fc_bsg_jobdone() function - on error or completion.
>> +
>> + spin_unlock_irq(q->queue_lock);
>> +
>> + ret = fc_req_to_bsgjob(shost, rport, req);
>> + if (ret) {
>> + req->errors = ret;
>> + spin_lock_irq(q->queue_lock);
>> + blk_complete_request(req);
> Shouldn't this be blk_end_bidi_request()/blk_end_request()?
A good question, that I was hoping to have cleared up. If this was true,
there were a lot of errors in the last passthru code.
If I remember right - I looked at what was also happening within scsi,
and it sure appeared as if blk_complete_request() will handle the dual
condition fine.
-- james s
next prev parent reply other threads:[~2008-11-24 21:02 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-18 21:24 [RFC] FC pass thru - Rev IV James Smart
2008-11-24 15:46 ` Sven Schuetz
2008-11-24 16:29 ` James Smart
2008-11-25 15:08 ` Sven Schuetz
2008-11-25 15:56 ` James Smart
2008-11-24 20:37 ` Seokmann Ju
2008-11-24 21:03 ` James Smart [this message]
2008-11-25 14:38 ` Seokmann Ju
2008-11-25 15:47 ` James Smart
2008-12-01 21:49 ` Seokmann Ju
2008-12-01 22:09 ` James Smart
2008-11-26 18:25 ` Sven Schuetz
2008-11-26 18:58 ` James Smart
2008-11-27 7:03 ` FUJITA Tomonori
2008-11-27 8:58 ` Boaz Harrosh
2008-11-27 9:53 ` FUJITA Tomonori
2008-11-27 11:51 ` Boaz Harrosh
2008-11-28 1:52 ` FUJITA Tomonori
2008-11-30 10:56 ` Boaz Harrosh
2008-11-28 2:01 ` James Bottomley
2008-11-28 2:22 ` FUJITA Tomonori
2009-02-11 15:13 ` [RFC] FC pass thru - Rev V James Smart
2009-02-11 15:43 ` Seokmann Ju
2009-02-20 2:33 ` Seokmann Ju
2009-02-20 18:53 ` James Smart
2009-02-21 6:00 ` FUJITA Tomonori
2009-02-24 14:25 ` Seokmann Ju
2009-03-13 16:25 ` Seokmann Ju
2009-03-13 16:47 ` Sven Schuetz
2009-03-13 17:04 ` Seokmann Ju
2009-03-15 9:34 ` Boaz Harrosh
2009-03-15 13:14 ` James Smart
2009-03-15 14:03 ` Boaz Harrosh
2009-03-15 15:15 ` James Smart
2009-03-15 16:15 ` Boaz Harrosh
2009-03-15 14:26 ` Boaz Harrosh
2009-03-19 1:57 ` FUJITA Tomonori
2009-03-14 22:16 ` James Smart
2009-03-16 11:36 ` Seokmann Ju
2009-03-25 12:58 ` Seokmann Ju
2009-03-15 9:30 ` Boaz Harrosh
2009-03-16 11:40 ` Seokmann Ju
2009-03-16 13:38 ` Boaz Harrosh
2009-03-16 15:37 ` Seokmann Ju
2009-02-11 16:15 ` Boaz Harrosh
2009-02-11 16:33 ` FUJITA Tomonori
2009-02-11 16:55 ` Boaz Harrosh
2009-02-11 17:14 ` FUJITA Tomonori
2009-02-11 18:16 ` Boaz Harrosh
2009-03-07 12:17 ` Seokmann Ju
2009-03-07 14:44 ` James Smart
2009-03-07 20:18 ` Seokmann Ju
2009-03-08 15:00 ` James Smart
2009-03-08 15:46 ` Boaz Harrosh
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=492B1685.4020709@emulex.com \
--to=james.smart@emulex.com \
--cc=andrew.vasquez@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=seokmann.ju@qlogic.com \
--cc=sven@linux.vnet.ibm.com \
/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