netlink: rss: retrieve ring count using ETHTOOL_GRXRINGS ioctl
Several drivers regressed when ethtool --show-rxfh was converted from
ioctl to netlink. This is because ETHTOOL_GRXRINGS was converted to
ETHTOOL_MSG_CHANNELS_GET, which is semantically equivalent to
ETHTOOL_GCHANNELS but different from ETHTOOL_GRXRINGS. Drivers which
implement ETHTOOL_GRXRINGS do not necessarily implement ETHTOOL_GCHANNELS
or its netlink equivalent.
According to the man page, "A channel is an IRQ and the set of queues
that can trigger that IRQ.", which is different from the definition of
a queue/ring. So we shouldn't be attempting to query the # of rings for
the ioctl variant, but the # of channels for the netlink variant anyway.
Reimplement the args->num_rings retrieval as in do_grxfh(), aka using
the ETHTOOL_GRXRINGS ioctl.
Link: https://lore.kernel.org/netdev/20240711114535.pfrlbih3ehajnpvh@skbuf/
Fixes: ffab99c1f382 ("netlink: add netlink handler for get rss (-x)")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
3 files changed