diff options
Diffstat (limited to 'net/ethtool/common.c')
-rw-r--r-- | net/ethtool/common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 6c245e59bbc1..dd345efa114b 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -655,6 +655,7 @@ int ethtool_check_max_channel(struct net_device *dev, { u64 max_rxnfc_in_use; u32 max_rxfh_in_use; + int max_mp_in_use; /* ensure the new Rx count fits within the configured Rx flow * indirection table/rxnfc settings @@ -673,6 +674,13 @@ int ethtool_check_max_channel(struct net_device *dev, return -EINVAL; } + max_mp_in_use = dev_get_min_mp_channel_count(dev); + if (channels.combined_count + channels.rx_count <= max_mp_in_use) { + if (info) + GENL_SET_ERR_MSG_FMT(info, "requested channel counts are too low for existing memory provider setting (%d)", max_mp_in_use); + return -EINVAL; + } + return 0; } |