diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2018-07-31 03:41:42 -0700 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-08-07 08:19:09 -0700 |
commit | f25848d4cdf2c5db5c506ca6553c79f97db19975 (patch) | |
tree | a8e50dd2cff3499dfd6237a1d16af5e17eba2c70 /fs/pipe.c | |
parent | 1510ae0be2a4d4630823752235c41f8a0e06f37a (diff) | |
download | linux-f25848d4cdf2c5db5c506ca6553c79f97db19975.tar.bz2 |
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 'fs/pipe.c')
0 files changed, 0 insertions, 0 deletions