linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Anand <ravi.anand@qlogic.com>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <james.bottomley@suse.de>,
	Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Vikas Chaudhary <vikas.chaudhary@qlogic.com>,
	Nilesh Javali <nilesh.javali@qlogic.com>
Subject: Re: [PATCH 07/11] qla4xxx: Avoid relogin on device marked missing
Date: Thu, 11 Feb 2010 03:08:58 -0800	[thread overview]
Message-ID: <20100211110858.GC8237@linux-qf4p> (raw)
In-Reply-To: <4B672048.4090600@cs.wisc.edu>

On Mon, 01 Feb 2010, Mike Christie wrote:

> 
> On 01/30/2010 12:29 AM, Ravi Anand wrote:
> >
> > From: Vikas Chaudhary<vikas.chaudhary@qlogic.com>
> >
> > Signed-off-by: Nilesh Javali<nilesh.javali@qlogic.com>
> > Signed-off-by: Vikas Chaudhary<vikas.chaudhary@qlogic.com>
> > Signed-off-by: Ravi Anand<ravi.anand@qlogic.com>
> > ---
> >   drivers/scsi/qla4xxx/ql4_os.c |   27 ++++++++++++++++++++++++---
> >   1 files changed, 24 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> > index 9057860..e5c9b85 100644
> > --- a/drivers/scsi/qla4xxx/ql4_os.c
> > +++ b/drivers/scsi/qla4xxx/ql4_os.c
> > @@ -370,6 +370,7 @@ void qla4xxx_mark_device_missing(struct scsi_qla_host *ha,
> >   		      ddb_entry->fw_ddb_index));
> >   	iscsi_block_session(ddb_entry->sess);
> >   	iscsi_conn_error_event(ddb_entry->conn, ISCSI_ERR_CONN_FAILED);
> > +	set_bit(DF_NO_RELOGIN,&ddb_entry->flags);
> >   }
> >
> >   /***
> > @@ -642,6 +643,24 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
> >
> >   	/* Search for relogin's to time-out and port down retry. */
> >   	list_for_each_entry_safe(ddb_entry, dtemp,&ha->ddb_list, list) {
> > +		/* First check to see if the device has exhausted the
> > +		 * port down retry count */
> > +		if (atomic_read(&ddb_entry->state) == DDB_STATE_MISSING) {
> > +			if (atomic_read(&ddb_entry->port_down_timer) == 0)
> > +				continue;
> > +
> 
> 
> How does the relogin work in this case?

Actually it does not. We have fixed it and will resubmit an updated
patch along with other patches to address the review comments.

> 
> - If you pull a cable and we mark devices missing, then when link up is 
> detected will qla4xxx_isr_decode_mailbox set the AF_LINK_UP bit and then 
> the driver will start to try and relogin? Or would you get a 
> MBOX_ASTS_DATABASE_CHANGED aen, and then that notifies you that that the 
> firmware detected link up and logged back in (so the state would then be 
> DDB_DS_SESSION_ACTIVE?)?
> 
> 
> - What cases do you get a databased change aen where the new device 
> state indicates the session is non active so qla4xxx_process_ddb_changed 
> calls qla4xxx_mark_device_missing? Would it be where the target logs us 
> out, or when the firmware detects a problem with the session/connection 
> and drop the session, what about if the firmware detects a link down?
> 
> In the case qla4xxx_process_ddb_changed calls 
> qla4xxx_mark_device_missing will we get some sort of databased change 
> aen indicating that the state is again DDB_DS_SESSION_ACTIVE?
> 
> - What cases do we now use the relogin code now? Do we always call 
> qla4xxx_mark_device_missing in cases where a relogin is needed, so can 
> we just remove the relogin code? Or is the relogin code still used for 
> the initial driver initialization or something else?

F/W does the auto login only once during the init time once the link is up.
After that any time if there is any connection failure or I/O timeout resulting
in tear down of connection etc, its driver responsibility to relogin.

For cable pull scenario's if there are no I/O oustanding and KATO expires, in
that case driver will receive 8014 indicating that the target was logged out.
Again in that case its driver responsibility to log back in.

So doing a set_ddb() will result in re-establising the session and F/W will
report _SESSION_ACTIVE via 8014.

Thanks for the feedback. We will resubmit all patches as *V2* which
should address your concern.

THanks
Ravi

      reply	other threads:[~2010-02-11 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30  6:29 [PATCH 07/11] qla4xxx: Avoid relogin on device marked missing Ravi Anand
2010-02-01 18:41 ` Mike Christie
2010-02-11 11:08   ` Ravi Anand [this message]

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=20100211110858.GC8237@linux-qf4p \
    --to=ravi.anand@qlogic.com \
    --cc=james.bottomley@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=nilesh.javali@qlogic.com \
    --cc=vikas.chaudhary@qlogic.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;
as well as URLs for NNTP newsgroup(s).