Commit 506753b0 authored by Tariq Toukan's avatar Tariq Toukan Committed by David S. Miller

net/mlx5e: Optimization for MTU change

Avoid unnecessary interface down/up operations upon an MTU change
when it does not affect the rings configuration.

Fixes: 461017cb ("net/mlx5e: Support RX multi-packet WQE (Striding RQ)")
Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13f9bba7
...@@ -2569,6 +2569,7 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -2569,6 +2569,7 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
u16 max_mtu; u16 max_mtu;
u16 min_mtu; u16 min_mtu;
int err = 0; int err = 0;
bool reset;
mlx5_query_port_max_mtu(mdev, &max_mtu, 1); mlx5_query_port_max_mtu(mdev, &max_mtu, 1);
...@@ -2584,14 +2585,18 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -2584,14 +2585,18 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
mutex_lock(&priv->state_lock); mutex_lock(&priv->state_lock);
reset = !priv->params.lro_en &&
(priv->params.rq_wq_type !=
MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ);
was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
if (was_opened) if (was_opened && reset)
mlx5e_close_locked(netdev); mlx5e_close_locked(netdev);
netdev->mtu = new_mtu; netdev->mtu = new_mtu;
mlx5e_set_dev_port_mtu(netdev); mlx5e_set_dev_port_mtu(netdev);
if (was_opened) if (was_opened && reset)
err = mlx5e_open_locked(netdev); err = mlx5e_open_locked(netdev);
mutex_unlock(&priv->state_lock); mutex_unlock(&priv->state_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment