OSDN Git Service

ethtool: specify which header flags are supported per command
authorJakub Kicinski <kuba@kernel.org>
Mon, 5 Oct 2020 22:07:39 +0000 (15:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Oct 2020 13:25:55 +0000 (06:25 -0700)
commita0de1cd3568749d3410c89b1c8bb70e90d61659f
tree09c011ae2e2e53713b8d3ee0e531fdfa4dbf29bd
parentbdbb4e29df8b790db50cb73ce25d23543329f05f
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>
net/ethtool/netlink.c
net/ethtool/netlink.h
net/ethtool/pause.c