linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ewan D. Milne" <emilne@redhat.com>
To: Satish Kharat <satishkh@cisco.com>
Cc: linux-scsi@vger.kernel.org, Sesidhar Baddela <sebaddel@cisco.com>
Subject: Re: [PATCH v1 3/3] Using rport->dd_data to check rport online instead of rport_lookup.
Date: Tue, 29 Mar 2016 10:06:46 -0400	[thread overview]
Message-ID: <1459260406.30035.3.camel@localhost.localdomain> (raw)
In-Reply-To: <1458325370-25615-3-git-send-email-satishkh@cisco.com>

On Fri, 2016-03-18 at 11:22 -0700, Satish Kharat wrote:
> When issuing I/O we check if rport is online through libfc
> rport_lookup() function which needs to be protected by mutex lock
> that cannot acquired in I/O context. The change is to use midlayer
> remote port’s dd_data which is preserved until its devloss timeout
> and no protection is required.
> The the scsi_cmnd error code is expected to be in the left 16 bits
> of the result field. Changed to correct this.
> Fnic driver version changed from 1.6.0.20 to 1.6.0.21
> 
> Signed-off-by: Satish Kharat <satishkh@cisco.com>
> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com>
> ---
>  * v1
>  - DID_NO_CONNECT left shifted 16 bits before assigning to sc->result
> ---
>  drivers/scsi/fnic/fnic.h      |  2 +-
>  drivers/scsi/fnic/fnic_scsi.c | 20 +++++++++++---------
>  2 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
> index 1023eae..9ddc920 100644
> --- a/drivers/scsi/fnic/fnic.h
> +++ b/drivers/scsi/fnic/fnic.h
> @@ -39,7 +39,7 @@
>  
>  #define DRV_NAME		"fnic"
>  #define DRV_DESCRIPTION		"Cisco FCoE HBA Driver"
> -#define DRV_VERSION		"1.6.0.20"
> +#define DRV_VERSION		"1.6.0.21"
>  #define PFX			DRV_NAME ": "
>  #define DFX                     DRV_NAME "%d: "
>  
> diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> index 026b93d..0e874a5 100644
> --- a/drivers/scsi/fnic/fnic_scsi.c
> +++ b/drivers/scsi/fnic/fnic_scsi.c
> @@ -439,7 +439,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_
>  	int sg_count = 0;
>  	unsigned long flags = 0;
>  	unsigned long ptr;
> -	struct fc_rport_priv *rdata;
>  	spinlock_t *io_lock = NULL;
>  	int io_lock_acquired = 0;
>  
> @@ -455,14 +454,17 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_
>  		return 0;
>  	}
>  
> -	rdata = lp->tt.rport_lookup(lp, rport->port_id);
> -	if (!rdata || (rdata->rp_state == RPORT_ST_DELETE)) {
> -		FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
> -			"returning IO as rport is removed\n");
> -		atomic64_inc(&fnic_stats->misc_stats.rport_not_ready);
> -		sc->result = DID_NO_CONNECT;
> -		done(sc);
> -		return 0;
> +	if (rport) {
> +		struct fc_rport_libfc_priv *rp = rport->dd_data;
> +
> +		if (!rp || rp->rp_state != RPORT_ST_READY) {
> +			FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
> +				"returning DID_NO_CONNECT for IO as rport is removed\n");
> +			atomic64_inc(&fnic_stats->misc_stats.rport_not_ready);
> +			sc->result = DID_NO_CONNECT<<16;
> +			done(sc);
> +			return 0;
> +		}
>  	}
>  
>  	if (lp->state != LPORT_ST_READY || !(lp->link_up))

For v1:

Reviewed-by: Ewan D. Milne <emilne@redhat.com>



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-29 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 18:22 [PATCH v1 1/3] Fix to cleanup aborted IO to avoid device being offlined by mid-layer Satish Kharat
2016-03-18 18:22 ` [PATCH v1 2/3] Cleanup the I/O pending with fw and has timed out and is used to issue LUN reset Satish Kharat
2016-03-29 14:06   ` Ewan D. Milne
2016-03-18 18:22 ` [PATCH v1 3/3] Using rport->dd_data to check rport online instead of rport_lookup Satish Kharat
2016-03-29 14:06   ` Ewan D. Milne [this message]
2016-03-29 14:06 ` [PATCH v1 1/3] Fix to cleanup aborted IO to avoid device being offlined by mid-layer Ewan D. Milne
2016-03-30  0:46 ` Martin K. Petersen

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=1459260406.30035.3.camel@localhost.localdomain \
    --to=emilne@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.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).