Re: [PATCH net-next v1] hinic: add set_channels ethtool_ops support
From: David Miller
Date: Sat May 16 2020 - 16:35:11 EST
From: Luo bin <luobin9@xxxxxxxxxx>
Date: Fri, 15 May 2020 19:42:12 +0000
> add support to change TX/RX queue number with ethtool -L
>
> Signed-off-by: Luo bin <luobin9@xxxxxxxxxx>
I don't think you are properly following the semantics of this
ethtool command with your changes.
In fact, you are breaking the hinic_get_channels() function which
is properly advertising the ->max_* values currently. Now it will
return zero.
Whatever is advertised in ->max_* should be the driver's maximum
capabilities.
This means that the user can request anything in the range from '1'
to these max values.
Whatever the user asks for in ->combined_count and elsewhere, you
_MUST_ provide or return an error.
That is not what hinic_set_channels() is doing. It is using
combined_count as a "limit" rather than the value to use.