Subject: Re: [PATCH v2 net-next 04/12] net: ethtool: netlink: retrieve stats from multiple sources (eMAC, pMAC)

From: Jakub Kicinski <[email-masked]>
Date: Tue, 17 Jan 2023 10:54:44 -0800

On Mon, 16 Jan 2023 19:42:34 +0200 Vladimir Oltean wrote:
> 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?

Sorry for the delay, I was out for $national-holiday.

This would be right, but it seems like you went for the other option 
in v3, which is also fine.