• James Smart's avatar
    scsi: lpfc: Rework locations of ndlp reference taking · 4430f7fd
    James Smart authored
    Now that the driver has gone to a normal ref interface (with no odd logic)
    the discovery logic needs to be updated to reworked so that it properly
    takes references when it should and give them up when it should.
    
    Rework the driver for the following get/put model:
    
     - Move gets to just before an I/O is issued. Add gets for places where an
       I/O was issued without one.
    
     - Ensure that failures from lpfc_nlp_get() are handled by the driver.
    
     - Check and fix the placement of lpfc_nlp_puts relative to io completions.
       Note: some of these paths may not release the reference on the exact io
       completion as the reference is held as the code takes another step in
       the discovery thread and which may cause another io to be issued.
    
     - Rearrange some code for error processing and calling lpfc_nlp_put.
    
     - Fix some places of incorrect reference freeing that was causing the
       premature releasing of the structure.
    
     - Nvmet plogi handling performs unreg_rpi's. The reference counts were
       unbalanced resulting in premature node removal. In some cases this
       caused loss of node discovery. Corrected the reftaking around nvmet
       plogis.
    
    Nodes that experience devloss now get released from the node list now that
    there is a proper reference taking.
    
    Link: https://lore.kernel.org/r/20201115192646.12977-3-james.smart@broadcom.comCo-developed-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    4430f7fd
lpfc_ct.c 105 KB