Subject: Re: Netlink handler for ethtool --show-rxfh breaks driver compatibility

From: Vladimir Oltean <[email-masked]>
Date: Mon, 15 Jul 2024 14:58:07 +0300

Hi Sudheer,

On Mon, Jul 15, 2024 at 07:37:45AM +0000, Mogilappagari, Sudheer wrote:
> Hi Vladimir, 
> 
> Here is related discussion wrt this topic https://lore.kernel.org/netdev/[email-masked]/T/#mdfcc6e25edb5b7719356db4759dc13e2a9020487
> 
> While introducing netlink support for ethtool --show-rxfh
> the tradeoff was whether to modify the command output or to
> use ETHTOOL_GCHANNELS to get the queue count. We went with
> not modifying command output. Didn't realize about drivers
> with no get_channels() support. Currently I have no ideas
> on how to resolve this other than drivers implementing
> get_channels() support. Any other ideas are welcome.
> 
> Though not a solution, one workaround is to compile ethtool
> with no netlink support. 
> 
> Thanks
> Sudheer

I guess the bottom line is that ETHTOOL_GRXRINGS != ETHTOOL_GCHANNELS.
There is a fair amount of drivers which implements ethtool_ops ::
get_rxnfc() :: struct ethtool_rxnfc->cmd == ETHTOOL_GRXRINGS differently
than ethtool_ops :: get_channels().

Looking at Documentation/networking/ethtool-netlink.rst, I see
ETHTOOL_GRXRINGS has no netlink equivalent. So print_indir_table()
should still be called with the result of the ETHTOOL_GRXRINGS ioctl
even in the netlink case?