1. 10 10月, 2017 5 次提交
  2. 03 10月, 2017 8 次提交
  3. 30 9月, 2017 1 次提交
    • A
      i40e: Enable VF to negotiate number of allocated queues · a3f5aa90
      Alan Brady 提交于
      Currently the PF allocates a default number of queues for each VF and
      cannot be changed.  This patch enables the VF to request a different
      number of queues allocated to it.  This patch also adds a new virtchnl
      op and capability flag to facilitate this negotiation.
      
      After the PF receives a request message, it will set a requested number
      of queues for that VF.  Then when the VF resets, its VSI will get a new
      number of queues allocated to it.
      
      This is a best effort request and since we only allocate a guaranteed
      default number, if the VF tries to ask for more than the guaranteed
      number, there may not be enough in HW to accommodate it unless other
      queues for other VFs are freed. It should also be noted decreasing the
      number queues allocated to a VF to below the default will NOT enable the
      allocation of more than 32 VFs per PF and will not free queues guaranteed
      to each VF by default.
      Signed-off-by: NAlan Brady <alan.brady@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a3f5aa90
  4. 28 8月, 2017 2 次提交
  5. 26 8月, 2017 2 次提交
    • S
      i40e/i40evf: rename vf_offload_flags to vf_cap_flags in struct virtchnl_vf_resource · fbb113f7
      Stefan Assmann 提交于
      The current name of vf_offload_flags indicates that the bitmap is
      limited to offload related features. Make this more generic by renaming
      it to vf_cap_flags, which allows for other capabilities besides
      offloading to be added.
      Signed-off-by: NStefan Assmann <sassmann@kpanic.de>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      fbb113f7
    • J
      i40e: separate hw_features from runtime changing flags · d36e41dc
      Jacob Keller 提交于
      The number of flags found in pf->flags has grown quite large, and there
      are a lot of different types of flags. Most of the flags are simply
      hardware features which are enabled on some firmware or some MAC types.
      Other flags are dynamic run-time flags which enable or disable certain
      features of the driver.
      
      Separate these two types of flags into pf->hw_features and pf->flags.
      The hw_features list will contain a set of features which are enabled at
      init time. This will not contain toggles or otherwise dynamically
      changing features. These flags should not need atomic protections, as
      they will be set once during init and then be essentially read only.
      
      Everything else will remain in the flags variable. These flags may be
      modified at any time during run time. A future patch may wish to convert
      these flags into set_bit/clear_bit/test_bit or similar approach to
      ensure atomic correctness.
      
      The I40E_FLAG_MFP_ENABLED flag may be a good fit for hw_features but
      currently is used by ethtool in the private flags settings, and thus has
      been left as part of flags.
      
      Additionally, I40E_FLAG_DCB_CAPABLE may be a good fit for the
      hw_features but this patch has not tried to untangle it yet.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d36e41dc
  6. 26 7月, 2017 3 次提交
  7. 15 6月, 2017 1 次提交
  8. 02 6月, 2017 7 次提交
  9. 30 4月, 2017 5 次提交
    • J
      i40e: use DECLARE_BITMAP for state fields · 0da36b97
      Jacob Keller 提交于
      Instead of assuming our flags fit within an unsigned long, use
      DECLARE_BITMAP which will ensure that we always allocate enough space.
      Additionally, use __I40E_STATE_SIZE__ markers as the last element of the
      enumeration so that the size of the BITMAP is compile-time assigned
      rather than programmer-time assigned. This ensures that potential future
      flag additions do not actually overrun the array. This is especially
      important as 32bit systems would only have 32bit longs instead of 64bit
      longs as we generally have assumed in the prior code.
      
      This change also removes a dereference of the state fields throughout
      the code, so it does have a bit of code churn. The conversions were
      automated using sed replacements with an alternation
      
        s/&(vsi->back|vsi|pf)->state/\1->state/
        s/&adapter->vsi.state/adapter->vsi.state/
      
      For debugfs, we modify the printing so that we can display chunks of the
      state value on new lines. This ensures that we can print the entire set
      of state values. Additionally, we now print them as 08lx to ensure that
      they display nicely.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      0da36b97
    • J
      i40e: remove unnecessary msleep() delay in i40e_free_vfs · 2318b401
      Jacob Keller 提交于
      The delay was added because of a desire to ensure that the VF driver can
      finish up removing. However, pci_disable_sriov already has its own
      ssleep() call that will sleep for an entire second, so there is no
      reason to add extra delay on top of this by using msleep here. In
      practice, an msleep() won't have a huge impact on timing but there is no
      real value in keeping it, so lets just simplify the code and remove it.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      2318b401
    • J
      i40e: amortize wait time when disabling lots of VFs · 707d088a
      Jacob Keller 提交于
      Just as we do in i40e_reset_all_vfs, save some time when freeing VFs by
      amortizing the wait time for stopping queues. We can use
      i40e_vsi_stop_rings_no_wait() to begin the process of stopping all the
      VF rings at once. Then, once we've started the process on each VF we can
      begin waiting for the VFs to stop. This helps reduce the total wait time
      by a large factor.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      707d088a
    • J
      i40e: make use of i40e_reset_all_vfs when initializing new VFs · 1b484370
      Jacob Keller 提交于
      When allocating a large number of VFs, the driver previously used
      i40e_reset_vf in a sequence. Just as when performing a normal reset,
      this accumulates a large amount of delay for handling all of the VFs in
      sequence. This delay is mainly due to a hardware requirement to wait
      after initiating a reset on the VF.
      
      We recently added a new function, i40e_reset_all_vfs() which can be used
      to amortize the delay time, by first triggering all VF resets, then
      waiting once, and finally cleaning up and allocating the VFs. This is
      almost as good as truly running the resets in parallel.
      
      In order to avoid sending a spurious reset message to a client
      interface, we have a check to see whether we've assigned
      pf->num_alloc_vfs yet. This was originally intended as a way to
      distinguish the "initialization" case from the regular reset case.
      
      Unfortunately, this means that we can't directly use i40e_reset_all_vfs
      yet. Lets avoid this check of pf->num_alloc_vfs by replacing it with
      a proper VSI state bit which we can use instead. This makes the
      intention much clearer and allows us to re-use the i40e_reset_all_vfs
      function directly.
      
      Change-ID: I694279b37eb6b5a91b6670182d0c15d10244fd6e
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NMitch Williams <mitch.a.williams@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1b484370
    • J
      i40e: properly spell I40E_VF_STATE_* flags · 6322e63c
      Jacob Keller 提交于
      These flags represent the state of the VF at various times. Do not
      spell them as _STAT_ which can be confusing to readers who may think
      these refer to statistics.
      
      Change-ID: I6bc092cd472e8276896a1fd7498aced2084312df
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      6322e63c
  10. 20 4月, 2017 2 次提交
    • J
      i40e: reset all VFs in parallel when rebuilding PF · e4b433f4
      Jacob Keller 提交于
      When there are a lot of active VFs, it can take multiple seconds to
      finish resetting all of them during certain flows., which can cause some
      VFs to fail to wait long enough for the reset to occur. The user might
      see messages like "Never saw reset" or "Reset never finished" and the VF
      driver will stop functioning properly.
      
      The naive solution would be to simply increase the wait timer. We can
      get much more clever. Notice that i40e_reset_vf is run in a serialized
      fashion, and includes lots of delays.
      
      There are two prominent delays which take most of the time. First, when
      we begin resetting VFs, we have multiple 10ms delays which accrue
      because we reset each VF in a serial fashion. These delays accumulate to
      almost 4 seconds when handling the maximum number of VFs (128).
      
      Secondly, there is a massive 50ms delay for each time we disable queues
      on a VSI. This delay is necessary to allow HW to finish disabling queues
      before we restore functionality. However, just like with the first case,
      we are paying the cost for each VF, rather than disabling all VFs and
      waiting once.
      
      Both of these can be fixed, but required some previous refactoring to
      handle the special case. First, we will need the
      i40e_vsi_wait_queues_disabled function which was previously DCB
      specific. Second, we will need to implement our own
      i40e_vsi_stop_rings_no_wait function which will handle the stopping of
      rings without the delays.
      
      Finally, implement an i40e_reset_all_vfs function, which will first
      start the reset of all VFs, and pay the wait cost all at once, rather
      than serially waiting for each VF before we start processing then next
      one. After the VF has been reset, we'll disable all the VF queues, and
      then wait for them to disable. Again, we'll organize the flow such that
      we pay the wait cost only once.
      
      Finally, after we've disabled queues we'll go ahead and begin restoring
      VF functionality. The result is reducing the wait time by a large factor
      and ensuring that VFs do not timeout when waiting in the VF driver.
      
      Change-ID: Ia6e8cf8d98131b78aec89db78afb8d905c9b12be
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e4b433f4
    • J
      i40e: split some code in i40e_reset_vf into helpers · 9dc2e417
      Jacob Keller 提交于
      A future patch is going to want to re-use some of the code in
      i40e_reset_vf, so lets break up the beginning and ending parts into
      their own helper functions. The first function will be used to
      initialize the reset on a VF, while the second function will be used to
      finalize the reset and restore functionality.
      
      Change-ID: I48df808b8bf09de3c2ed8c521f57b3f0ab9e5907
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9dc2e417
  11. 07 4月, 2017 1 次提交
  12. 28 3月, 2017 1 次提交
    • R
      i40e: Fixed race conditions in VF reset · beff3e9d
      Robert Konklewski 提交于
      First, this patch eliminates IOMMU DMAR Faults caused by VF hardware.
      This is done by enabling VF hardware only after VSI resources are
      freed. Otherwise, hardware could DMA into memory that is (or just has
      been) being freed.
      
      Then, the VF driver is activated only after VSI resources have been
      reallocated. That's because the VF driver can request resources
      immediately after it's activated. So they need to be ready at that
      point.
      
      The second race condition happens when the OS initiates a VF reset,
      and then before it's finished modifies VF's settings by changing its
      MAC, VLAN ID, bandwidth allocation, anti-spoof checking, etc. These
      functions needed to be blocked while VF is undergoing reset. Otherwise,
      they could operate on data structures that had just been freed or not
      yet fully initialized.
      
      Change-ID: I43ba5a7ae2c9a1cce3911611ffc4598ae33ae3ff
      Signed-off-by: NRobert Konklewski <robertx.konklewski@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      beff3e9d
  13. 15 3月, 2017 2 次提交