1. 31 5月, 2019 1 次提交
  2. 29 5月, 2019 3 次提交
    • B
      ice: Refactor interrupt tracking · cbe66bfe
      Brett Creeley 提交于
      Currently we have two MSI-x (IRQ) trackers, one for OS requested MSI-x
      entries (sw_irq_tracker) and one for hardware MSI-x vectors
      (hw_irq_tracker). Generally the sw_irq_tracker has less entries than the
      hw_irq_tracker because the hw_irq_tracker has entries equal to the max
      allowed MSI-x per PF and the sw_irq_tracker is mainly the minimum (non
      SR-IOV portion of the vectors, kernel granted IRQs). All of the non
      SR-IOV portions of the driver (i.e. LAN queues, RDMA queues, OICR, etc.)
      take at least one of each type of tracker resource. SR-IOV only grabs
      entries from the hw_irq_tracker. There are a few issues with this approach
      that can be seen when doing any kind of device reconfiguration (i.e.
      ethtool -L, SR-IOV, etc.). One of them being, any time the driver creates
      an ice_q_vector and associates it to a LAN queue pair it will grab and
      use one entry from the hw_irq_tracker and one from the sw_irq_tracker.
      If the indices on these does not match it will cause a Tx timeout, which
      will cause a reset and then the indices will match up again and traffic
      will resume. The mismatched indices come from the trackers not being the
      same size and/or the search_hint in the two trackers not being equal.
      Another reason for the refactor is the co-existence of features with
      SR-IOV. If SR-IOV is enabled and the interrupts are taken from the end
      of the sw_irq_tracker then other features can no longer use this space
      because the hardware has now given the remaining interrupts to SR-IOV.
      
      This patch reworks how we track MSI-x vectors by removing the
      hw_irq_tracker completely and instead MSI-x resources needed for SR-IOV
      are determined all at once instead of per VF. This can be done because
      when creating VFs we know how many are wanted and how many MSI-x vectors
      each VF needs. This also allows us to start using MSI-x resources from
      the end of the PF's allowed MSI-x vectors so we are less likely to use
      entries needed for other features (i.e. RDMA, L2 Offload, etc).
      
      This patch also reworks the ice_res_tracker structure by removing the
      search_hint and adding a new member - "end". Instead of having a
      search_hint we will always search from 0. The new member, "end", will be
      used to manipulate the end of the ice_res_tracker (specifically
      sw_irq_tracker) during runtime based on MSI-x vectors needed by SR-IOV.
      In the normal case, the end of ice_res_tracker will be equal to the
      ice_res_tracker's num_entries.
      
      The sriov_base_vector member was added to the PF structure. It is used
      to represent the starting MSI-x index of all the needed MSI-x vectors
      for all SR-IOV VFs. Depending on how many MSI-x are needed, SR-IOV may
      have to take resources from the sw_irq_tracker. This is done by setting
      the sw_irq_tracker->end equal to the pf->sriov_base_vector. When all
      SR-IOV VFs are removed then the sw_irq_tracker->end is reset back to
      sw_irq_tracker->num_entries. The sriov_base_vector, along with the VF's
      number of MSI-x (pf->num_vf_msix), vf_id, and the base MSI-x index on
      the PF (pf->hw.func_caps.common_cap.msix_vector_first_id), is used to
      calculate the first HW absolute MSI-x index for each VF, which is used
      to write to the VPINT_ALLOC[_PCI] and GLINT_VECT2FUNC registers to
      program the VFs MSI-x PCI configuration bits. Also, the sriov_base_vector
      is used along with VF's num_vf_msix, vf_id, and q_vector->v_idx to
      determine the MSI-x register index (used for writing to GLINT_DYN_CTL)
      within the PF's space.
      
      Interrupt changes removed any references to hw_base_vector, hw_oicr_idx,
      and hw_irq_tracker. Only sw_base_vector, sw_oicr_idx, and sw_irq_tracker
      variables remain. Change all of these by removing the "sw_" prefix to
      help avoid confusion with these variables and their use.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      cbe66bfe
    • A
      ice: Add handler for ethtool selftest · 0e674aeb
      Anirudh Venkataramanan 提交于
      This patch adds a handler for ethtool selftest. Selftest includes
      testing link, interrupts, eeprom, registers and packet loopback.
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      0e674aeb
    • B
      ice: Set minimum default Rx descriptor count to 512 · 1aec6e1b
      Brett Creeley 提交于
      Currently we set the default number of Rx descriptors per
      queue to the system's page size divided by the number of bytes per
      descriptor. For 4K page size systems this is resulting in 128 Rx
      descriptors per queue. This is causing more dropped packets than desired
      in the default configuration. Fix this by setting the minimum default
      Rx descriptor count per queue to 512.
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1aec6e1b
  3. 24 5月, 2019 3 次提交
  4. 05 5月, 2019 2 次提交
  5. 02 5月, 2019 2 次提交
  6. 18 4月, 2019 5 次提交
  7. 27 3月, 2019 2 次提交
  8. 22 3月, 2019 2 次提交
  9. 20 3月, 2019 1 次提交
  10. 26 2月, 2019 1 次提交
  11. 16 1月, 2019 4 次提交
  12. 21 11月, 2018 2 次提交
  13. 14 11月, 2018 2 次提交
  14. 07 11月, 2018 3 次提交
  15. 03 10月, 2018 5 次提交
  16. 02 10月, 2018 2 次提交
    • B
      ice: Add support for dynamic interrupt moderation · 9e4ab4c2
      Brett Creeley 提交于
      Currently there is no support for dynamic interrupt moderation. This
      patch adds some initial code to support this. The following changes
      were made:
      
      1. Currently we are using multiple members to store the interrupt
         granularity (itr_gran_25/50/100/200). This is not necessary because
         we can query the device to determine what the interrupt granularity
         should be set to, done by a new function ice_get_itr_intrl_gran.
      
      2. Added intrl to ice_q_vector structure to support interrupt rate
         limiting.
      
      3. Added the function ice_intrl_usecs_to_reg for converting to a value
         in usecs that the device understands.
      
      4. Added call to write to the GLINT_RATE register. Disable intrl by
         default for now.
      
      5. Changed rx/tx_itr_setting to itr_setting because having both seems
         redundant because a ring is either Tx or Rx.
      
      6. Initialize itr_setting for both Tx/Rx rings in ice_vsi_alloc_rings()
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9e4ab4c2
    • P
      ice: Split irq_tracker into sw_irq_tracker and hw_irq_tracker · eb0208ec
      Preethi Banala 提交于
      For the PF driver, when mapping interrupts to queues, we need to request
      IRQs from the kernel and we also have to allocate interrupts from
      the device.
      
      Similarly, when the VF driver (iavf.ko) initializes, it requests the kernel
      IRQs that it needs but it can't directly allocate interrupts in the device.
      Instead, it sends a mailbox message to the ice driver, which then allocates
      interrupts in the device on the VF driver's behalf.
      
      Currently both these cases end up having to reserve entries in
      pf->irq_tracker but irq_tracker itself is sized based on how many vectors
      the PF driver needs. Under the right circumstances, the VF driver can fail
      to get entries in irq_tracker, which will result in the VF driver failing
      probe.
      
      To fix this, sw_irq_tracker and hw_irq_tracker are introduced. The
      sw_irq_tracker tracks only the PF's IRQ request and doesn't play any
      role in VF init. hw_irq_tracker represents the device's interrupt space.
      When interrupts have to be allocated in the device for either PF or VF,
      hw_irq_tracker will be looked up to see if the device has run out of
      interrupts.
      Signed-off-by: NPreethi Banala <preethi.banala@intel.com>
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      eb0208ec