1. 19 7月, 2021 7 次提交
  2. 10 6月, 2021 1 次提交
  3. 22 5月, 2021 5 次提交
  4. 13 4月, 2021 5 次提交
  5. 25 3月, 2021 1 次提交
  6. 05 3月, 2021 9 次提交
  7. 30 1月, 2021 1 次提交
  8. 08 1月, 2021 3 次提交
  9. 01 12月, 2020 1 次提交
  10. 20 11月, 2020 2 次提交
  11. 17 11月, 2020 5 次提交
    • J
      scsi: lpfc: Convert abort handling to SLI-3 and SLI-4 handlers · db7531d2
      James Smart 提交于
      This patch reworks the abort interfaces such that SLI-3 retains the
      iocb-based formatting and completions and SLI-4 now uses native WQEs and
      completion routines.
      
      The following changes are made:
      
       - The code is refactored from a confusing 2 routine sequence of
         xx_abort_iotag_issue(), which creates/formats and abort cmd, and
         xx_issue_abort_tag(), which then issues and handles the completion of
         the abort cmd - into a single interface of xx_issue_abort_iotag().  The
         new interface will determine whether SLI-3 or SLI-4 and then call the
         appropriate handler. A completion handler can now be specified to
         address the differences in completion handling.  Note: original code is
         all iocb based, with SLI-4 converting to SLI-3 for the SCSI/ELS path,
         and NVMe natively using wqes.
      
       - The SLI-3 side is refactored:
      
         The older iocb-base lpfc_sli_issue_abort_iotag() routine is combined
         with the logic of lpfc_sli_abort_iotag_issue() as well as the
         iocb-specific code in lpfc_abort_handler() and lpfc_sli_abort_iocb() to
         create the new single SLI-3 abort routine that formats and issues the
         iocb.
      
       - The SLI-4 side is refactored and added to:
      
         The native WQE abort code in NVMe is moved to the new SLI-4
         issue_abort_iotag() routine. Items in SCSI that set fields not set by
         NVMe is migrated into the new routine. Thus the routine supports NVMe
         and SCSI initiators. The nvmet block (target) formats the abort slightly
         different (like the old NVMe initiator) thus it has its own prep routine
         stolen from NVMe initiator and it retains the current code it has for
         issuing the WQE (does not use the commonized routine the initiators
         do). SLI-4 completion handlers were also added.
      
       - lpfc_abort_handler now becomes a wrapper that determines whether
         SLI-3 or SLI-4 and calls the proper abort handler.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-16-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      db7531d2
    • J
      scsi: lpfc: Fix NPIV Fabric Node reference counting · a70e63ee
      James Smart 提交于
      While testing initiator-side cable swaps with NPIV, oops occur.  The
      reference counts for the Fabric nodes on the NPIV vports isn't balanced,
      resulting in premature node removal.
      
      The following fixes were made:
      
       - Removed the FC_LBIT check in lpfc_linkup_port. This removed the special
         case for vports that didn't have them clean up just like the physical
         port.
      
       - Removed the unreg_rpi call in lpfc_cleanup_node. In this section, the
         node is being removed in the context of a reference count release and a
         mailbox command can't be issued at this point.
      
       - Remove special case handling in the default mailbox completion handler
         that allowed the skipping of a node reference. Now, reference counting
         always requires the removal of the reference.
      
       - Move the location of the DEVICE_RM event is done during LOGO handling as
         the driver has additional work to do on the ndlp before puts/releases
         can be performed.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-10-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      a70e63ee
    • J
      scsi: lpfc: Fix NPIV discovery and Fabric Node detection · b3f2e67c
      James Smart 提交于
      While testing NPIV and link bounces, the vport would not show a fabric node
      for the F_Port, would not transition into NPR state during a link fault, or
      leave the FDMI node untouched during error injection. Cause for this was
      determined to be an inconsistent manner in which F_Port, Nameserver, and
      FDMI controller nodes were created and linked. In some cases, the nodes
      would never be unregistered from the transport, leaving references
      active. In other cases, the fabric nodes may register with the transport
      multiple times while still registered.
      
      The following changes were made:
      
       - Fix the FDISC issue routine, which starts vport (re)creation, to mark
         the F_Port as a fabric node (NLP_FABRIC) and allow the F_Port node to
         fully be created and show up in the node list.
      
       - When remote ports are cleaned up on vport termination, cleanup the
         nameserver and FDMI controller nodes on the vport so they unregister
         from the transport.
      
       - On link bounces, don't exclude the NPIV Fabric remote ports from
         transitioning to the NPR state, allowing them to avoid re-registration
         if already registered.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-9-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      b3f2e67c
    • J
      scsi: lpfc: Unsolicited ELS leaves node in incorrect state while dropping it · 9d76d467
      James Smart 提交于
      When a target swap happens, under certain conditions the node sends a
      LOGO. The unsolicited ELS logic responds with a reject. The logic may
      allocate a new node to handle this. Afterward, the new nodes are dropped
      incorrectly leaving them in a mis-matched state and refcounting causes a
      use-after-free situation leading to a crash.
      
      It is also possible that the unsolicited els handling finds a node which is
      in an UNUSED state. The handling moves these nodes to NPR state with a
      refcount of 1. Although the end of the discovery logic assumes a final put
      will free such a node, there are codes paths which could increment the
      reference count, thus the node is in NPR state and not released.
      Eventually this mismatch in state and refcount leads to premature release
      of the node causing a crash.
      
      Fix by always using the discovery engine DEVICE RM event to decrement and
      release the nodes (rather than explicit code that tried to do it before).
      This will take care of moving the node to the UNUSED state and then removes
      the final ref count. If there is a trigger to reuse this node, the
      transition from the UNUSED state clearly indicates that the initial
      reference is then incremented and use can continue.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-8-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      9d76d467
    • J
      scsi: lpfc: Remove ndlp when a PLOGI/ADISC/PRLI/REG_RPI ultimately fails · 52edb2ca
      James Smart 提交于
      When a PLOGI/ADISC/PRLI/REG_RPI fails, the node remains in the nodelist in
      that state.  Although the driver now frees a node when the ref count goes
      to zero, in this case the ref cnt doesn't reach zero because there isn't a
      mechanism to release the final reference.  Discovery just stops.
      
      Fix by calling the node discovery state machine DEVICE_RM event whenever
      one of these commands fail. This will remove the final reference count and
      trigger node release.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-7-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      52edb2ca