Skip to content

Commit

Permalink
ethernet/sfc: use core min/max MTU checking
Browse files Browse the repository at this point in the history
Fixes: 61e8462 ("net: centralize net_device min/max MTU checking")
Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bert Kenward authored and David S. Miller committed Oct 18, 2016
1 parent a844667 commit cd94e51
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/net/ethernet/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2263,18 +2263,6 @@ static int efx_change_mtu(struct net_device *net_dev, int new_mtu)
rc = efx_check_disabled(efx);
if (rc)
return rc;
if (new_mtu > EFX_MAX_MTU) {
netif_err(efx, drv, efx->net_dev,
"Requested MTU of %d too big (max: %d)\n",
new_mtu, EFX_MAX_MTU);
return -EINVAL;
}
if (new_mtu < EFX_MIN_MTU) {
netif_err(efx, drv, efx->net_dev,
"Requested MTU of %d too small (min: %d)\n",
new_mtu, EFX_MIN_MTU);
return -EINVAL;
}

netif_dbg(efx, drv, efx->net_dev, "changing MTU to %d\n", new_mtu);

Expand Down Expand Up @@ -2478,6 +2466,8 @@ static int efx_register_netdev(struct efx_nic *efx)
net_dev->priv_flags |= IFF_UNICAST_FLT;
net_dev->ethtool_ops = &efx_ethtool_ops;
net_dev->gso_max_segs = EFX_TSO_MAX_SEGS;
net_dev->min_mtu = EFX_MIN_MTU;
net_dev->max_mtu = EFX_MAX_MTU;

rtnl_lock();

Expand Down

0 comments on commit cd94e51

Please sign in to comment.