diff mbox

[01/17] lpfc: FLOGI failures are reported when connected to a private loop.

Message ID 20171103225628.24716-2-jsmart2021@gmail.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

James Smart Nov. 3, 2017, 10:56 p.m. UTC
When the HBA is connected to a private loop, the driver
reports FLOGI loop-open failure as functional error. This is
an expected condition.

Mark loop-open failure as a warning instead of error.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_els.c | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

Comments

Hannes Reinecke Nov. 8, 2017, 9:05 a.m. UTC | #1
On 11/03/2017 11:56 PM, James Smart wrote:
> When the HBA is connected to a private loop, the driver
> reports FLOGI loop-open failure as functional error. This is
> an expected condition.
> 
> Mark loop-open failure as a warning instead of error.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <james.smart@broadcom.com>
> ---
>  drivers/scsi/lpfc/lpfc_els.c | 35 +++++++++++++++++++++--------------
>  1 file changed, 21 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
> index b14f7c5653cd..7df791047f55 100644
> --- a/drivers/scsi/lpfc/lpfc_els.c
> +++ b/drivers/scsi/lpfc/lpfc_els.c
> @@ -1030,29 +1030,36 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
>  
>  stop_rr_fcf_flogi:
>  		/* FLOGI failure */
> -		lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> -				"2858 FLOGI failure Status:x%x/x%x TMO:x%x "
> -				"Data x%x x%x\n",
> -				irsp->ulpStatus, irsp->un.ulpWord[4],
> -				irsp->ulpTimeout, phba->hba_flag,
> -				phba->fcf.fcf_flag);
> +		if (!(irsp->ulpStatus == IOSTAT_LOCAL_REJECT &&
> +		      ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
> +					IOERR_LOOP_OPEN_FAILURE)))
> +			lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> +					"2858 FLOGI failure Status:x%x/x%x "
> +					"TMO:x%x Data x%x x%x\n",
> +					irsp->ulpStatus, irsp->un.ulpWord[4],
> +					irsp->ulpTimeout, phba->hba_flag,
> +					phba->fcf.fcf_flag);
>  
>  		/* Check for retry */
>  		if (lpfc_els_retry(phba, cmdiocb, rspiocb))
>  			goto out;
>  
> -		/* FLOGI failure */
> -		lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> -				 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
> -				 irsp->ulpStatus, irsp->un.ulpWord[4],
> -				 irsp->ulpTimeout);
> -
> -
>  		/* If this is not a loop open failure, bail out */
>  		if (!(irsp->ulpStatus == IOSTAT_LOCAL_REJECT &&
>  		      ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
> -					IOERR_LOOP_OPEN_FAILURE)))
> +					IOERR_LOOP_OPEN_FAILURE))) {
> +			/* FLOGI failure */
> +			lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> +					 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
> +					 irsp->ulpStatus, irsp->un.ulpWord[4],
> +					 irsp->ulpTimeout);
>  			goto flogifail;
> +		}
> +
> +		lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS,
> +				 "0150 FLOGI failure Status:x%x/x%x TMO:x%x\n",
> +				 irsp->ulpStatus, irsp->un.ulpWord[4],
> +				 irsp->ulpTimeout);
>  
>  		/* FLOGI failed, so there is no fabric */
>  		spin_lock_irq(shost->host_lock);
> 
Isn't that a bit excessive?
Printing the same message _two_ times, and not providing additional info?
Please do only duplicate message if there is new information printed;
otherwise we might as well skip the second message.

Cheers,

Hannes
James Smart Nov. 8, 2017, 6:57 p.m. UTC | #2
On 11/8/2017 1:05 AM, Hannes Reinecke wrote:
> Isn't that a bit excessive?
> Printing the same message _two_ times, and not providing additional info?
> Please do only duplicate message if there is new information printed;
> otherwise we might as well skip the second message.
>
> Cheers,
>
> Hannes
yep. will rework and repost.

-- james
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index b14f7c5653cd..7df791047f55 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -1030,29 +1030,36 @@  lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 
 stop_rr_fcf_flogi:
 		/* FLOGI failure */
-		lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
-				"2858 FLOGI failure Status:x%x/x%x TMO:x%x "
-				"Data x%x x%x\n",
-				irsp->ulpStatus, irsp->un.ulpWord[4],
-				irsp->ulpTimeout, phba->hba_flag,
-				phba->fcf.fcf_flag);
+		if (!(irsp->ulpStatus == IOSTAT_LOCAL_REJECT &&
+		      ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
+					IOERR_LOOP_OPEN_FAILURE)))
+			lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+					"2858 FLOGI failure Status:x%x/x%x "
+					"TMO:x%x Data x%x x%x\n",
+					irsp->ulpStatus, irsp->un.ulpWord[4],
+					irsp->ulpTimeout, phba->hba_flag,
+					phba->fcf.fcf_flag);
 
 		/* Check for retry */
 		if (lpfc_els_retry(phba, cmdiocb, rspiocb))
 			goto out;
 
-		/* FLOGI failure */
-		lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
-				 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
-				 irsp->ulpStatus, irsp->un.ulpWord[4],
-				 irsp->ulpTimeout);
-
-
 		/* If this is not a loop open failure, bail out */
 		if (!(irsp->ulpStatus == IOSTAT_LOCAL_REJECT &&
 		      ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
-					IOERR_LOOP_OPEN_FAILURE)))
+					IOERR_LOOP_OPEN_FAILURE))) {
+			/* FLOGI failure */
+			lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+					 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
+					 irsp->ulpStatus, irsp->un.ulpWord[4],
+					 irsp->ulpTimeout);
 			goto flogifail;
+		}
+
+		lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS,
+				 "0150 FLOGI failure Status:x%x/x%x TMO:x%x\n",
+				 irsp->ulpStatus, irsp->un.ulpWord[4],
+				 irsp->ulpTimeout);
 
 		/* FLOGI failed, so there is no fabric */
 		spin_lock_irq(shost->host_lock);