aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2018-07-31 03:41:42 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-08-07 08:19:09 -0700
commitf25848d4cdf2c5db5c506ca6553c79f97db19975 (patch)
treea8e50dd2cff3499dfd6237a1d16af5e17eba2c70 /drivers/net/vxlan.c
parenti40e: convert VEB TC stats to use an i40e_stats array (diff)
downloadlinux-dev-f25848d4cdf2c5db5c506ca6553c79f97db19975.tar.xz
linux-dev-f25848d4cdf2c5db5c506ca6553c79f97db19975.zip
i40e: convert priority flow control stats to use helpers
The priority flow control statistics are laid out in the stats structure using arrays. This made it unwieldy to use as part of an i40e_stats array. Add a new structure type, i40e_pfc_stats, and a helper function i40e_get_pfc_stats which can return the stats for a given priority value as an i40e_pfc_stats structure. Use this to create an i40e_stats array, which we'll use to format and copy the strings and stats into the supplied buffers. This reduces even more boiler plate code in i40e_get_ethtool_stats and i40e_get_stat_strings. An alternative would be to modify the structure definition for the pfc stats, but this is more invasive to the rest of the code base. Note that a macro was used to setup the copy of stats from the pf->stats, as this reduces the chance of typos in the code names. It will produce a checkpatch.pl warning due to re-use of a macro argument. In this case, it should be safe, as the macro will fail to compile in cases where the argument is not a simple structure member name, and thus arguments with side effects should not be an issue. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/vxlan.c')
0 files changed, 0 insertions, 0 deletions