There seems to be a few more things we can check in the core before
we call drivers' ethtool_ops->set_channels. Adding the checks to
the core simplifies the drivers. This set only includes changes
to the NFP driver as an example.

There is a small risk in the first patch that someone actually
purposefully accepts a strange configuration without RX or TX
channels, but I couldn't find such a driver in the tree.

Jakub Kicinski (3):
  ethtool: check if there is at least one channel for TX/RX in the core
  nfp: don't check lack of RX/TX channels
  ethtool: don't call set_channels in drivers if config didn't change

 .../ethernet/netronome/nfp/nfp_net_ethtool.c  |  3 +--
 net/ethtool/channels.c                        | 20 +++++++++++++++++--
 net/ethtool/ioctl.c                           | 11 ++++++++++
 3 files changed, 30 insertions(+), 4 deletions(-)

-- 
2.25.4

Reply via email to