ethtool: provide channel counts with CHANNELS_GET request
authorMichal Kubecek <mkubecek@suse.cz>
Thu, 12 Mar 2020 20:08:38 +0000 (21:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 22:32:33 +0000 (15:32 -0700)
commit0c84979c951a85fcb5c77ac2480fd476e283a07c
tree83256438a6a5aeb2658d6e52b9b154fd1785e741
parentbc9d1c995ecb8cccaac8ead2ed570544c2c885eb
ethtool: provide channel counts with CHANNELS_GET request

Implement CHANNELS_GET request to get channel counts of a network device.
These are traditionally available via ETHTOOL_GCHANNELS ioctl request.

Omit attributes for channel types which are not supported by driver or
device (zero reported for maximum).

v2: (all suggested by Jakub Kicinski)
  - minor cleanup in channels_prepare_data()
  - more descriptive channels_reply_size()
  - omit attributes with zero max count

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/ethtool-netlink.rst
include/uapi/linux/ethtool_netlink.h
net/ethtool/Makefile
net/ethtool/channels.c [new file with mode: 0644]
net/ethtool/netlink.c
net/ethtool/netlink.h