• Jacob Keller's avatar
    i40e: convert VEB TC stats to use an i40e_stats array · 1510ae0b
    Jacob Keller authored
    The VEB TC stats are currently implemented with separate parsing,
    instead of using the i40e_stats array and associated helper functions.
    This is likely because the stats rely on embedding the TC number into
    the stat name.
    
    Update i40e_add_stat_strings to take variadic arguments, and use these
    to vsnprintf the i40e_stats string as a string containing format
    specifiers.
    
    Create a stats array for the VEB TC related stats,
    i40e_gstrings_veb_tc_stats, and use this along with the helper functions
    to remove the specialized boiler plate code.
    
    Always call i40e_add_ethtool_stats for both this array and the general
    VEB stats array. This ensures that we zero out any memory in case it was
    not zero-allocated for us.
    
    This ultimately results in less boiler plate code for the
    i40e_get_stat_strings and i40e_get_ethtool_stats.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    1510ae0b
i40e_ethtool.c 147 KB