1. 15 2月, 2018 3 次提交
  2. 11 1月, 2018 2 次提交
    • J
      i40e: add helper conversion function for link_speed · 5b643479
      Jacob Keller 提交于
      We introduced the virtchnl interface in order to have an interface for
      talking to a virtual device driver which was host-driver agnostic. This
      interface has its own definitions, including one for link speed.
      
      The host driver has to talk to the virtchnl interface using these new
      definitions in order to remain compatible. Today, the i40e link_speed
      enumerations are value-exact matches for the virtchnl interface, so it
      was originally decided to simply use a typecast.
      
      However, this is unsafe, and makes it easier for future drivers to
      continue this unsafe practice. There is nothing guaranteeing these
      values are exact, and the type-cast would hide any compiler warning
      which indicates the problem.
      
      Rather than rely on this type cast, introduce a helper function which
      can convert the AdminQ link speed definition into a virtchnl
      definition. This can then be used by host driver implementations in
      order to safely convert to the interface recognized by the virtual
      functions.
      
      If the link speed is not able to be represented by the virtchnl
      definitions we'll report UNKNOWN which is the safest result.
      
      This will ensure that should the driver specific link_speeds actual bit
      definitions change, we do not report them incorrectly according to the
      VF.
      
      Additionally, this provides a better pattern for future drivers to copy,
      as it is more likely a future device may not use the exact same bit-wise
      definition as the current virtchnl interface.
      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>
      5b643479
    • 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
  3. 28 11月, 2017 1 次提交
  4. 22 11月, 2017 1 次提交
  5. 14 10月, 2017 3 次提交
  6. 10 10月, 2017 5 次提交
  7. 03 10月, 2017 8 次提交
  8. 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
  9. 28 8月, 2017 2 次提交
  10. 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
  11. 26 7月, 2017 3 次提交
  12. 15 6月, 2017 1 次提交
  13. 02 6月, 2017 7 次提交
  14. 30 4月, 2017 1 次提交
    • 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