1. 22 12月, 2019 1 次提交
  2. 06 11月, 2019 3 次提交
  3. 25 10月, 2019 4 次提交
  4. 01 10月, 2019 3 次提交
  5. 30 8月, 2019 1 次提交
  6. 20 8月, 2019 8 次提交
  7. 21 6月, 2019 1 次提交
  8. 19 6月, 2019 3 次提交
  9. 14 5月, 2019 2 次提交
  10. 04 4月, 2019 2 次提交
  11. 26 3月, 2019 1 次提交
    • S
      scsi: lpfc: change snprintf to scnprintf for possible overflow · e7f7b6f3
      Silvio Cesare 提交于
      Change snprintf to scnprintf. There are generally two cases where using
      snprintf causes problems.
      
      1) Uses of size += snprintf(buf, SIZE - size, fmt, ...)
      In this case, if snprintf would have written more characters than what the
      buffer size (SIZE) is, then size will end up larger than SIZE. In later
      uses of snprintf, SIZE - size will result in a negative number, leading
      to problems. Note that size might already be too large by using
      size = snprintf before the code reaches a case of size += snprintf.
      
      2) If size is ultimately used as a length parameter for a copy back to user
      space, then it will potentially allow for a buffer overflow and information
      disclosure when size is greater than SIZE. When the size is used to index
      the buffer directly, we can have memory corruption. This also means when
      size = snprintf... is used, it may also cause problems since size may become
      large.  Copying to userspace is mitigated by the HARDENED_USERCOPY kernel
      configuration.
      
      The solution to these issues is to use scnprintf which returns the number of
      characters actually written to the buffer, so the size variable will never
      exceed SIZE.
      Signed-off-by: NSilvio Cesare <silvio.cesare@gmail.com>
      Signed-off-by: NWilly Tarreau <w@1wt.eu>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Cc: Dick Kennedy <dick.kennedy@broadcom.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      e7f7b6f3
  12. 20 3月, 2019 3 次提交
  13. 06 2月, 2019 8 次提交
    • J
      scsi: lpfc: Update 12.2.0.0 file copyrights to 2019 · 0d041215
      James Smart 提交于
      For files modified as part of 12.2.0.0 patches, update copyright to 2019
      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>
      0d041215
    • J
      scsi: lpfc: Fix default driver parameter collision for allowing NPIV support · f6e84790
      James Smart 提交于
      The conversion to enable SCSI and NVME fc4 support ran into an issue with
      NPIV support. With NVME, NPIV is not currently supported, but with SCSI it
      was. The driver reverted to its lowest setting meaning NPIV with SCSI was
      not allowed.
      
      Convert the NPIV checks and implementation so that SCSI can continue to
      allow NPIV support.
      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>
      f6e84790
    • J
      scsi: lpfc: Enable SCSI and NVME fc4s by default · b1684a0b
      James Smart 提交于
      Now that performance mods don't split resources by protocol and enable both
      protocols by default, there's no reason not to enable concurrent SCSI and
      NVME fc4 support.
      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>
      b1684a0b
    • J
      scsi: lpfc: Resize cpu maps structures based on possible cpus · 222e9239
      James Smart 提交于
      The work done to date utilized the number of present cpus when sizing
      per-cpu structures. Structures should have been sized based on the max
      possible cpu count.
      
      Convert the driver over to possible cpu count for sizing allocation.
      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>
      222e9239
    • J
      scsi: lpfc: Rework EQ/CQ processing to address interrupt coalescing · 32517fc0
      James Smart 提交于
      When driving high iop counts, auto_imax coalescing kicks in and drives the
      performance to extremely small iops levels.
      
      There are two issues:
      
       1) auto_imax is enabled by default. The auto algorithm, when iops gets
          high, divides the iops by the hdwq count and uses that value to
          calculate EQ_Delay. The EQ_Delay is set uniformly on all EQs whether
          they have load or not. The EQ_delay is only manipulated every 5s (a
          long time). Thus there were large 5s swings of no interrupt delay
          followed by large/maximum delay, before repeating.
      
       2) When processing a CQ, the driver got mixed up on the rate of when
          to ring the doorbell to keep the chip appraised of the eqe or cqe
          consumption as well as how how long to sit in the thread and
          process queue entries. Currently, the driver capped its work at
          64 entries (very small) and exited/rearmed the CQ.  Thus, on heavy
          loads, additional overheads were taken to exit and re-enter the
          interrupt handler. Worse, if in the large/maximum coalescing
          windows,k it could be a while before getting back to servicing.
      
      The issues are corrected by the following:
      
       - A change in defaults. Auto_imax is turned OFF and fcp_imax is set
         to 0. Thus all interrupts are immediate.
      
       - Cleanup of field names and their meanings. Existing names were
         non-intuitive or used for duplicate things.
      
       - Added max_proc_limit field, to control the length of time the
         handlers would service completions.
      
       - Reworked EQ handling:
          Added common routine that walks eq, applying notify interval and max
            processing limits. Use queue_claimed to claim ownership of the queue
            while processing. Always rearm the queue whenever the common routine
            is called.
          Rework queue element processing, namely to eliminate hba_index vs
            host_index. Only one index is necessary. The queue entry can be
            marked invalid and the host_index updated immediately after eqe
            processing.
          After rework, xx_release routines are now DB write functions. Renamed
            the routines as such.
          Moved lpfc_sli4_eq_flush(), which does similar action, to same area.
          Replaced the 2 individual loops that walk an eq with a call to the
            common routine.
          Slightly revised lpfc_sli4_hba_handle_eqe() calling syntax.
          Added per-cpu counters to detect interrupt rates and scale
            interrupt coalescing values.
      
       - Reworked CQ handling:
          Added common routine that walks cq, applying notify interval and max
            processing limits. Use queue_claimed to claim ownership of the queue
            while processing. Always rearm the queue whenever the common routine
            is called.
          Rework queue element processing, namely to eliminate hba_index vs
            host_index. Only one index is necessary. The queue entry can be
            marked invalid and the host_index updated immediately after cqe
            processing.
          After rework, xx_release routines are now DB write functions.  Renamed
            the routines as such.
          Replaced the 3 individual loops that walk a cq with a call to the
            common routine.
          Redefined lpfc_sli4_sp_handle_mcqe() to commong handler definition with
            queue reference. Add increment for mbox completion to handler.
      
       - Added a new module/sysfs attribute: lpfc_cq_max_proc_limit To allow
         dynamic changing of the CQ max_proc_limit value being used.
      
      Although this leaves an EQ as an immediate interrupt, that interrupt will
      only occur if a CQ bound to it is in an armed state and has cqe's to
      process.  By staying in the cq processing routine longer, high loads will
      avoid generating more interrupts as they will only rearm as the processing
      thread exits. The immediately interrupt is also beneficial to idle or
      lower-processing CQ's as they get serviced immediately without being
      penalized by sharing an EQ with a more loaded 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>
      32517fc0
    • J
      scsi: lpfc: cleanup: convert eq_delay to usdelay · cb733e35
      James Smart 提交于
      Review of the eq coalescing logic showed the code was a bit fragmented.
      Sometimes it would save/set via an interrupt max value, while in others it
      would do so via a usdelay. There were also two places changing eq delay,
      one place that issued mailbox commands, and another that changed via
      register writes if supported.
      
      Clean this up by:
      
       - Standardizing the operation of lpfc_modify_hba_eq_delay() routine so
         that it is always told of a us delay to impose. The routine then chooses
         the best way to set that - via register or via mbx.
      
       - Rather than two value types stored in eq->q_mode (usdelay if change via
         register, imax if change via mbox) - q_mode always contains usdelay.
         Before any value change, old vs new value is compared and only if
         different is a change done.
      
       - Revised the dmult calculation. dmult is not set based on overall imax
         divided by hardware queues - instead imax applies to a single cpu and
         the value will be replicated to all cpus.
      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>
      cb733e35
    • J
      scsi: lpfc: Support non-uniform allocation of MSIX vectors to hardware queues · 6a828b0f
      James Smart 提交于
      So far MSIX vector allocation assumed it would be 1:1 with hardware
      queues. However, there are several reasons why fewer MSIX vectors may be
      allocated than hardware queues such as the platform being out of vectors or
      adapter limits being less than cpu count.
      
      This patch reworks the MSIX/EQ relationships with the per-cpu hardware
      queues so they can function independently. MSIX vectors will be equitably
      split been cpu sockets/cores and then the per-cpu hardware queues will be
      mapped to the vectors most efficient for them.
      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>
      6a828b0f
    • J
      scsi: lpfc: Fix setting affinity hints to correlate with hardware queues · b3295c2a
      James Smart 提交于
      The desired affinity for the hardware queue behavior is for hdwq 0 to be
      affinitized with cpu 0, hdwq 1 to cpu 1, and so on.  The implementation so
      far does not do this if the number of cpus is greater than the number of
      hardware queues (e.g. hardware queue allocation was administratively
      reduced or hardware queue resources could not scale to the cpu count).
      
      Correct the queue affinitization logic when queue count is less than
      cpu count.
      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>
      b3295c2a