aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2023-02-10 23:33:10 +0200
committerMichal Kubecek <mkubecek@suse.cz>2023-02-13 17:37:08 +0100
commitc4342291d8b5b03d1d80f6661066d66c2769c35c (patch)
treeaa366ec6601f903c9553c4ab3f0ab663320ff303
parent21810d54d28b4e21aa1e68dd5b577abc79f1a063 (diff)
downloadethtool-c4342291d8b5b03d1d80f6661066d66c2769c35c.tar.gz
netlink: pass the source of statistics for port stats
Use the ETHTOOL_STATS_SRC_AGGREGATE attribute for the following structured port groups, to allow looking at eMAC and pMAC counters individually: $ ethtool -S eno2 --groups eth-mac eth-phy eth-ctrl rmon -- --src pmac Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Pranavi Somisetty <pranavi.somisetty@amd.com>
-rw-r--r--netlink/stats.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/netlink/stats.c b/netlink/stats.c
index 9f609a4..8620d8d 100644
--- a/netlink/stats.c
+++ b/netlink/stats.c
@@ -268,6 +268,13 @@ err_free:
return ret;
}
+static const struct lookup_entry_u32 stats_src_values[] = {
+ { .arg = "aggregate", .val = ETHTOOL_MAC_STATS_SRC_AGGREGATE },
+ { .arg = "emac", .val = ETHTOOL_MAC_STATS_SRC_EMAC },
+ { .arg = "pmac", .val = ETHTOOL_MAC_STATS_SRC_PMAC },
+ {}
+};
+
static const struct param_parser stats_params[] = {
{
.arg = "--groups",
@@ -283,6 +290,13 @@ static const struct param_parser stats_params[] = {
.handler = stats_parse_all_groups,
.alt_group = 1,
},
+ {
+ .arg = "--src",
+ .type = ETHTOOL_A_STATS_SRC,
+ .handler = nl_parse_lookup_u32,
+ .handler_data = stats_src_values,
+ .min_argc = 1,
+ },
{}
};