1. 25 8月, 2021 4 次提交
  2. 19 7月, 2021 1 次提交
  3. 10 6月, 2021 1 次提交
  4. 22 5月, 2021 2 次提交
  5. 05 3月, 2021 2 次提交
  6. 08 1月, 2021 2 次提交
  7. 17 11月, 2020 3 次提交
  8. 27 10月, 2020 2 次提交
    • J
      scsi: lpfc: Add FDMI Vendor MIB support · 8aaa7bcf
      James Smart 提交于
      Created new attribute lpfc_enable_mi, which by default is enabled.
      
      Add command definition bits for SLI-4 parameters that recognize whether the
      adapter has MIB information support and what revision of MIB data.  Using
      the adapter information, register vendor-specific MIB support with FDMI.
      The registration will be done every link up.
      
      During FDMI registration, encountered a couple of errors when reverting to
      FDMI rev1. Code needed to exist once reverting. Fixed these.
      
      Link: https://lore.kernel.org/r/20201020202719.54726-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>
      8aaa7bcf
    • J
      scsi: lpfc: Fix scheduling call while in softirq context in lpfc_unreg_rpi · e7dab164
      James Smart 提交于
      The following call trace was seen during HBA reset testing:
      
      BUG: scheduling while atomic: swapper/2/0/0x10000100
      ...
      Call Trace:
      dump_stack+0x19/0x1b
      __schedule_bug+0x64/0x72
      __schedule+0x782/0x840
      __cond_resched+0x26/0x30
      _cond_resched+0x3a/0x50
      mempool_alloc+0xa0/0x170
      lpfc_unreg_rpi+0x151/0x630 [lpfc]
      lpfc_sli_abts_recover_port+0x171/0x190 [lpfc]
      lpfc_sli4_abts_err_handler+0xb2/0x1f0 [lpfc]
      lpfc_sli4_io_xri_aborted+0x256/0x300 [lpfc]
      lpfc_sli4_sp_handle_abort_xri_wcqe.isra.51+0xa3/0x190 [lpfc]
      lpfc_sli4_fp_handle_cqe+0x89/0x4d0 [lpfc]
      __lpfc_sli4_process_cq+0xdb/0x2e0 [lpfc]
      __lpfc_sli4_hba_process_cq+0x41/0x100 [lpfc]
      lpfc_cq_poll_hdler+0x1a/0x30 [lpfc]
      irq_poll_softirq+0xc7/0x100
      __do_softirq+0xf5/0x280
      call_softirq+0x1c/0x30
      do_softirq+0x65/0xa0
      irq_exit+0x105/0x110
      do_IRQ+0x56/0xf0
      common_interrupt+0x16a/0x16a
      
      With the conversion to blk_io_poll for better interrupt latency in normal
      cases, it introduced this code path, executed when I/O aborts or logouts
      are seen, which attempts to allocate memory for a mailbox command to be
      issued.  The allocation is GFP_KERNEL, thus it could attempt to sleep.
      
      Fix by creating a work element that performs the event handling for the
      remote port. This will have the mailbox commands and other items performed
      in the work element, not the irq. A much better method as the "irq" routine
      does not stall while performing all this deep handling code.
      
      Ensure that allocation failures are handled and send LOGO on failure.
      
      Additionally, enlarge the mailbox memory pool to reduce the possibility of
      additional allocation in this path.
      
      Link: https://lore.kernel.org/r/20201020202719.54726-3-james.smart@broadcom.com
      Fixes: 317aeb83 ("scsi: lpfc: Add blk_io_poll support for latency improvment")
      Cc: <stable@vger.kernel.org> # v5.9+
      Co-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>
      e7dab164
  9. 03 7月, 2020 2 次提交
    • D
      scsi: lpfc: Add an internal trace log buffer · 372c187b
      Dick Kennedy 提交于
      The current logging methods typically end up requesting a reproduction with
      a different logging level set to figure out what happened. This was mainly
      by design to not clutter the kernel log messages with things that were
      typically not interesting and the messages themselves could cause other
      issues.
      
      When looking to make a better system, it was seen that in many cases when
      more data was wanted was when another message, usually at KERN_ERR level,
      was logged.  And in most cases, what the additional logging that was then
      enabled was typically. Most of these areas fell into the discovery machine.
      
      Based on this summary, the following design has been put in place: The
      driver will maintain an internal log (256 elements of 256 bytes).  The
      "additional logging" messages that are usually enabled in a reproduction
      will be changed to now log all the time to the internal log.  A new logging
      level is defined - LOG_TRACE_EVENT.  When this level is set (it is not by
      default) and a message marked as KERN_ERR is logged, all the messages in
      the internal log will be dumped to the kernel log before the KERN_ERR
      message is logged.
      
      There is a timestamp on each message added to the internal log. However,
      this timestamp is not converted to wall time when logged. The value of the
      timestamp is solely to give a crude time reference for the messages.
      
      Link: https://lore.kernel.org/r/20200630215001.70793-14-jsmart2021@gmail.comSigned-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      372c187b
    • D
      scsi: lpfc: Add blk_io_poll support for latency improvment · 317aeb83
      Dick Kennedy 提交于
      Although the existing implementation is very good at high I/O load, on
      tests involving light load, especially on only a few hardware queues,
      latency was a little higher than it can be due to using workqueue
      scheduling. Other tasks in the system can delay handling.
      
      Change the lower level to use irq_poll by default which uses a softirq for
      I/O completion. This gives better latency as variance in when the cq is
      processed is reduced over the workqueue interface. However, as high load is
      better served by not being in softirq when the CPU is loaded, work queues
      are still used under high I/O load.
      
      Link: https://lore.kernel.org/r/20200630215001.70793-13-jsmart2021@gmail.comSigned-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      317aeb83
  10. 10 5月, 2020 1 次提交
  11. 08 5月, 2020 1 次提交
  12. 30 3月, 2020 3 次提交
  13. 27 3月, 2020 1 次提交
  14. 18 2月, 2020 1 次提交
    • J
      scsi: lpfc: add RDF registration and Link Integrity FPIN logging · df3fe766
      James Smart 提交于
      This patch modifies lpfc to register for Link Integrity events via the use
      of an RDF ELS and to perform Link Integrity FPIN logging.
      
      Specifically, the driver was modified to:
      
       - Format and issue the RDF ELS immediately following SCR registration.
         This registers the ability of the driver to receive FPIN ELS.
      
       - Adds decoding of the FPIN els into the received descriptors, with
         logging of the Link Integrity event information. After decoding, the ELS
         is delivered to the scsi fc transport to be delivered to any user-space
         applications.
      
       - To aid in logging, simple helpers were added to create enum to name
         string lookup functions that utilize the initialization helpers from the
         fc_els.h header.
      
       - Note: base header definitions for the ELS's don't populate the
         descriptor payloads. As such, lpfc creates it's own version of the
         structures, using the base definitions (mostly headers) and additionally
         declaring the descriptors that will complete the population of the ELS.
      
      Link: https://lore.kernel.org/r/20200210173155.547-3-jsmart2021@gmail.comSigned-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      df3fe766
  15. 11 2月, 2020 3 次提交
  16. 22 12月, 2019 1 次提交
  17. 06 11月, 2019 2 次提交
    • J
      scsi: lpfc: Change default IRQ model on AMD architectures · dcaa2136
      James Smart 提交于
      The current driver attempts to allocate an interrupt vector per cpu using
      the systems managed IRQ allocator (flag PCI_IRQ_AFFINITY). The system IRQ
      allocator will either provide the per-cpu vector, or return fewer
      vectors. When fewer vectors, they are evenly spread between the numa nodes
      on the system.  When run on an AMD architecture, if interrupts occur to a
      cpu that is not in the same numa node as the adapter generating the
      interrupt, there are extreme costs and overheads in performance.  Thus, if
      1:1 vector allocation is used, or the "balanced" vectors in the other numa
      nodes, performance can be hit significantly.
      
      A much more performant model is to allocate interrupts only on the cpus
      that are in the numa node where the adapter resides.  I/O completion is
      still performed by the cpu where the I/O was generated. Unfortunately,
      there is no flag to request the managed IRQ subsystem allocate vectors only
      for the CPUs in the numa node as the adapter.
      
      On AMD architecture, revert the irq allocation to the normal style
      (non-managed) and then use irq_set_affinity_hint() to set the cpu
      affinity and disable user-space rebalancing.
      
      Tie the support into CPU offline/online. If the cpu being offlined owns a
      vector, the vector is re-affinitized to one of the other CPUs on the same
      numa node. If there are no more CPUs on the numa node, the vector has all
      affinity removed and lets the system determine where it's serviced.
      Similarly, when the cpu that owned a vector comes online, the vector is
      reaffinitized to the cpu.
      
      Link: https://lore.kernel.org/r/20191105005708.7399-10-jsmart2021@gmail.comSigned-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      dcaa2136
    • J
      scsi: lpfc: Add registration for CPU Offline/Online events · 93a4d6f4
      James Smart 提交于
      The recent affinitization didn't address cpu offlining/onlining.  If an
      interrupt vector is shared and the low order cpu owning the vector is
      offlined, as interrupts are managed, the vector is taken offline. This
      causes the other CPUs sharing the vector will hang as they can't get io
      completions.
      
      Correct by registering callbacks with the system for Offline/Online
      events. When a cpu is taken offline, its eq, which is tied to an interrupt
      vector is found. If the cpu is the "owner" of the vector and if the
      eq/vector is shared by other CPUs, the eq is placed into a polled mode.
      Additionally, code paths that perform io submission on the "sharing CPUs"
      will check the eq state and poll for completion after submission of new io
      to a wq that uses the eq.
      
      Similarly, when a cpu comes back online and owns an offlined vector, the eq
      is taken out of polled mode and rearmed to start driving interrupts for eq.
      
      Link: https://lore.kernel.org/r/20191105005708.7399-9-jsmart2021@gmail.comSigned-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      93a4d6f4
  18. 25 10月, 2019 3 次提交
  19. 01 10月, 2019 1 次提交
  20. 30 8月, 2019 1 次提交
  21. 20 8月, 2019 3 次提交
    • J
      scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair · c00f62e6
      James Smart 提交于
      Currently, each hardware queue, typically allocated per-cpu, consists of a
      WQ/CQ pair per protocol. Meaning if both SCSI and NVMe are supported 2
      WQ/CQ pairs will exist for the hardware queue. Separate queues are
      unnecessary. The current implementation wastes memory backing the 2nd set
      of queues, and the use of double the SLI-4 WQ/CQ's means less hardware
      queues can be supported which means there may not always be enough to have
      a pair per cpu. If there is only 1 pair per cpu, more cpu's may get their
      own WQ/CQ.
      
      Rework the implementation to use a single WQ/CQ pair by both protocols.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c00f62e6
    • J
      scsi: lpfc: Add NVMe sequence level error recovery support · 0d8af096
      James Smart 提交于
      FC-NVMe-2 added support for sequence level error recovery in the FC-NVME
      protocol. This allows for the detection of errors and lost frames and
      immediate retransmission of data to avoid exchange termination, which
      escalates into NVMeoFC connection and association failures. A significant
      RAS improvement.
      
      The driver is modified to indicate support for SLER in the NVMe PRLI is
      issues and to check for support in the PRLI response.  When both sides
      support it, the driver will set a bit in the WQE to enable the recovery
      behavior on the exchange. The adapter will take care of all detection and
      retransmission.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0d8af096
    • J
      scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware. · d79c9e9d
      James Smart 提交于
      Typical SLI-4 hardware supports up to 2 4KB pages to be registered per XRI
      to contain the exchanges Scatter/Gather List. This caps the number of SGL
      elements that can be in the SGL. There are not extensions to extend the
      list out of the 2 pages.
      
      The G7 hardware adds a SGE type that allows the SGL to be vectored to a
      different scatter/gather list segment. And that segment can contain a SGE
      to go to another segment and so on.  The initial segment must still be
      pre-registered for the XRI, but it can be a much smaller amount (256Bytes)
      as it can now be dynamically grown.  This much smaller allocation can
      handle the SG list for most normal I/O, and the dynamic aspect allows it to
      support many MB's if needed.
      
      The implementation creates a pool which contains "segments" and which is
      initially sized to hold the initial small segment per xri. If an I/O
      requires additional segments, they are allocated from the pool.  If the
      pool has no more segments, the pool is grown based on what is now
      needed. After the I/O completes, the additional segments are returned to
      the pool for use by other I/Os. Once allocated, the additional segments are
      not released under the assumption of "if needed once, it will be needed
      again". Pools are kept on a per-hardware queue basis, which is typically
      1:1 per cpu, but may be shared by multiple cpus.
      
      The switch to the smaller initial allocation significantly reduces the
      memory footprint of the driver (which only grows if large ios are
      issued). Based on the several K of XRIs for the adapter, the 8KB->256B
      reduction can conserve 32MBs or more.
      
      It has been observed with per-cpu resource pools that allocating a resource
      on CPU A, may be put back on CPU B. While the get routines are distributed
      evenly, only a limited subset of CPUs may be handling the put routines.
      This can put a strain on the lpfc_put_cmd_rsp_buf_per_cpu routine because
      all the resources are being put on a limited subset of CPUs.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d79c9e9d