1. 06 2月, 2019 6 次提交
    • J
      scsi: lpfc: Allow override of hardware queue selection policies · 45aa312e
      James Smart 提交于
      Default behavior is to use the information from the upper IO stacks to
      select the hardware queue to use for IO submission.  Which typically has
      good cpu affinity.
      
      However, the driver, when used on some variants of the upstream kernel, has
      found queuing information to be suboptimal for FCP or IO completion locked
      on particular cpus.
      
      For command submission situations, the lpfc_fcp_io_sched module parameter
      can be set to specify a hardware queue selection policy that overrides the
      os stack information.
      
      For IO completion situations, rather than queing cq processing based on the
      cpu servicing the interrupting event, schedule the cq processing on the cpu
      associated with the hardware queue's cq.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      45aa312e
    • J
      scsi: lpfc: Adapt partitioned XRI lists to efficient sharing · c490850a
      James Smart 提交于
      The XRI get/put lists were partitioned per hardware queue. However, the
      adapter rarely had sufficient resources to give a large number of resources
      per queue. As such, it became common for a cpu to encounter a lack of XRI
      resource and request the upper io stack to retry after returning a BUSY
      condition. This occurred even though other cpus were idle and not using
      their resources.
      
      Create as efficient a scheme as possible to move resources to the cpus that
      need them. Each cpu maintains a small private pool which it allocates from
      for io. There is a watermark that the cpu attempts to keep in the private
      pool.  The private pool, when empty, pulls from a global pool from the
      cpu. When the cpu's global pool is empty it will pull from other cpu's
      global pool. As there many cpu global pools (1 per cpu or hardware queue
      count) and as each cpu selects what cpu to pull from at different rates and
      at different times, it creates a radomizing effect that minimizes the
      number of cpu's that will contend with each other when the steal XRI's from
      another cpu's global pool.
      
      On io completion, a cpu will push the XRI back on to its private pool.  A
      watermark level is maintained for the private pool such that when it is
      exceeded it will move XRI's to the CPU global pool so that other cpu's may
      allocate them.
      
      On NVME, as heartbeat commands are critical to get placed on the wire, a
      single expedite pool is maintained. When a heartbeat is to be sent, it will
      allocate an XRI from the expedite pool rather than the normal cpu
      private/global pools. On any io completion, if a reduction in the expedite
      pools is seen, it will be replenished before the XRI is placed on the cpu
      private pool.
      
      Statistics are added to aid understanding the XRI levels on each cpu and
      their behaviors.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c490850a
    • J
      scsi: lpfc: Move SCSI and NVME Stats to hardware queue structures · 4c47efc1
      James Smart 提交于
      Many io statistics were being sampled and saved using adapter-based data
      structures. This was creating a lot of contention and cache thrashing in
      the I/O path.
      
      Move the statistics to the hardware queue data structures.  Given the
      per-queue data structures, use of atomic types is lessened.
      
      Add new sysfs and debugfs stat routines to collate the per hardware queue
      values and report at an adapter level.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      4c47efc1
    • J
      scsi: lpfc: Partition XRI buffer list across Hardware Queues · 5e5b511d
      James Smart 提交于
      Once the IO buff allocations were made shared, there was a single XRI
      buffer list shared by all hardware queues.  A single list isn't great for
      performance when shared across the per-cpu hardware queues.
      
      Create a separate XRI IO buffer get/put list for each Hardware Queue.  As
      SGLs and associated IO buffers get allocated/posted to the firmware; round
      robin their assignment across all available hardware Queues so that there
      is an equitable assignment.
      
      Modify SCSI and NVME IO submit code paths to use the Hardware Queue logic
      for XRI allocation.
      
      Add a debugfs interface to display hardware queue statistics
      
      Added new empty_io_bufs counter to track if a cpu runs out of XRIs.
      
      Replace common_ variables/names with io_ to make meanings clearer.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      5e5b511d
    • J
      scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu · cdb42bec
      James Smart 提交于
      Currently, both nvme and fcp each have their own concept of an io_channel,
      which is a combination wq/cq and associated msix.  Different cpus would
      share an io_channel.
      
      The driver is now moving to per-cpu wq/cq pairs and msix vectors.  The
      driver will still use separate wq/cq pairs per protocol on each cpu, but
      the protocols will share the msix vector.
      
      Given the elimination of the nvme and fcp io channels, the module
      parameters will be removed.  A new parameter, lpfc_hdw_queue is added which
      allows the wq/cq pair allocation per cpu to be overridden and allocated to
      lesser value. If lpfc_hdw_queue is zero, the number of pairs allocated will
      be based on the number of cpus. If non-zero, the parameter specifies the
      number of queues to allocate. At this time, the maximum non-zero value is
      64.
      
      To manage this new paradigm, a new hardware queue structure is created to
      track queue activity and relationships.
      
      As MSIX vector allocation must be known before setting up the
      relationships, msix allocation now occurs before queue datastructures are
      allocated. If the number of vectors allocated is less than the desired
      hardware queues, the hardware queue counts will be reduced to the number of
      vectors
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      cdb42bec
    • J
      scsi: lpfc: Implement common IO buffers between NVME and SCSI · 0794d601
      James Smart 提交于
      Currently, both NVME and SCSI get their IO buffers from separate
      pools. XRI's are associated 1:1 with IO buffers, so XRI's are also split
      between protocols.
      
      Eliminate the independent pools and use a single pool. Each buffer
      structure now has a common section and a protocol section. Per protocol
      routines for SGL initialization are removed and replaced by common
      routines. Initialization of the buffers is only done on the common area.
      All other fields, which are protocol specific, are initialized when the
      buffer is allocated for use in the per-protocol allocation routine.
      
      In the past, the SCSI side allocated IO buffers as part of slave_alloc
      calls until the maximum XRIs for SCSI was reached. As all XRIs are now
      common and may be used for either protocol, allocation for everything is
      done as part of adapter initialization and the scsi side has no action in
      slave alloc.
      
      As XRI's are no longer split, the lpfc_xri_split module parameter is
      removed.
      
      Adapters based on SLI3 will continue to use the older scsi_buf_list_get/put
      routines.  All SLI4 adapters utilize the new IO buffer scheme
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0794d601
  2. 20 12月, 2018 1 次提交
    • J
      scsi: lpfc: Adding ability to reset chip via pci bus reset · 5021267a
      James Smart 提交于
      This patch adds a "pci_bus_reset" option to the board_mode sysfs attribute.
      This option uses the pci_reset_bus() api to reset the PCIe link the adapter
      is on, which will reset the chip/adapter.  Prior to issuing this option,
      all functions on the same chip must be placed in the offline state by the
      admin. After the reset, all of the instances may be brought online again.
      
      The primary purpose of this functionality is to support cases where
      firmware update required a chip reset but the admin did not want to reboot
      the machine in order to instantiate the firmware update.
      
      Sanity checks take place prior to the reset to ensure the adapter is the
      sole entity on the PCIe bus and that all functions are in the offline
      state.
      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>
      5021267a
  3. 13 12月, 2018 1 次提交
  4. 08 12月, 2018 3 次提交
  5. 07 11月, 2018 2 次提交
  6. 21 9月, 2018 1 次提交
  7. 12 9月, 2018 3 次提交
  8. 28 8月, 2018 1 次提交
  9. 03 8月, 2018 2 次提交
  10. 11 7月, 2018 2 次提交
  11. 27 6月, 2018 1 次提交
  12. 29 5月, 2018 1 次提交
  13. 08 5月, 2018 2 次提交
  14. 19 4月, 2018 4 次提交
  15. 13 3月, 2018 1 次提交
  16. 23 2月, 2018 3 次提交
  17. 13 2月, 2018 4 次提交
  18. 09 1月, 2018 2 次提交