ethtool: check if there is at least one channel for TX/RX in the core
Having a channel config with no ability to RX or TX traffic is clearly wrong. Check for this in the core so the drivers don't have to. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a0c1d0eafd
commit
7be92514b9
@@ -1676,6 +1676,11 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
|
||||
channels.other_count > curr.max_other)
|
||||
return -EINVAL;
|
||||
|
||||
/* ensure there is at least one RX and one TX channel */
|
||||
if (!channels.combined_count &&
|
||||
(!channels.rx_count || !channels.tx_count))
|
||||
return -EINVAL;
|
||||
|
||||
/* ensure the new Rx count fits within the configured Rx flow
|
||||
* indirection table settings */
|
||||
if (netif_is_rxfh_configured(dev) &&
|
||||
|
Reference in New Issue
Block a user