• 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
i40evf_ethtool.c 23.7 KB