Skip to content

Commit bacc794

Browse files
Eugenia Emantayevdavem330
authored andcommitted
net/mlx5e: Remove redundant checks in set_ringparam
Since the checks are done in upper layer ethtool code, checks in driver are not needed any more. Signed-off-by: Eugenia Emantayev <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7589fd5 commit bacc794

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ int mlx5e_ethtool_set_ringparam(struct mlx5e_priv *priv,
296296
struct mlx5e_channels new_channels = {};
297297
u32 rx_pending_wqes;
298298
u32 min_rq_size;
299-
u32 max_rq_size;
300299
u8 log_rq_size;
301300
u8 log_sq_size;
302301
u32 num_mtts;
@@ -315,8 +314,6 @@ int mlx5e_ethtool_set_ringparam(struct mlx5e_priv *priv,
315314

316315
min_rq_size = mlx5e_rx_wqes_to_packets(priv, rq_wq_type,
317316
1 << mlx5_min_log_rq_size(rq_wq_type));
318-
max_rq_size = mlx5e_rx_wqes_to_packets(priv, rq_wq_type,
319-
1 << mlx5_max_log_rq_size(rq_wq_type));
320317
rx_pending_wqes = mlx5e_packets_to_rx_wqes(priv, rq_wq_type,
321318
param->rx_pending);
322319

@@ -326,12 +323,6 @@ int mlx5e_ethtool_set_ringparam(struct mlx5e_priv *priv,
326323
min_rq_size);
327324
return -EINVAL;
328325
}
329-
if (param->rx_pending > max_rq_size) {
330-
netdev_info(priv->netdev, "%s: rx_pending (%d) > max (%d)\n",
331-
__func__, param->rx_pending,
332-
max_rq_size);
333-
return -EINVAL;
334-
}
335326

336327
num_mtts = MLX5E_REQUIRED_MTTS(rx_pending_wqes);
337328
if (priv->channels.params.rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ &&
@@ -347,12 +338,6 @@ int mlx5e_ethtool_set_ringparam(struct mlx5e_priv *priv,
347338
1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE);
348339
return -EINVAL;
349340
}
350-
if (param->tx_pending > (1 << MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE)) {
351-
netdev_info(priv->netdev, "%s: tx_pending (%d) > max (%d)\n",
352-
__func__, param->tx_pending,
353-
1 << MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE);
354-
return -EINVAL;
355-
}
356341

357342
log_rq_size = order_base_2(rx_pending_wqes);
358343
log_sq_size = order_base_2(param->tx_pending);

0 commit comments

Comments
 (0)