[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230210213311.218456-4-vladimir.oltean@nxp.com>
Date: Fri, 10 Feb 2023 23:33:10 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: Michal Kubecek <mkubecek@...e.cz>,
Pranavi Somisetty <pranavi.somisetty@....com>,
Piergiorgio Beruto <piergiorgio.beruto@...il.com>
Subject: [PATCH v3 ethtool 3/4] 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@....com>
Reviewed-by: Pranavi Somisetty <pranavi.somisetty@....com>
---
v2->v3: none
v1->v2:
- ETHTOOL_STATS_SRC* macro names changed to ETHTOOL_MAC_STATS_SRC*
netlink/stats.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/netlink/stats.c b/netlink/stats.c
index 9f609a4ec550..8620d8de1555 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,
+ },
{}
};
--
2.34.1
Powered by blists - more mailing lists