summaryrefslogtreecommitdiffstats
path: root/net/ethtool/pause.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-10-05 15:07:39 -0700
committerDavid S. Miller <davem@davemloft.net>2020-10-06 06:25:55 -0700
commita0de1cd3568749d3410c89b1c8bb70e90d61659f (patch)
tree09c011ae2e2e53713b8d3ee0e531fdfa4dbf29bd /net/ethtool/pause.c
parentbdbb4e29df8b790db50cb73ce25d23543329f05f (diff)
ethtool: specify which header flags are supported per command
Perform header flags validation through the policy. Only pause command supports ETHTOOL_FLAG_STATS. Create a separate policy to be able to express that in policy dumps to user space. Note that even though the core will validate the header policy, it cannot record multiple layers of attributes and we have to re-parse header sub-attrs. When doing so we could skip attribute validation, or use most permissive policy. Opt for the former. We will no longer return the extack cookie for flags but since we only added first new flag in this release it's not expected that any user space had a chance to make use of it. v2: - remove the re-validation in ethnl_parse_header_dev_get() Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/pause.c')
-rw-r--r--net/ethtool/pause.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c
index bf4013afd8b2..09998dc5c185 100644
--- a/net/ethtool/pause.c
+++ b/net/ethtool/pause.c
@@ -18,7 +18,7 @@ struct pause_reply_data {
const struct nla_policy ethnl_pause_get_policy[] = {
[ETHTOOL_A_PAUSE_HEADER] =
- NLA_POLICY_NESTED(ethnl_header_policy),
+ NLA_POLICY_NESTED(ethnl_header_policy_stats),
};
static void ethtool_stats_init(u64 *stats, unsigned int n)