From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Michal Kubecek <mkubecek@suse.cz>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
Kurt Kanzenbach <kurt@linutronix.de>,
Rui Sousa <rui.sousa@nxp.com>,
Ferenc Fejes <ferenc.fejes@ericsson.com>,
Pranavi Somisetty <pranavi.somisetty@amd.com>,
Harini Katakam <harini.katakam@amd.com>,
Colin Foster <colin.foster@in-advantage.com>,
UNGLinuxDriver@microchip.com,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH v2 net-next 04/12] net: ethtool: netlink: retrieve stats from multiple sources (eMAC, pMAC)
Date: Mon, 16 Jan 2023 19:42:34 +0200 [thread overview]
Message-ID: <20230116174234.yzq6cnczs6fxww6q@skbuf> (raw)
In-Reply-To: <20230114232214.tj6bsfhmhfg3zjxw@skbuf>
On Sun, Jan 15, 2023 at 01:22:14AM +0200, Vladimir Oltean wrote:
> On Fri, Jan 13, 2023 at 08:43:36PM -0800, Jakub Kicinski wrote:
> > On Wed, 11 Jan 2023 18:16:58 +0200 Vladimir Oltean wrote:
> > > +/**
> > > + * enum ethtool_stats_src - source of ethtool statistics
> > > + * @ETHTOOL_STATS_SRC_AGGREGATE:
> > > + * if device supports a MAC merge layer, this retrieves the aggregate
> > > + * statistics of the eMAC and pMAC. Otherwise, it retrieves just the
> > > + * statistics of the single (express) MAC.
> > > + * @ETHTOOL_STATS_SRC_EMAC:
> > > + * if device supports a MM layer, this retrieves the eMAC statistics.
> > > + * Otherwise, it retrieves the statistics of the single (express) MAC.
> > > + * @ETHTOOL_STATS_SRC_PMAC:
> > > + * if device supports a MM layer, this retrieves the pMAC statistics.
> > > + */
> > > +enum ethtool_stats_src {
> > > + ETHTOOL_STATS_SRC_AGGREGATE,
> > > + ETHTOOL_STATS_SRC_EMAC,
> > > + ETHTOOL_STATS_SRC_PMAC,
> > > +};
> >
> > Should we somehow call it "MAC stats"?
> >
> > Right now its named like a generic attribute, but it's not part of
> > the header nest (ETHTOOL_A_HEADER_*).
> >
> > I'm not sure myself which way is better, but feels like either it
> > should be generic, in the header nest, and parsed by the common code;
> > or named more specifically and stay in the per-cmd attrs.
>
> Considering that I currently have separate netlink attributes for
> ETHTOOL_MSG_STATS_GET (ETHTOOL_A_STATS_SRC) and for
> ETHTOOL_MSG_PAUSE_GET (ETHTOOL_A_PAUSE_STATS_SRC), I'm going to add just
> a single attribute right under ETHTOOL_A_HEADER_FLAGS for v3 and go from
> there. Is it ok if I keep naming it ETHTOOL_A_STATS_SRC, or would you
> prefer something else?
I'm already lost while trying to implement this change request.
ETHTOOL_A_STATS_HEADER uses NLA_POLICY_NESTED(ethnl_header_policy),
while ETHTOOL_A_PAUSE_HEADER uses NLA_POLICY_NESTED(ethnl_header_policy_stats).
The two header nest policies look like this:
const struct nla_policy ethnl_header_policy[] = {
[ETHTOOL_A_HEADER_DEV_INDEX] = { .type = NLA_U32 },
[ETHTOOL_A_HEADER_DEV_NAME] = { .type = NLA_NUL_STRING,
.len = ALTIFNAMSIZ - 1 },
[ETHTOOL_A_HEADER_FLAGS] = NLA_POLICY_MASK(NLA_U32,
ETHTOOL_FLAGS_BASIC),
};
const struct nla_policy ethnl_header_policy_stats[] = {
[ETHTOOL_A_HEADER_DEV_INDEX] = { .type = NLA_U32 },
[ETHTOOL_A_HEADER_DEV_NAME] = { .type = NLA_NUL_STRING,
.len = ALTIFNAMSIZ - 1 },
[ETHTOOL_A_HEADER_FLAGS] = NLA_POLICY_MASK(NLA_U32,
ETHTOOL_FLAGS_STATS),
};
The request seems to be for ETHTOOL_A_PAUSE_HEADER to use a policy like this:
const struct nla_policy ethnl_header_policy_mac_stats[] = {
[ETHTOOL_A_HEADER_DEV_INDEX] = { .type = NLA_U32 },
[ETHTOOL_A_HEADER_DEV_NAME] = { .type = NLA_NUL_STRING,
.len = ALTIFNAMSIZ - 1 },
[ETHTOOL_A_HEADER_FLAGS] = NLA_POLICY_MASK(NLA_U32,
ETHTOOL_FLAGS_STATS),
+ [ETHTOOL_A_HEADER_MAC_STATS_SRC] = NLA_POLICY_MASK(NLA_U32,
+ ETHTOOL_MAC_STATS_SRC_PMAC),
};
and for ETHTOOL_A_STATS_HEADER to use a policy like this:
const struct nla_policy ethnl_header_policy_mac_stats_src_basic[] = {
[ETHTOOL_A_HEADER_DEV_INDEX] = { .type = NLA_U32 },
[ETHTOOL_A_HEADER_DEV_NAME] = { .type = NLA_NUL_STRING,
.len = ALTIFNAMSIZ - 1 },
[ETHTOOL_A_HEADER_FLAGS] = NLA_POLICY_MASK(NLA_U32,
ETHTOOL_FLAGS_BASIC),
+ [ETHTOOL_A_HEADER_MAC_STATS_SRC] = NLA_POLICY_MASK(NLA_U32,
+ ETHTOOL_MAC_STATS_SRC_PMAC),
};
Did I get this right?
next prev parent reply other threads:[~2023-01-16 17:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 16:16 [PATCH v2 net-next 00/12] ethtool support for IEEE 802.3 MAC Merge layer Vladimir Oltean
2023-01-11 16:16 ` [PATCH v2 net-next 01/12] net: ethtool: netlink: introduce ethnl_update_bool() Vladimir Oltean
2023-01-11 16:16 ` [PATCH v2 net-next 02/12] net: ethtool: add support for MAC Merge layer Vladimir Oltean
2023-01-13 6:27 ` Jakub Kicinski
2023-01-16 9:02 ` Somisetty, Pranavi
2023-01-16 12:17 ` Vladimir Oltean
2023-01-11 16:16 ` [PATCH v2 net-next 03/12] docs: ethtool-netlink: document interface " Vladimir Oltean
2023-01-13 6:18 ` Jakub Kicinski
2023-01-11 16:16 ` [PATCH v2 net-next 04/12] net: ethtool: netlink: retrieve stats from multiple sources (eMAC, pMAC) Vladimir Oltean
2023-01-14 4:22 ` Jakub Kicinski
2023-01-14 4:43 ` Jakub Kicinski
2023-01-14 23:22 ` Vladimir Oltean
2023-01-16 17:42 ` Vladimir Oltean [this message]
2023-01-17 18:54 ` Jakub Kicinski
2023-01-11 16:16 ` [PATCH v2 net-next 05/12] docs: ethtool: document ETHTOOL_A_STATS_SRC and ETHTOOL_A_PAUSE_STATS_SRC Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 06/12] net: ethtool: add helpers for aggregate statistics Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 07/12] net: ethtool: add helpers for MM addFragSize translation Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 08/12] net: dsa: add plumbing for changing and getting MAC merge layer state Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 09/12] net: mscc: ocelot: allow ocelot_stat_layout elements with no name Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 10/12] net: mscc: ocelot: hide access to ocelot_stats_layout behind a helper Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 11/12] net: mscc: ocelot: export ethtool MAC Merge stats for Felix VSC9959 Vladimir Oltean
2023-01-11 16:17 ` [PATCH v2 net-next 12/12] net: mscc: ocelot: add MAC Merge layer support for VSC9959 Vladimir Oltean
2023-01-12 11:29 ` [PATCH v2 net-next 00/12] ethtool support for IEEE 802.3 MAC Merge layer Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230116174234.yzq6cnczs6fxww6q@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=colin.foster@in-advantage.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=ferenc.fejes@ericsson.com \
--cc=harini.katakam@amd.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pranavi.somisetty@amd.com \
--cc=rui.sousa@nxp.com \
--cc=vinicius.gomes@intel.com \
--cc=xiaoliang.yang_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox