1. 28 8月, 2017 1 次提交
    • 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
  2. 26 8月, 2017 6 次提交
  3. 26 7月, 2017 1 次提交
  4. 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
  5. 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
  6. 30 4月, 2017 6 次提交
  7. 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
  8. 08 4月, 2017 2 次提交
  9. 07 4月, 2017 1 次提交
  10. 29 3月, 2017 1 次提交
  11. 15 3月, 2017 2 次提交
  12. 19 2月, 2017 2 次提交
  13. 12 2月, 2017 2 次提交
  14. 03 2月, 2017 1 次提交
  15. 07 12月, 2016 1 次提交
  16. 03 12月, 2016 4 次提交
  17. 01 11月, 2016 1 次提交
  18. 29 10月, 2016 3 次提交