1. 15 3月, 2018 1 次提交
  2. 27 2月, 2018 2 次提交
  3. 15 2月, 2018 5 次提交
  4. 14 2月, 2018 2 次提交
  5. 13 2月, 2018 4 次提交
    • A
      i40e/i40evf: Add support for new mechanism of updating adaptive ITR · a0073a4b
      Alexander Duyck 提交于
      This patch replaces the existing mechanism for determining the correct
      value to program for adaptive ITR with yet another new and more
      complicated approach.
      
      The basic idea from a 30K foot view is that this new approach will push the
      Rx interrupt moderation up so that by default it starts in low latency and
      is gradually pushed up into a higher latency setup as long as doing so
      increases the number of packets processed, if the number of packets drops
      to 4 to 1 per packet we will reset and just base our ITR on the size of the
      packets being received. For Tx we leave it floating at a high interrupt
      delay and do not pull it down unless we start processing more than 112
      packets per interrupt. If we start exceeding that we will cut our interrupt
      rates in half until we are back below 112.
      
      The side effect of these patches are that we will be processing more
      packets per interrupt. This is both a good and a bad thing as it means we
      will not be blocking processing in the case of things like pktgen and XDP,
      but we will also be consuming a bit more CPU in the cases of things such as
      network throughput tests using netperf.
      
      One delta from this versus the ixgbe version of the changes is that I have
      made the interrupt moderation a bit more aggressive when we are in bulk
      mode by moving our "goldilocks zone" up from 48 to 96 to 56 to 112. The
      main motivation behind moving this is to address the fact that we need to
      update less frequently, and have more fine grained control due to the
      separate Tx and Rx ITR times.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a0073a4b
    • A
      i40e/i40evf: Split container ITR into current_itr and target_itr · 556fdfd6
      Alexander Duyck 提交于
      This patch is mostly prep-work for replacing the current approach to
      programming the dynamic aka adaptive ITR. Specifically here what we are
      doing is splitting the Tx and Rx ITR each into two separate values.
      
      The first value current_itr represents the current value of the register.
      
      The second value target_itr represents the desired value of the register.
      
      The general plan by doing this is to allow for deferring the update of the
      ITR value under certain circumstances. For now we will work with what we
      have, but in the future I hope to change the behavior so that we always
      only update one ITR at a time using some simple logic to determine which
      ITR requires an update.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      556fdfd6
    • A
      i40e/i40evf: Clean-up of bits related to using q_vector->reg_idx · 8b99b117
      Alexander Duyck 提交于
      This patch is a further clean-up related to the change over to using
      q_vector->reg_idx when accessing the ITR registers. Specifically the code
      appears to have several other spots where we were computing the register
      offset manually and this resulted in errors in a few spots.
      
      Specifically in the i40evf functions for mapping queues to vectors it
      appears we may have had an off by 1 error since (v_idx - 1) for the first
      q_vector with an index of 0 would result in us returning -1 if I am not
      mistaken.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      8b99b117
    • A
      i40e/i40evf: Only track one ITR setting per ring instead of Tx/Rx · 40588ca6
      Alexander Duyck 提交于
      The rings are already split out into Tx and Rx rings so it doesn't make
      sense to have any single ring store both a Tx and Rx itr_setting value.
      Since that is the case drop the pair in favor of storing just a single ITR
      value.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      40588ca6
  6. 27 1月, 2018 2 次提交
  7. 24 1月, 2018 3 次提交
  8. 11 1月, 2018 7 次提交
  9. 22 11月, 2017 1 次提交
    • A
      i40evf: fix client notify of l2 params · 01acc73f
      Alan Brady 提交于
      The current method for notifying clients of l2 parameters is broken
      because we fail to copy the new parameters to the client instance
      struct, we need to do the notification before the client 'open' function
      pointer gets called, and lastly we should set the l2 parameters when
      first adding a client instance.
      
      This patch first introduces the i40evf_client_get_params function to
      prevent code duplication in the i40evf_client_add_instance and the
      i40evf_notify_client_l2_params functions.  We then fix the notify l2
      params function to actually copy the parameters to client instance
      struct and do the same in the *_add_instance' function.  Lastly this
      patch reorganizes the priority in which client tasks fire so that if the
      flag for notifying l2 params is set, it will trigger before the open
      because the client needs these new parameters as part of a client open
      task.
      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>
      01acc73f
  10. 18 10月, 2017 1 次提交
  11. 10 10月, 2017 2 次提交
    • J
      i40e/i40evf: fix incorrect default ITR values on driver load · 42702559
      Jacob Keller 提交于
      The ITR register expects to be programmed in units of 2 microseconds.
      Because of this, all of the drivers I40E_ITR_* constants are in terms of
      this 2 microsecond register.
      
      Unfortunately, the rx_itr_default value is expected to be programmed in
      microseconds.
      
      Effectively the driver defaults to an ITR value of half the expected
      value (in terms of minimum microseconds between interrupts).
      
      Fix this by changing the default values to be calculated using
      ITR_REG_TO_USEC macro which indicates that we're converting from the
      register units into microseconds.
      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>
      42702559
    • A
      i40evf: fix mac filter removal timing issue · c766b9af
      Alan Brady 提交于
      Due to the asynchronous nature in which mac filters are added and
      deleted, there exists a bug in which filters are erroneously removed if
      removed then added again quickly.
      
      The events are as such:
          - filter marked for removal
          - same filter is re-added before watchdog that cleans up filters
          - we skip re-adding the filter because we have it already in the
      list
          - watchdog filter cleanup kicks off and filter is removed
      
      So when we were re-adding the same filter, it didn't actually get added
      because it already existed in the list, but was marked for removal and
      had yet to actually be removed.
      
      This patch fixes the issue by making sure that when adding a filter, if
      we find it already existing in our list, make sure it is not marked to
      be removed.
      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>
      c766b9af
  12. 06 10月, 2017 2 次提交
    • J
      i40evf: enable support for VF VLAN tag stripping control · 0a3b4f70
      Jacob Keller 提交于
      A recent commit 809481484e5d ("i40e/i40evf: support for VF VLAN tag
      stripping control") added support for VFs to negotiate the control of
      VLAN tag stripping. This should have allowed VFs to disable the feature.
      Unfortunately, the flag was set only in netdev->feature flags and not in
      netdev->hw_features.
      
      This ultimately causes the stack to assume that it cannot change the
      flag, so it was unchangeable and marked as [fixed] in the ethtool -k
      output.
      
      Fix this by setting the feature in hw_features first, just as we do for
      the PF code. This enables ethtool -K to disable the feature correctly,
      and fully enables user control of the VLAN tag stripping feature.
      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>
      0a3b4f70
    • J
      i40e/i40evf: spread CPU affinity hints across online CPUs only · be664cbe
      Jacob Keller 提交于
      Currently, when setting up the IRQ for a q_vector, we set an affinity
      hint based on the v_idx of that q_vector. Meaning a loop iterates on
      v_idx, which is an incremental value, and the cpumask is created based
      on this value.
      
      This is a problem in systems with multiple logical CPUs per core (like in
      simultaneous multithreading (SMT) scenarios). If we disable some logical
      CPUs, by turning SMT off for example, we will end up with a sparse
      cpu_online_mask, i.e., only the first CPU in a core is online, and
      incremental filling in q_vector cpumask might lead to multiple offline
      CPUs being assigned to q_vectors.
      
      Example: if we have a system with 8 cores each one containing 8 logical
      CPUs (SMT == 8 in this case), we have 64 CPUs in total. But if SMT is
      disabled, only the 1st CPU in each core remains online, so the
      cpu_online_mask in this case would have only 8 bits set, in a sparse way.
      
      In general case, when SMT is off the cpu_online_mask has only C bits set:
      0, 1*N, 2*N, ..., C*(N-1)  where
      C == # of cores;
      N == # of logical CPUs per core.
      In our example, only bits 0, 8, 16, 24, 32, 40, 48, 56 would be set.
      
      Instead, we should only assign hints for CPUs which are online. Even
      better, the kernel already provides a function, cpumask_local_spread()
      which takes an index and returns a CPU, spreading the interrupts across
      local NUMA nodes first, and then remote ones if necessary.
      
      Since we generally have a 1:1 mapping between vectors and CPUs, there
      is no real advantage to spreading vectors to local CPUs first. In order
      to avoid mismatch of the default XPS hints, we'll pass -1 so that it
      spreads across all CPUs without regard to the node locality.
      
      Note that we don't need to change the q_vector->affinity_mask as this is
      initialized to cpu_possible_mask, until an actual affinity is set and
      then notified back to us.
      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>
      be664cbe
  13. 03 10月, 2017 2 次提交
  14. 30 9月, 2017 2 次提交
    • A
      i40evf: fix ring to vector mapping · c97fc9b6
      Alan Brady 提交于
      The current implementation for mapping queues to vectors is broken
      because it attempts to map each Tx and Rx ring to its own vector,
      however we use combined queues so we should actually be mapping the
      Tx/Rx rings together on one vector.
      
      Also in the current implementation, in the case where we have more
      queues than vectors, we attempt to group the queues together into
      'chunks' and map each 'chunk' of queues to a vector.  Chunking them
      together would be more ideal if, and only if, we only had RSS because of
      the way the hashing algorithm works but in the case of a future patch
      that enables VF ADq, round robin assignment is better and still works
      with RSS.
      
      This patch resolves both those issues and simplifies the code needed to
      accomplish this.  Instead of treating the case where we have more queues
      than vectors as special, if we notice our vector index is greater than
      vectors, reset the vector index to zero and continue mapping.  This
      should ensure that in both cases, whether we have enough vectors for
      each queue or not, the queues get appropriately mapped.
      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>
      c97fc9b6
    • J
      i40e: shutdown all IRQs and disable MSI-X when suspended · b980c063
      Jacob Keller 提交于
      On some platforms with a large number of CPUs, we will allocate many IRQ
      vectors. When hibernating, the system will attempt to migrate all of the
      vectors back to CPU0 when shutting down all the other CPUs. It is
      possible that we have so many vectors that it cannot re-assign them to
      CPU0. This is even more likely if we have many devices installed in one
      platform.
      
      The end result is failure to hibernate, as it is not possible to
      shutdown the CPUs. We can avoid this by disabling MSI-X and clearing our
      interrupt scheme when the device is suspended. A more ideal solution
      would be some method for the stack to properly handle this for all
      drivers, rather than on a case-by-case basis for each driver to fix
      itself.
      
      However, until this more ideal solution exists, we can do our part and
      shutdown our IRQs during suspend, which should allow systems with
      a large number of CPUs to safely suspend or hibernate.
      
      It may be worth investigating if we should shut down even further when
      we suspend as it may make the path cleaner, but this was the minimum fix
      for the hibernation issue mentioned here.
      
      Testing-hints:
        This affects systems with a large number of CPUs, and with multiple
        devices enabled. Without this change, those platforms are unable to
        hibernate at all.
      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>
      b980c063
  15. 22 9月, 2017 1 次提交
  16. 28 8月, 2017 3 次提交
    • J
      i40e: initialize our affinity_mask based on cpu_possible_mask · 759dc4a7
      Jacob Keller 提交于
      On older kernels a call to irq_set_affinity_hint does not guarantee that
      the IRQ affinity will be set. If nothing else on the system sets the IRQ
      affinity this can result in a bug in the i40e_napi_poll() routine where
      we notice that our interrupt fired on the "wrong" CPU according to our
      internal affinity_mask variable.
      
      This results in a bug where we continuously tell NAPI to stop polling to
      move the interrupt to a new CPU, but the CPU never changes because our
      affinity mask does not match the actual mask setup for the IRQ.
      
      The root problem is a mismatched affinity mask value. So lets initialize
      the value to cpu_possible_mask instead. This ensures that prior to the
      first time we get an IRQ affinity notification we'll have the mask set
      to include every possible CPU.
      
      We use cpu_possible_mask instead of cpu_online_mask since the former is
      almost certainly never going to change, while the later might change
      after we've made a copy.
      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>
      759dc4a7
    • M
      i40e/i40evf: support for VF VLAN tag stripping control · 8774370d
      Mariusz Stachura 提交于
      This patch gives VF capability to control VLAN tag stripping via
      ethtool. As rx-vlan-offload was fixed before, now the VF is able to
      change it using "ethtool --offload <IF> rxvlan on/off" settings.
      Signed-off-by: NMariusz Stachura <mariusz.stachura@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      8774370d
    • J
      i40evf: fix possible snprintf truncation of q_vector->name · 696ac80a
      Jacob Keller 提交于
      The q_vector names are based on the interface name with a driver prefix,
      the type of q_vector setup, and the queue number. We previously set the
      size of this variable to IFNAMSIZ + 9, which is incorrect, because we
      actually include a minimum of 14 characters extra beyond the interface
      name size.
      
      New versions of GCC since 7 include a new warning that detects this
      possible truncation and complains. We can fix this by increasing the
      size in case our interface name is too large to avoid truncation. We
      don't need to go beyond 14 because the compiler is smart enough to
      realize our values can never exceed size of 1. We do go up to 15 here
      because possible future changes may increase the number of queues beyond
      one digit.
      
      While we are here, also change some variables to be unsigned (since they
      are never negative) and stop using an extra unnecessary %s format
      specifier.
      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>
      696ac80a