1. 31 8月, 2018 3 次提交
    • J
      i40evf: update ethtool stats code and use helper functions · 6dba41cd
      Jacob Keller 提交于
      Fix a bug in the way we handled VF queues, by always showing stats for
      the maximum number of queues, even if they aren't allocated. It is not
      safe to change the number of strings reported to ethtool, as grabbing
      statistics occurs over multiple ethtool ops for which the rtnl_lock()
      cannot be held the entire time.
      
      Avoid this by always reporting queue stats for the maximum number of
      queues in the netdevice. Share some of the helper functionality for
      adding stats with the PF code in i40e_ethtool_stats.h
      
      This should reduce the chance of potential future bugs, and make adding
      new statistics easier.
      
      Note for the queue stats, unlike the PF driver we do not keep an array
      of queue pointers, but an array of queues, so care must be taken to
      avoid accessing queue memory that hasn't yet been allocated.
      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>
      6dba41cd
    • J
      i40e: move ethtool stats boiler plate code to i40e_ethtool_stats.h · 8fd75c58
      Jacob Keller 提交于
      Move the boiler plate structures and helper functions we recently
      added into their own header file, so that the complete collection is
      located together.
      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>
      8fd75c58
    • J
      i40e: convert queue stats to i40e_stats array · 4b59938b
      Jacob Keller 提交于
      Use an i40e_stats array to handle the queue stats, instead of coding
      similar functionality separately. Because of how the queue stats are
      accessed on some kernels, we can't easily use i40e_add_ethtool_stats.
      
      Instead, implement a separate helper, i40e_add_queue_stats, which we'll
      use instead. This helper will correctly implement the
      u64_stats_fetch_begin_irq logic and allow retries until successful. We
      share the most complex code by re-using i40e_add_one_ethtool_stat.
      
      This logic additionally easily supports skipping disabled rings by using
      a ternary operator before calling the u64_stats_fetch_begin_irq()
      function, so that we correctly zero-out the stats values without having
      to perform two separate sections of code.
      
      This significantly reduces the boiler plate code in
      i40e_get_ethtool_stats, and helps keep the complex logic contained to as
      few functions as possible.
      
      With this patch, we've finally converted all the statistics to use the
      helpers and the i40e_stats function.
      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>
      4b59938b
  2. 30 8月, 2018 20 次提交
  3. 29 8月, 2018 17 次提交