1. 11 1月, 2018 1 次提交
    • J
      i40e: update VFs of link state after GET_VF_RESOURCES · d3d657a9
      Jacob Keller 提交于
      We currently notify a VF of the link state after ENABLE_QUEUES, which is
      the last thing a VF does after being configured. Guests may not actually
      ENABLE_QUEUES until they get configured, and thus between driver load
      and device configuration the VF may show inaccurate link status.
      
      Fix this by also sending the link state after GET_VF_RESOURCES. Although
      we could remove the message following ENABLE_QUEUES, it's not that
      significant of a loss, so this patch just keeps both to ensure maximum
      compatibility with guests on various OSes.
      
      Specifically, without this patch guests running FreeBSD will display
      inaccurate link state until the device is brought up. This is mostly
      a cosmetic issue but can be confusing to system administrators.
      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>
      d3d657a9
  2. 28 11月, 2017 1 次提交
  3. 22 11月, 2017 1 次提交
  4. 14 10月, 2017 3 次提交
  5. 10 10月, 2017 5 次提交
  6. 03 10月, 2017 8 次提交
  7. 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
  8. 28 8月, 2017 2 次提交
  9. 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
  10. 26 7月, 2017 3 次提交
  11. 15 6月, 2017 1 次提交
  12. 02 6月, 2017 7 次提交
  13. 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