All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: James Smart <James.Smart@Emulex.Com>
Cc: "jeykholt@cisco.com" <jeykholt@cisco.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"jre@nuovasystems.com" <jre@nuovasystems.com>,
	"ajoglekar@nuovasystems.com" <ajoglekar@nuovasystems.com>
Subject: Re: [RFC][PATCH 2/6] fnic: add fnic_scsi.c and fnic_io.h.
Date: Mon, 25 Aug 2008 14:38:21 -0500	[thread overview]
Message-ID: <48B30A2D.6070501@cs.wisc.edu> (raw)
In-Reply-To: <48B30544.2020106@emulex.com>

James Smart wrote:
> 
> 
> Mike Christie wrote:
>> jeykholt@cisco.com wrote:
>>> + * fnic_queuecommand
>>> + * Routine to send a scsi cdb
>>> + * Called with host_lock held and interrupts disabled.
>>> + */
>>> +int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct 
>>> scsi_cmnd *))
>>> +{
>>> +     struct fc_lport *lp;
>>> +     struct fc_rport *rport;
>>> +     struct fnic_io_req *io_req;
>>> +     struct fnic *fnic;
>>> +     struct vnic_wq_copy *wq;
>>> +     int ret;
>>> +     u32 sg_count;
>>> +     unsigned long flags;
>>> +
>>> +     rport = starget_to_rport(scsi_target(sc->device));
>>> +     ret = fc_remote_port_chkready(rport);
>>> +     if (ret) {
>>> +             sc->result = ret;
>>> +             done(sc);
>>> +             return 0;
>>> +     }
>>> +
>>> +     lp = shost_priv(sc->device->host);
>>> +     if (lp->state != LPORT_ST_READY || !(lp->link_status & 
>>> FC_LINK_UP)) {
>>> +             sc->result = DID_NO_CONNECT << 16;
>>
>> You should use SCSI_MLQUEUE_HOST_BUSY here, becuase we set the link
>> status/state and then will block rports, if a io has passed the rport
>> check then sees the updated state we will fail it when it should be
>> requeued until the fc class decides what to do.
> 
> Are you sure ?  I would assume that if you passed the chkready() test, 

Yes. See fc_linkdown. It sets the status and state then blocks rports. 
Or actually it should be deleting/blocking rports but from that thread 
on fcoe-devel that you were on you know that that code is not completely 
right and is getting fixed.

> but still don't have connectivity to the device, you should be failing 
> it with a DID_NO_CONNECT.  The chkready(), paired with the 
> fc_remote_port_delete()/blocked luns, should cover the temporary losses 
> of connectivity.
> 

The check above I am commenting on is like lpfc's

         if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
                 cmnd->result = ScsiResult(DID_BUS_BUSY, 0);
                 goto out_fail_command;
         }

or qla2xxxx's

         if (atomic_read(&fcport->state) != FCS_ONLINE) {
                 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
                     atomic_read(&ha->loop_state) == LOOP_DEAD) {
                         cmd->result = DID_NO_CONNECT << 16;
                         goto qc_fail_command;
                 }
                 goto qc_host_busy;
         }

where we are in the middle of transistioning. The driver/lib has set 
some internal state, and is in the middle of calling the rport delete 
function.

  reply	other threads:[~2008-08-25 19:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-23  2:51 [RFC][PATCH 0/6] fnic: initial submission of driver for FCoE HBA jeykholt
2008-08-23  2:52 ` [RFC][PATCH 1/6] fnic: add main file with module infrastructure, etc jeykholt
2008-08-23  2:52 ` [RFC][PATCH 2/6] fnic: add fnic_scsi.c and fnic_io.h jeykholt
2008-08-25 18:22   ` Mike Christie
2008-08-25 19:15     ` James Smart
2008-08-25 19:31       ` Mike Christie
2008-08-25 19:39         ` James Smart
2008-08-25 21:01           ` Joe Eykholt
2008-08-25 21:51             ` Mike Christie
2008-08-25 21:55               ` Mike Christie
2008-08-28  1:31                 ` Abhijeet Joglekar
2008-08-25 18:41   ` Mike Christie
2008-08-25 19:17     ` James Smart
2008-08-25 19:38       ` Mike Christie [this message]
2008-08-23  2:52 ` [RFC][PATCH 3/6] fnic: Add fnic_fcs.c and fnic_attr.c jeykholt
2008-08-23  2:52 ` [RFC][PATCH 4/6] fnic: add resource, interrupt, and firmware interfaces jeykholt
2008-08-23  2:52 ` [RFC][PATCH 5/6] fnic: add queue interfaces jeykholt
2008-08-23  2:53 ` [RFC][PATCH 6/6] fnic: add Makefile, patch Kconfig, MAINTAINERS, pci_ids.h jeykholt

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=48B30A2D.6070501@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Smart@Emulex.Com \
    --cc=ajoglekar@nuovasystems.com \
    --cc=jeykholt@cisco.com \
    --cc=jre@nuovasystems.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.