All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: James Smart <jsmart2021@gmail.com>
Cc: linux-scsi@vger.kernel.org,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	James Smart <james.smart@broadcom.com>
Subject: Re: [PATCH v2 01/20] lpfc: Fix plogi collision that causes illegal state transition
Date: Mon, 7 Aug 2017 09:49:20 +0200	[thread overview]
Message-ID: <20170807074920.GE3978@linux-x5ow.site> (raw)
In-Reply-To: <20170805004731.1335-2-jsmart2021@gmail.com>

On Fri, Aug 04, 2017 at 05:47:12PM -0700, James Smart wrote:
> From: Dick Kennedy <dick.kennedy@broadcom.com>
> 
> Message "0271 Illegal State Transition: node" seen in logs, all
> luns are unuseable for that target.
> 
> A window exists in the rcv_plogi path where if the state is plogi
> issue but the driver has not issued a plogi, then two reglogins will
> be sent for the same RPI. The first one to complete will advance
> the state to prli issue the second one will be detected as an
> illegal state, and leave the node in an unusable state.
> 
> Correct the completion routine for the PLOGI ACC that detects the
> state change when the driver starts discovery on the node again
> and drop the REGLOGIN mailbox command.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <james.smart@broadcom.com>
> ---
>  drivers/scsi/lpfc/lpfc_els.c | 26 +++++++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
> index 6d1d6f691df4..9e9aa8bb7001 100644
> --- a/drivers/scsi/lpfc/lpfc_els.c
> +++ b/drivers/scsi/lpfc/lpfc_els.c
> @@ -3930,7 +3930,31 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
>  	if (mbox) {
>  		if ((rspiocb->iocb.ulpStatus == 0)
>  		    && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) {
> -			lpfc_unreg_rpi(vport, ndlp);
> +			if (!lpfc_unreg_rpi(vport, ndlp)) {
> +				if (ndlp->nlp_state ==  NLP_STE_PLOGI_ISSUE ||
> +				    ndlp->nlp_state ==
> +				     NLP_STE_REG_LOGIN_ISSUE) {


			if (!lpfc_unreg_rpi(vport, ndlp) &&
			    (ndlp->nlp_state == NLP_STE_PLOGI_ISSUE ||
			     ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE)) {

This saves you one level of indention and given that we already have two
before we reach the 'if' it's highly desirable.

> +					lpfc_printf_vlog(vport, KERN_INFO,
> +							 LOG_DISCOVERY,
> +							 "0314 PLOGI recov "
> +							 "DID x%x "
> +							 "Data: x%x x%x x%x\n",
> +							 ndlp->nlp_DID,
> +							 ndlp->nlp_state,
> +							 ndlp->nlp_rpi,
> +							 ndlp->nlp_flag);
> +					mp = (struct lpfc_dmabuf *)
> +					      mbox->context1;

No need for a cast.

Otherwise,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2017-08-07  7:49 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-05  0:47 [PATCH v2 00/20] lpfc updates for 11.4.0.3 James Smart
2017-08-05  0:47 ` [PATCH v2 01/20] lpfc: Fix plogi collision that causes illegal state transition James Smart
2017-08-07  7:49   ` Johannes Thumshirn [this message]
2017-08-05  0:47 ` [PATCH v2 02/20] lpfc: Fix loop mode target discovery James Smart
2017-08-07  7:55   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 03/20] lpfc: Fix rediscovery on switch blade pull James Smart
2017-08-07  7:56   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 04/20] lpfc: Fix oops when NVME Target is discovered in a nonNVME environment James Smart
2017-08-07  8:00   ` Johannes Thumshirn
2017-08-07 20:34     ` James Smart
2017-08-05  0:47 ` [PATCH v2 05/20] lpfc: convert info messages to standard messages James Smart
2017-08-07  8:00   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 06/20] lpfc: Correct return error codes to align with nvme_fc transport James Smart
2017-08-07  8:07   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 07/20] lpfc: Fix handling of FCP and NVME FC4 types in Pt2Pt topology James Smart
2017-08-07  8:18   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 08/20] lpfc: Fix duplicate NVME rport entries and namespaces James Smart
2017-08-07  8:33   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 09/20] lpfc: Fix crash in lpfc nvmet when fc port is reset James Smart
2017-08-07  8:34   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 10/20] lpfc: Fix NVME PRLI handling during RSCN James Smart
2017-08-07  8:35   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 11/20] lpfc: Correct issues with FAWWN and FDISCs James Smart
2017-08-05  0:47 ` [PATCH v2 12/20] lpfc: Limit amount of work processed in IRQ James Smart
2017-08-07  8:43   ` Johannes Thumshirn
2017-08-07 20:50     ` James Smart
2017-08-05  0:47 ` [PATCH v2 13/20] lpfc: Fix MRQ > 1 context list handling James Smart
2017-08-07  9:02   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 14/20] lpfc: Fix relative offset error on large nvmet target ios James Smart
2017-08-07  9:02   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 15/20] lpfc: Fix nvme target failure after 2nd adapter reset James Smart
2017-08-07  9:05   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 16/20] lpfc: Fix bad sgl reposting " James Smart
2017-08-07  9:06   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 17/20] lpfc: remove console log clutter James Smart
2017-08-07  9:06   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 18/20] lpfc: Add Buffer to Buffer credit recovery support James Smart
2017-08-07  9:08   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 19/20] scsi: lpfc: fix "integer constant too large" error on 32bit archs James Smart
2017-08-07  9:09   ` Johannes Thumshirn
2017-08-05  0:47 ` [PATCH v2 20/20] lpfc: lpfc version bump 11.4.0.3 James Smart
2017-08-07  9:08   ` Johannes Thumshirn

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=20170807074920.GE3978@linux-x5ow.site \
    --to=jthumshirn@suse.de \
    --cc=dick.kennedy@broadcom.com \
    --cc=james.smart@broadcom.com \
    --cc=jsmart2021@gmail.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.