]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - drivers/net/ethernet/intel/ice/ice_ethtool.c
ice: Interpret .set_channels() input differently
[thirdparty/kernel/stable.git] / drivers / net / ethernet / intel / ice / ice_ethtool.c
index 78b833b3e1d7ef05fcb1b91ede0d526acc19d7fd..62c8205fcebaecf0b5cf766fae6ac7833c38f4a7 100644 (file)
@@ -3593,7 +3593,6 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
        struct ice_pf *pf = vsi->back;
        int new_rx = 0, new_tx = 0;
        bool locked = false;
-       u32 curr_combined;
        int ret = 0;
 
        /* do not support changing channels in Safe Mode */
@@ -3615,22 +3614,8 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
                return -EOPNOTSUPP;
        }
 
-       curr_combined = ice_get_combined_cnt(vsi);
-
-       /* these checks are for cases where user didn't specify a particular
-        * value on cmd line but we get non-zero value anyway via
-        * get_channels(); look at ethtool.c in ethtool repository (the user
-        * space part), particularly, do_schannels() routine
-        */
-       if (ch->rx_count == vsi->num_rxq - curr_combined)
-               ch->rx_count = 0;
-       if (ch->tx_count == vsi->num_txq - curr_combined)
-               ch->tx_count = 0;
-       if (ch->combined_count == curr_combined)
-               ch->combined_count = 0;
-
-       if (!(ch->combined_count || (ch->rx_count && ch->tx_count))) {
-               netdev_err(dev, "Please specify at least 1 Rx and 1 Tx channel\n");
+       if (ch->rx_count && ch->tx_count) {
+               netdev_err(dev, "Dedicated RX or TX channels cannot be used simultaneously\n");
                return -EINVAL;
        }