|
@@ -1750,7 +1750,8 @@ static void mlx4_en_get_channels(struct net_device *dev,
|
|
|
channel->max_tx = MLX4_EN_MAX_TX_RING_P_UP;
|
|
|
|
|
|
channel->rx_count = priv->rx_ring_num;
|
|
|
- channel->tx_count = priv->tx_ring_num[TX] / MLX4_EN_NUM_UP;
|
|
|
+ channel->tx_count = priv->tx_ring_num[TX] /
|
|
|
+ priv->prof->num_up;
|
|
|
}
|
|
|
|
|
|
static int mlx4_en_set_channels(struct net_device *dev,
|
|
@@ -1773,18 +1774,19 @@ static int mlx4_en_set_channels(struct net_device *dev,
|
|
|
|
|
|
mutex_lock(&mdev->state_lock);
|
|
|
xdp_count = priv->tx_ring_num[TX_XDP] ? channel->rx_count : 0;
|
|
|
- if (channel->tx_count * MLX4_EN_NUM_UP + xdp_count > MAX_TX_RINGS) {
|
|
|
+ if (channel->tx_count * priv->prof->num_up + xdp_count >
|
|
|
+ MAX_TX_RINGS) {
|
|
|
err = -EINVAL;
|
|
|
en_err(priv,
|
|
|
"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n",
|
|
|
- channel->tx_count * MLX4_EN_NUM_UP + xdp_count,
|
|
|
+ channel->tx_count * priv->prof->num_up + xdp_count,
|
|
|
MAX_TX_RINGS);
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
memcpy(&new_prof, priv->prof, sizeof(struct mlx4_en_port_profile));
|
|
|
new_prof.num_tx_rings_p_up = channel->tx_count;
|
|
|
- new_prof.tx_ring_num[TX] = channel->tx_count * MLX4_EN_NUM_UP;
|
|
|
+ new_prof.tx_ring_num[TX] = channel->tx_count * priv->prof->num_up;
|
|
|
new_prof.tx_ring_num[TX_XDP] = xdp_count;
|
|
|
new_prof.rx_ring_num = channel->rx_count;
|
|
|
|
|
@@ -1803,7 +1805,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
|
|
|
netif_set_real_num_rx_queues(dev, priv->rx_ring_num);
|
|
|
|
|
|
if (netdev_get_num_tc(dev))
|
|
|
- mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP);
|
|
|
+ mlx4_en_setup_tc(dev, priv->prof->num_up);
|
|
|
|
|
|
en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num[TX]);
|
|
|
en_warn(priv, "Using %d RX rings\n", priv->rx_ring_num);
|