public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <James.Smart@Emulex.Com>
To: Christof Schmitt <christof.schmitt@de.ibm.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: fc_remote_port_delete and returning SCSI commands from LLD
Date: Fri, 23 Oct 2009 10:47:47 -0400	[thread overview]
Message-ID: <4AE1C213.9090607@emulex.com> (raw)
In-Reply-To: <20091023074746.GB5930@schmichrtp.de.ibm.com>



Christof Schmitt wrote:
> On Wed, Oct 21, 2009 at 12:24:31PM -0400, James Smart wrote:
>> But - this process is a coordinated effort between the driver and the 
>> upper layers, and where the driver doesn't get helped by the transport 
>> (the blocked state) it had better mimic the return codes at the different 
>> points, and perhaps more, so that bad things don't happen.
> 
> "mimic the return codes" refers to fc_remote_port_chkready? Like
> returning DID_IMM_RETRY when the rport is going to be BLOCKED, but
> fc_remote_port_delete did not run yet?

Yes

Although, now that I look at chkready again, I'm surprised it didn't have one 
of Mike's TRANSPORT_DISRUPTED status's being returned.

> And, at least in zfcp, the notification from the hardware about I/O
> completion to the call to scsi_done runs in softirq context. Calling
> fc_remote_port_delete from this context is no good thing as you
> mentioned and i don't see a good way to synchronize the
> fc_remote_port_add/delete calls when going this way.

Should be ways to do it, as it's "just code in the LLDD". But I'm sure, the 
implementation is never that simple.

> 
> So far i see two possible solutions:
> 
> 1) When the error is detected in softirq context, do not call
>    scsi_done. Defer this call to the error handling thread/workqueue
>    that will first call fc_remote_port_delete and then return all
>    affected SCSI commands.
> 
> 2) Have an LLD internal flag indicating "transitioning to rport
>    blocked state", check for this in queuecommand and return
>    DID_IMM_RETRY as fc_remote_port_chkready does. As soon as
>    fc_remote_port_delete has been called, fc_remote_port_chkready will
>    do the right thing.
> 
> It looks to me that 2) might be a short-term solution while 1) looks
> like a proper way of handling interruptions on the host level in the
> long term.

True - depends on how successful (2) alone is. Both should be done, but if (2) 
at least exists, it significantly helps.

> 
> Anyway, thanks for the input.
> 
> I am tempted to summarize this for scsi_fc_transport.txt to have the
> important requirements in one place. But this depends on the available
> time, so no promises.

If you do - great!  It's been needed for a long time.

-- james s

  reply	other threads:[~2009-10-23 14:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 14:40 fc_remote_port_delete and returning SCSI commands from LLD Christof Schmitt
2009-10-21 15:24 ` Christof Schmitt
2009-10-21 16:33   ` James Smart
2009-10-23  7:58     ` Christof Schmitt
2009-10-23 14:50       ` James Smart
2009-10-27 16:59         ` Christof Schmitt
2009-10-27 19:44           ` James Smart
2009-10-21 16:24 ` James Smart
2009-10-23  7:47   ` Christof Schmitt
2009-10-23 14:47     ` James Smart [this message]
2009-10-27 21:57       ` Mike Christie
2009-10-21 18:11 ` Mike Christie
2009-10-23  7:13   ` Christof Schmitt
2009-10-27 21:53     ` Mike Christie
2009-10-28 14:27       ` Christof Schmitt

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=4AE1C213.9090607@emulex.com \
    --to=james.smart@emulex.com \
    --cc=christof.schmitt@de.ibm.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