]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: add ethnl_parse_bitset() helper
authorMichal Kubecek <mkubecek@suse.cz>
Thu, 12 Mar 2020 20:07:53 +0000 (21:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 22:32:32 +0000 (15:32 -0700)
commit42ffb8b9cb5ca1d3c032dc95e9481b8684dd4334
tree8857cf131cdaf9990495ec4010d240da360df15b
parentd4da9888b86f2d79a1d9f1d8e01465f3e5265f77
ethtool: add ethnl_parse_bitset() helper

Unlike other SET type commands, modifying netdev features is required to
provide a reply telling userspace what was actually changed, compared to
what was requested. For that purpose, the "modified" flag provided by
ethnl_update_bitset() is not sufficient, we need full information which
bits were requested to change.

Therefore provide ethnl_parse_bitset() returning effective value and mask
bitmaps equivalent to the contents of a bitset nested attribute.

v2: use non-atomic __set_bit() (suggested by David Miller)

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/bitset.c
net/ethtool/bitset.h