diff options
author | Madalin Bucur <madalin.bucur@freescale.com> | 2014-08-19 14:34:15 (GMT) |
---|---|---|
committer | Madalin Bucur <madalin.bucur@freescale.com> | 2014-10-08 13:20:01 (GMT) |
commit | 88199143a99c2205d4dfdb6e143bc00557b4e0aa (patch) | |
tree | 57a46198ee2a710c4263eada61352184de5292ff /drivers | |
parent | 4e96b2079d2b6570fc622f2123d800d6b6113777 (diff) | |
download | linux-fsl-qoriq-88199143a99c2205d4dfdb6e143bc00557b4e0aa.tar.xz |
dpaa_eth: accept minimum MTU of at least 68
RFC 791 states that the minimum MTU needs to be 68 in order to
allow datagram forwarding without further fragmentation.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Change-Id: I4f9602c49a5a9aaac0030f511a6abbf32954f82f
Reviewed-on: http://git.am.freescale.net:8181/17073
Reviewed-by: Ruxandra Ioana Radulescu <ruxandra.radulescu@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth.h index 66403f0..e26cb72 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.h @@ -48,10 +48,6 @@ extern int dpa_num_cpus; #define dpa_get_rx_extra_headroom() dpa_rx_extra_headroom #define dpa_get_max_frm() dpa_max_frm -/* Currently we have the same max_frm on all interfaces, so these macros - * don't get a net_device argument. This will change in the future. - */ -#define dpa_get_min_mtu() 64 #define dpa_get_max_mtu() \ (dpa_get_max_frm() - (VLAN_ETH_HLEN + ETH_FCS_LEN)) diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index 1e8026f..0a2cdfc 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -260,12 +260,11 @@ dpa_get_stats64(struct net_device *net_dev, int dpa_change_mtu(struct net_device *net_dev, int new_mtu) { const int max_mtu = dpa_get_max_mtu(); - const int min_mtu = dpa_get_min_mtu(); /* Make sure we don't exceed the Ethernet controller's MAXFRM */ - if (new_mtu < min_mtu || new_mtu > max_mtu) { + if (new_mtu < 68 || new_mtu > max_mtu) { netdev_err(net_dev, "Invalid L3 mtu %d (must be between %d and %d).\n", - new_mtu, min_mtu, max_mtu); + new_mtu, 68, max_mtu); return -EINVAL; } net_dev->mtu = new_mtu; |