ethtool: provide ring sizes with RINGS_GET request
authorMichal Kubecek <mkubecek@suse.cz>
Thu, 12 Mar 2020 20:08:23 +0000 (21:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 22:32:33 +0000 (15:32 -0700)
commite4a1717b677c5cb285e9b425c569e261084a484c
treee7b3079c31cba72878b784557188d6dc3eb82db2
parent111dcba3c694b4ca7dc8b6abfd575745dd51be3d
ethtool: provide ring sizes with RINGS_GET request

Implement RINGS_GET request to get ring sizes of a network device. These
are traditionally available via ETHTOOL_GRINGPARAM ioctl request.

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

v2: (all suggested by Jakub Kicinski)
  - minor cleanup in rings_prepare_data()
  - more descriptive rings_reply_size()
  - omit attributes with zero max size

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/netlink.c
net/ethtool/netlink.h
net/ethtool/rings.c [new file with mode: 0644]