diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-10-06 00:07:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-06 15:25:55 +0200 |
commit | 329d9c333ee4a904341d555b72cd6218f4104d53 (patch) | |
tree | 21ad16925587cc34e707ba4f7585919f193f8ba9 /net/ethtool/channels.c | |
parent | ethtool: trim policy tables (diff) | |
download | linux-329d9c333ee4a904341d555b72cd6218f4104d53.tar.xz linux-329d9c333ee4a904341d555b72cd6218f4104d53.zip |
ethtool: link up ethnl_header_policy as a nested policy
To get the most out of parsing by the core, and to allow dumping
full policies we need to specify which policy applies to nested
attrs. For headers it's ethnl_header_policy.
$ sed -i 's@\(ETHTOOL_A_.*HEADER\].*=\) { .type = NLA_NESTED },@\1\n\t\tNLA_POLICY_NESTED(ethnl_header_policy),@' net/ethtool/*
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/channels.c')
-rw-r--r-- | net/ethtool/channels.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ethtool/channels.c b/net/ethtool/channels.c index 2a0cea0ad648..5635604cb9ba 100644 --- a/net/ethtool/channels.c +++ b/net/ethtool/channels.c @@ -18,7 +18,8 @@ struct channels_reply_data { container_of(__reply_base, struct channels_reply_data, base) const struct nla_policy ethnl_channels_get_policy[] = { - [ETHTOOL_A_CHANNELS_HEADER] = { .type = NLA_NESTED }, + [ETHTOOL_A_CHANNELS_HEADER] = + NLA_POLICY_NESTED(ethnl_header_policy), }; static int channels_prepare_data(const struct ethnl_req_info *req_base, @@ -100,7 +101,8 @@ const struct ethnl_request_ops ethnl_channels_request_ops = { /* CHANNELS_SET */ const struct nla_policy ethnl_channels_set_policy[] = { - [ETHTOOL_A_CHANNELS_HEADER] = { .type = NLA_NESTED }, + [ETHTOOL_A_CHANNELS_HEADER] = + NLA_POLICY_NESTED(ethnl_header_policy), [ETHTOOL_A_CHANNELS_RX_COUNT] = { .type = NLA_U32 }, [ETHTOOL_A_CHANNELS_TX_COUNT] = { .type = NLA_U32 }, [ETHTOOL_A_CHANNELS_OTHER_COUNT] = { .type = NLA_U32 }, |