All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Reed <mdr@sgi.com>
To: michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, david.somayajulu@qlogic.com,
	andrew.vasquez@qlogic.com, James.Smart@Emulex.com,
	Eric.Moore@lsil.com
Subject: Re: [PATCH 6/9] fc class: add fc queueing helper
Date: Thu, 13 Mar 2008 09:35:27 -0500	[thread overview]
Message-ID: <47D93BAF.8030203@sgi.com> (raw)
In-Reply-To: <1204448602-5435-6-git-send-email-michaelc@cs.wisc.edu>



michaelc@cs.wisc.edu wrote:
> From: Mike Christie <michaelc@cs.wisc.edu>
> 
> Add a queueing helper which will return SCSI_MLQUEUE_TARGET_BUSY
> if we are transitioning because there is no need to call into
> the driver anymore at that point.
> 
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> ---
>  include/scsi/scsi_transport_fc.h |   33 +++++++++++++++++++++++++++++++++
>  1 files changed, 33 insertions(+), 0 deletions(-)
> 
> diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
> index 4769efd..62a6a74 100644
> --- a/include/scsi/scsi_transport_fc.h
> +++ b/include/scsi/scsi_transport_fc.h
> @@ -29,6 +29,7 @@
>  
>  #include <linux/sched.h>
>  #include <scsi/scsi.h>
> +#include <scsi/scsi_cmnd.h>
>  #include <scsi/scsi_netlink.h>
>  
>  struct scsi_transport_template;
> @@ -640,6 +641,38 @@ struct fc_function_template {
>  	unsigned long	disable_target_scan:1;
>  };
>  
> +/**
> + * fc_remote_port_queue_ready - called to validate the remote port state
> + * @rport: remote port to be checked
> + *
> + * Returns 0 if IO can be queued or if there the cmd should be

Remove "there" from the comment.

> + * completed by a call to cmd->scsi_done. Caller must check cmd->result.
> + * Returns SCSI_MLQUEUE value if IO cannot be queued temporarily.

How 'bout: "Returns a SCSI_MLQUEUE value if the IO cannot be queued due
to an rport state transition." ?

> + **/
> +static inline int
> +fc_remote_port_queue_ready(struct fc_rport *rport, struct scsi_cmnd *cmd)
> +{
> +	int result = 0;
> +
> +	cmd->result = 0;
> +	switch (rport->port_state) {
> +	case FC_PORTSTATE_ONLINE:
> +		if (rport->roles & FC_PORT_ROLE_FCP_TARGET)
> +			result = 0;
> +		else if (rport->flags & FC_RPORT_DEVLOSS_PENDING)
> +			result = SCSI_MLQUEUE_TARGET_BUSY;
> +		else
> +			cmd->result = DID_NO_CONNECT << 16;
> +		break;
> +	case FC_PORTSTATE_BLOCKED:
> +		result = SCSI_MLQUEUE_TARGET_BUSY;
> +		break;
> +	default:
> +		cmd->result = DID_NO_CONNECT << 16;
> +		break;
> +	}
> +	return result;
> +}
>  
>  /**
>   * fc_remote_port_chkready - called to validate the remote port state

  parent reply	other threads:[~2008-03-13 14:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02  9:03 [PATCH 1/9] scsi: Add helper code so transport classes/driver can control queueing michaelc
2008-03-02  9:03 ` [PATCH 2/9] iscsi: user per target can_queue and return SCSI_MLQUEUE_TARGET_BUSY michaelc
2008-03-02  9:03   ` [PATCH 3/9] iscsi class: add iscsi queueing helper michaelc
2008-03-02  9:03     ` [PATCH 4/9] qla4xxx: use SCSI_ML_TARGET_BUSY and iscsi helper michaelc
2008-03-02  9:03       ` [PATCH 5/9] libiscsi: use iscsi queueing helper michaelc
2008-03-02  9:03         ` [PATCH 6/9] fc class: add fc " michaelc
2008-03-02  9:03           ` [PATCH 7/9] qla2xxx: convert to use fc helper and SCSI_MLQUEUE_TARGET_BUSY michaelc
2008-03-02  9:03             ` [PATCH 8/9] lpfc: " michaelc
2008-03-02  9:03               ` [PATCH 9/9] mptfc: convert mptfc to use fc queueing helper michaelc
2008-03-13 18:53                 ` Michael Reed
2008-03-17 18:32                   ` Mike Christie
2008-03-17 18:39                     ` Mike Christie
2008-03-13 14:35           ` Michael Reed [this message]
2008-03-13 15:36             ` [PATCH 6/9] fc class: add " Mike Christie
2008-03-03 17:34       ` [PATCH 4/9] qla4xxx: use SCSI_ML_TARGET_BUSY and iscsi helper David C Somayajulu
2008-03-02  9:08 ` [PATCH 1/9] scsi: Add helper code so transport classes/driver can control queueing Mike Christie
2008-03-18  4:38 ` Mike Christie

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=47D93BAF.8030203@sgi.com \
    --to=mdr@sgi.com \
    --cc=Eric.Moore@lsil.com \
    --cc=James.Smart@Emulex.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=david.somayajulu@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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.