1. 03 10月, 2017 1 次提交
  2. 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
  3. 22 9月, 2017 1 次提交
  4. 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
  5. 26 8月, 2017 6 次提交
  6. 26 7月, 2017 1 次提交
  7. 21 6月, 2017 1 次提交
    • J
      i40evf: assign num_active_queues inside i40evf_alloc_queues · 65c7006f
      Jacob Keller 提交于
      The variable num_active_queues represents the number of active queues we
      have for the device. We assign this pretty early in i40evf_init_subtask.
      
      Several code locations are written with loops over the tx_rings and
      rx_rings structures, which don't get allocated until
      i40evf_alloc_queues, and which get freed by i40evf_free_queues.
      
      These call sites were written under the assumption that tx_rings and
      rx_rings would always be allocated at least when num_active_queues is
      non-zero.
      
      Lets fix this by moving the assignment into the function where we
      allocate queues. We'll use a temporary variable for storage so that we
      don't assign the value in the adapter structure until after the rings
      have been set up.
      
      Finally, when we free the queues, we'll clear the value to ensure that
      we do not loop over the rings memory that no longer exists.
      
      This resolves a possible NULL pointer dereference in
      i40evf_get_ethtool_stats which could occur if the VF fails to recover
      from a reset, and then a user requests statistics.
      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>
      65c7006f
  8. 02 6月, 2017 3 次提交
    • P
      i40evf: Add support for Adaptive Virtual Function · abf709a1
      Preethi Banala 提交于
      Add device ID define and mac_type assignment needed for
      Adaptive Virtual Function (VF Base Mode Support).
      
      Also, update version to v3.0.0 in order to indicate
      clearly that this is the first driver supporting the AVF
      device ID.
      Signed-off-by: NPreethi Banala <preethi.banala@intel.com>
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      abf709a1
    • J
      virtchnl: finish conversion to virtchnl interface · ff3f4cc2
      Jesse Brandeburg 提交于
      This patch implements the complete version of the virtchnl.h file
      with final renames, and fixes the related code in i40e and i40evf.
      
      It also expands comments, and adds details on the usage of
      certain fields.
      
      In addition, due to the changes a couple of casts are needed
      to prevent errors found by sparse after renaming some fields.
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ff3f4cc2
    • J
      virtchnl: rename i40e to generic virtchnl · 310a2ad9
      Jesse Brandeburg 提交于
      This morphs all the i40e and i40evf references to/in virtchnl.h
      to be generic, using only automated methods. Updates all the
      callers to use the new names.  A followup patch provides separate
      clean ups for messy line conversions from these "automatic"
      changes, to make them more reviewable.
      
      Was executed with the following sed script:
      sed -i -f transform_script drivers/net/ethernet/intel/i40e/i40e_client.c
      sed -i -f transform_script drivers/net/ethernet/intel/i40e/i40e_prototype.h
      sed -i -f transform_script drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
      sed -i -f transform_script drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
      sed -i -f transform_script drivers/net/ethernet/intel/i40evf/i40e_common.c
      sed -i -f transform_script drivers/net/ethernet/intel/i40evf/i40e_prototype.h
      sed -i -f transform_script drivers/net/ethernet/intel/i40evf/i40evf.h
      sed -i -f transform_script drivers/net/ethernet/intel/i40evf/i40evf_client.c
      sed -i -f transform_script drivers/net/ethernet/intel/i40evf/i40evf_main.c
      sed -i -f transform_script drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
      sed -i -f transform_script include/linux/avf/virtchnl.h
      
      transform_script:
      ----8<----
      s/I40E_VIRTCHNL_SUPPORTED_QTYPES/SAVE_ME_SUPPORTED_QTYPES/g
      s/I40E_VIRTCHNL_VF_CAP/SAVE_ME_VF_CAP/g
      
      s/I40E_VIRTCHNL_/VIRTCHNL_/g
      s/i40e_virtchnl_/virtchnl_/g
      s/i40e_vfr_/virtchnl_vfr_/g
      s/I40E_VFR_/VIRTCHNL_VFR_/g
      
      s/VIRTCHNL_OP_ADD_ETHER_ADDRESS/VIRTCHNL_OP_ADD_ETH_ADDR/g
      s/VIRTCHNL_OP_DEL_ETHER_ADDRESS/VIRTCHNL_OP_DEL_ETH_ADDR/g
      s/VIRTCHNL_OP_FCOE/VIRTCHNL_OP_RSVD/g
      
      s/SAVE_ME_SUPPORTED_QTYPES/I40E_VIRTCHNL_SUPPORTED_QTYPES/g
      s/SAVE_ME_VF_CAP/I40E_VIRTCHNL_VF_CAP/g
      ----8<----
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      310a2ad9
  9. 30 4月, 2017 6 次提交
  10. 20 4月, 2017 2 次提交
    • S
      i40e/i40evf: Add tracepoints · ed0980c4
      Scott Peterson 提交于
      This patch adds tracepoints to the i40e and i40evf drivers to which
      BPF programs can be attached for feature testing and verification.
      It's expected that an attached BPF program will identify and count or
      log some interesting subset of traffic. The bcc-tools package is
      helpful there for containing all the BPF arcana in a handy Python
      wrapper. Though you can make these tracepoints log trace messages, the
      messages themselves probably won't be very useful (other to verify the
      tracepoint is being called while you're debugging your BPF program).
      
      The idea here is that tracepoints have such low performance cost when
      disabled that we can leave these in the upstream drivers. This may
      eventually enable the instrumentation of unmodified customer systems
      should the need arise to verify a NIC feature is working as expected.
      In general this enables one set of feature verification tools to be
      used on these drivers whether they're built with the kernel or
      separately.
      
      Users are advised against using these tracepoints for anything other
      than a diagnostic tool. They have a performance impact when enabled,
      and their exact placement and form may change as we see how well they
      work in practice for the purposes above.
      
      Change-ID: Id6014a7322c0e6d08068114dd20bd156f2f6435e
      Signed-off-by: NScott Peterson <scott.d.peterson@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ed0980c4
    • T
      i40evf: Use net_device_stats from struct net_device · 4a0a3abf
      Tobias Klauser 提交于
      Instead of using a private copy of struct net_device_stats in
      struct i40evf_adapter, use stats from struct net_device. Also remove the
      now unnecessary .ndo_get_stats function.
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4a0a3abf
  11. 08 4月, 2017 2 次提交
  12. 07 4月, 2017 1 次提交
  13. 29 3月, 2017 1 次提交
  14. 15 3月, 2017 2 次提交
  15. 19 2月, 2017 2 次提交
  16. 12 2月, 2017 2 次提交
  17. 03 2月, 2017 1 次提交
  18. 07 12月, 2016 1 次提交
  19. 03 12月, 2016 2 次提交