• James Smart's avatar
    scsi: lpfc: Fix LOGO/PLOGI handling when triggerd by ABTS Timeout event · 1f52e001
    James Smart authored
    [ Upstream commit 30e196ca ]
    
    After a LOGO in response to an ABTS timeout, a PLOGI wasn't issued to
    re-establish the login.  An nlp_type check in the LOGO completion
    handler failed to restart discovery for NVME targets.  Revised the
    nlp_type check for NVME as well as SCSI.
    
    While reviewing the LOGO handling a few other issues were seen and
    were addressed:
    
    - Better lock synchronization around ndlp data types
    
    - When the ABTS times out, unregister the RPI before sending the LOGO
      so that all local exchange contexts are cleared and nothing received
      while awaiting LOGO/PLOGI handling will be accepted.
    
    - LOGO handling optimized to:
       Wait only R_A_TOV for a response.
       It doesn't need to be retried on timeout. If there wasn't a
         response, a PLOGI will be sent, thus an implicit logout
         applies as well when the other port sees it.
       If there is a response, any kind of response is considered "good"
         and the XRI quarantined for a exchange qualifier window.
    
    - PLOGI is issued as soon a LOGO state is resolved.
    Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    1f52e001
lpfc_els.c 298 KB