1. 18 10月, 2017 13 次提交
  2. 14 10月, 2017 1 次提交
    • A
      i40e: Enable 'channel' mode in mqprio for TC configs · a9ce82f7
      Amritha Nambiar 提交于
      The i40e driver is modified to enable the new mqprio hardware
      offload mode and factor the TCs and queue configuration by
      creating channel VSIs. In this mode, the priority to traffic
      class mapping and the user specified queue ranges are used
      to configure the traffic classes by setting the mode option to
      'channel'.
      
      Example:
        map 0 0 0 0 1 2 2 3 queues 2@0 2@2 1@4 1@5\
        hw 1 mode channel
      
      qdisc mqprio 8038: root  tc 4 map 0 0 0 0 1 2 2 3 0 0 0 0 0 0 0 0
                   queues:(0:1) (2:3) (4:4) (5:5)
                   mode:channel
                   shaper:dcb
      
      The HW channels created are removed and all the queue configuration
      is set to default when the qdisc is detached from the root of the
      device.
      
      This patch also disables setting up channels via ethtool (ethtool -L)
      when the TCs are configured using mqprio scheduler.
      
      The patch also limits setting ethtool Rx flow hash indirection
      (ethtool -X eth0 equal N) to max queues configured via mqprio.
      The Rx flow hash indirection input through ethtool should be
      validated so that it is within in the queue range configured via
      tc/mqprio. The bound checking is achieved by reporting the current
      rss size to the kernel when queues are configured via mqprio.
      
      Example:
        map 0 0 0 1 0 2 3 0 queues 2@0 4@2 8@6 11@14\
        hw 1 mode channel
      
      Cannot set RX flow hash configuration: Invalid argument
      Signed-off-by: NAmritha Nambiar <amritha.nambiar@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a9ce82f7
  3. 06 10月, 2017 3 次提交
  4. 03 10月, 2017 1 次提交
  5. 26 8月, 2017 3 次提交
    • A
      i40e: prevent changing ITR if adaptive-rx/tx enabled · 06b2decd
      Alan Brady 提交于
      Currently the driver allows the user to change (or even disable)
      interrupt moderation if adaptive-rx/tx is enabled when this should
      not be the case.
      
      Adaptive RX/TX will not respect the user's ITR settings so
      allowing the user to change it is weird.  This bug would also
      allow the user to disable interrupt moderation with adaptive-rx/tx
      enabled which doesn't make much sense either.
      
      This patch makes it such that if adaptive-rx/tx is enabled, the user
      cannot make any manual adjustments to interrupt moderation.  It also
      makes it so that if ITR is disabled but adaptive-rx/tx is then
      enabled, ITR will be re-enabled.
      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>
      06b2decd
    • J
      i40e/i40evf: use cmpxchg64 when updating private flags in ethtool · 841c950d
      Jacob Keller 提交于
      When a user gives an invalid command to change a private flag which is
      not supported, either because it is read-only, or the device is not
      capable of the feature, we simply ignore the request.
      
      A naive solution would simply be to report error codes when one of the
      flags was not supported. However, this causes problems because it makes
      the operation not atomic. If a user requests multiple private flags
      together at once we could end up changing one before failing at the
      second flag.
      
      We can do a bit better if we instead update a temporary copy of the
      flags variable in the loop, and then copy it into place after. If we
      aren't careful this has the pitfall of potentially silently overwriting
      any changes caused by other threads.
      
      Avoid this by using cmpxchg64 which will compare and swap the flags
      variable only if it currently matched the old value. We'll report
      -EAGAIN in the (hopefully rare!) case where the cmpxchg64 fails.
      
      This ensures that we can properly report when flags are not supported in
      an atomic fashion without the risk of overwriting other threads changes.
      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>
      841c950d
    • 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 1 次提交
  7. 21 6月, 2017 2 次提交
  8. 13 6月, 2017 1 次提交
    • J
      i40e: fix handling of HW ATR eviction · 6964e53f
      Jacob Keller 提交于
      A recent commit to refactor the driver and remove the hw_disabled_flags
      field accidentally introduced two regressions. First, we overwrote
      pf->flags which removed various key flags including the MSI-X settings.
      
      Additionally, it was intended that we have now two flags,
      HW_ATR_EVICT_CAPABLE and HW_ATR_EVICT_ENABLED, but this was not done,
      and we accidentally were mis-using HW_ATR_EVICT_CAPABLE everywhere.
      
      This patch adds the missing piece, HW_ATR_EVICT_ENABLED, and safely
      updates pf->flags instead of overwriting it.
      
      Without this patch we will have many problems including disabling MSI-X
      support, and we'll attempt to use HW ATR eviction on devices which do
      not support it.
      
      Fixes: 47994c11 ("i40e: remove hw_disabled_flags in favor of using separate flag bits", 2017-04-19)
      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>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6964e53f
  9. 31 5月, 2017 1 次提交
  10. 30 4月, 2017 3 次提交
    • J
      i40e: remove hw_disabled_flags in favor of using separate flag bits · 47994c11
      Jacob Keller 提交于
      The hw_disabled_flags field was added as a way of signifying that
      a feature was automatically or temporarily disabled. However, we
      actually only use this for FDir features. Replace its use with new
      _AUTO_DISABLED flags instead. This is more readable, because you aren't
      setting an *_ENABLED flag to *disable* the feature.
      
      Additionally, clean up a few areas where we used these bits. First, we
      don't really need to set the auto-disable flag for ATR if we're fully
      disabling the feature via ethtool.
      
      Second, we should always clear the auto-disable bits in case they somehow
      got set when the feature was disabled. However, avoid displaying
      a message that we've re-enabled the feature.
      
      Third, we shouldn't be re-enabling ATR in the SB ntuple add flow,
      because it might have been disabled due to space constraints. Instead,
      we should just wait for the fdir_check_and_reenable to be called by the
      watchdog.
      
      Overall, this change allows us to simplify some code by removing an
      extra field we didn't need, and the result should make it more clear as
      to what we're actually doing with these flags.
      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>
      47994c11
    • 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: 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
  11. 20 4月, 2017 1 次提交
    • J
      i40e: fix CONFIG_BUSY checks in i40e_set_settings function · e8d2f4c6
      Jacob Keller 提交于
      The check for I40E_CONFIG_BUSY state bit in the i40e_set_link_ksettings
      function is fishy. First we can notice a few things about the check here.
      
      First a similar check was introduced by commit
      'c7d05ca8 ("i40e: driver ethtool core")'
      
      Later a commit introducing the link settings was added by commit
      'bf9c7141 ("i40e: Implement set_settings for ethtool")'
      
      However, this second check was against vsi->state instead of pf->state,
      and also failed to set the bit, it only checks. That indicates the locking
      was not quite correct. The only other place that the state bit
      in vsi->state gets used is to protect the filter list.
      
      Since this code does not care about the mac filter list,  and seems
      clear the original code should have set the pf->state bit. Fix these
      issues by using pf->state correctly, and by actually setting the bit
      so that we properly lock as expected.
      
      Since these checks occur while holding the rtnl_lock(), lets also add a
      timeout so that we don't potentially softlock the system.
      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>
      e8d2f4c6
  12. 08 4月, 2017 2 次提交
  13. 29 3月, 2017 2 次提交
  14. 28 3月, 2017 1 次提交
  15. 24 3月, 2017 5 次提交
    • J
      i40e: add support for SCTPv4 FDir filters · f223c875
      Jacob Keller 提交于
      Enable FDir filters for SCTPv4 packets using the ethtool ntuple
      interface to enable filters. The ethtool API does not allow masking on
      the verification tag.
      
      Change-Id: I093e88a8143994c7e6f4b7b17a0bd5cf861d18e4
      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>
      f223c875
    • J
      i40e: implement support for flexible word payload · 0e588de1
      Jacob Keller 提交于
      Add support for flexible payloads passed via ethtool user-def field.
      This support is somewhat limited due to hardware design. The input set
      can only be programmed once per filter type, and the flexible offset is
      part of this filter input set. This means that the user cannot program
      both a regular and a flexible filter at the same time for a given flow
      type. Additionally, the user may not program two flexible filters of the
      same flow type with different offsets, although they are allowed to
      configure different values at that offset location.
      
      We support a single flexible word (2byte) value per protocol type, and
      we handle the FLX_PIT register using a list of flexible entries so that
      each flow type may be configured separately.
      
      Due to hardware implementation, the flexible data is offset from the
      start of the packet payload, and thus may not be in part of the header
      data. For this reason, the offset provided by the user defined data is
      interpreted as a byte offset from the start of the matching payload.
      Previous implementations have tried to represent the offset as from the
      start of the frame, but this is not feasible because header sizes may
      change due to options.
      
      Change-Id: 36ed27995e97de63f9aea5ade5778ff038d6f811
      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>
      0e588de1
    • J
      i40e: add parsing of flexible filter fields from userdef · e793095e
      Jacob Keller 提交于
      Add code to parse the user-def field into a data structure format. This
      code is intended to allow future extensions of the user-def field by
      keeping all code that actually reads and writes the field into a single
      location. This ensures that we do not litter the driver with references
      to the user-def field and minimizes the amount of bitwise operations we
      need to do on the data.
      
      Add code which parses the lower 32bits into a flexible word and its
      offset. This will be used in a future patch to enable flexible filters
      which can match on some arbitrary data in the packet payload. For now,
      we just return -EOPNOTSUPP when this is used.
      
      Add code to fill in the user-def field when reporting the filter back,
      even though we don't actually implement any user-def fields yet.
      
      Additionally, ensure that we mask the extended FLOW_EXT bit from the
      flow_type now that we will be accepting filters which have the FLOW_EXT
      bit set (and thus make use of the user-def field).
      
      Change-Id: I238845035c179380a347baa8db8223304f5f6dd7
      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>
      e793095e
    • J
      i40e: partition the ring_cookie to get VF index · 43b15697
      Jacob Keller 提交于
      Do not use the user-def field for determining the VF target. Instead,
      similar to ixgbe, partition the ring_cookie value into 8bits of VF
      index, along with 32bits of queue number. This is better than using the
      user-def field, because it leaves the field open for extension in
      a future patch which will enable flexible data. Also, this matches with
      convention used by ixgbe and other drivers.
      
      Change-Id: Ie36745186d817216b12f0313b99ec95cb8a9130c
      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>
      43b15697
    • J
      i40e: allow changing input set for ntuple filters · 9229e993
      Jacob Keller 提交于
      Add support to detect when we can update the input set for each flow
      type.
      
      Because the hardware only supports a single input set for all flows of
      that matching type, the driver shall only allow the input set to change
      if there are no other configured filters for that flow type.
      
      Thus, the first filter added for each flow type is allowed to change the
      input set, and all future filters must match the same input set. Display
      a diagnostic message whenever the filter input set changes, and
      a warning whenever a filter cannot be accepted because it does not match
      the configured input set.
      
      Change-Id: Ic22e1c267ae37518bb036aca4a5694681449f283
      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>
      9229e993