|
@@ -425,15 +425,26 @@ static void bnxt_get_channels(struct net_device *dev,
|
|
|
struct ethtool_channels *channel)
|
|
|
{
|
|
|
struct bnxt *bp = netdev_priv(dev);
|
|
|
+ struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
|
|
|
int max_rx_rings, max_tx_rings, tcs;
|
|
|
+ int max_tx_sch_inputs;
|
|
|
+
|
|
|
+ /* Get the most up-to-date max_tx_sch_inputs. */
|
|
|
+ if (bp->flags & BNXT_FLAG_NEW_RM)
|
|
|
+ bnxt_hwrm_func_resc_qcaps(bp, false);
|
|
|
+ max_tx_sch_inputs = hw_resc->max_tx_sch_inputs;
|
|
|
|
|
|
bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, true);
|
|
|
+ if (max_tx_sch_inputs)
|
|
|
+ max_tx_rings = min_t(int, max_tx_rings, max_tx_sch_inputs);
|
|
|
channel->max_combined = min_t(int, max_rx_rings, max_tx_rings);
|
|
|
|
|
|
if (bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, false)) {
|
|
|
max_rx_rings = 0;
|
|
|
max_tx_rings = 0;
|
|
|
}
|
|
|
+ if (max_tx_sch_inputs)
|
|
|
+ max_tx_rings = min_t(int, max_tx_rings, max_tx_sch_inputs);
|
|
|
|
|
|
tcs = netdev_get_num_tc(dev);
|
|
|
if (tcs > 1)
|