diff options
author | Jarod Wilson <jarod@redhat.com> | 2016-10-17 21:54:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-18 17:34:20 +0200 |
commit | 109cc16526c6d5551f7735683f7985b2b0300bb5 (patch) | |
tree | 55b731da919991907cbc7b83f4c1a8dfac0d3fa4 /drivers/net/ethernet/cavium/octeon | |
parent | ethernet/neterion: use core min/max MTU checking (diff) | |
download | linux-109cc16526c6d5551f7735683f7985b2b0300bb5.tar.xz linux-109cc16526c6d5551f7735683f7985b2b0300bb5.zip |
ethernet/cavium: use core min/max MTU checking
liquidio: min_mtu 68, max_mtu 16000
thunder: min_mtu 64, max_mtu 9200
CC: netdev@vger.kernel.org
CC: Sunil Goutham <sgoutham@cavium.com>
CC: Robert Richter <rric@kernel.org>
CC: Derek Chickles <derek.chickles@caviumnetworks.com>
CC: Satanand Burla <satananda.burla@caviumnetworks.com>
CC: Felix Manlunas <felix.manlunas@caviumnetworks.com>
CC: Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/octeon')
-rw-r--r-- | drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c index 4ab404f45b21..16e12c45904b 100644 --- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c @@ -645,16 +645,6 @@ static int octeon_mgmt_change_mtu(struct net_device *netdev, int new_mtu) struct octeon_mgmt *p = netdev_priv(netdev); int size_without_fcs = new_mtu + OCTEON_MGMT_RX_HEADROOM; - /* Limit the MTU to make sure the ethernet packets are between - * 64 bytes and 16383 bytes. - */ - if (size_without_fcs < 64 || size_without_fcs > 16383) { - dev_warn(p->dev, "MTU must be between %d and %d.\n", - 64 - OCTEON_MGMT_RX_HEADROOM, - 16383 - OCTEON_MGMT_RX_HEADROOM); - return -EINVAL; - } - netdev->mtu = new_mtu; cvmx_write_csr(p->agl + AGL_GMX_RX_FRM_MAX, size_without_fcs); @@ -1491,6 +1481,9 @@ static int octeon_mgmt_probe(struct platform_device *pdev) netdev->netdev_ops = &octeon_mgmt_ops; netdev->ethtool_ops = &octeon_mgmt_ethtool_ops; + netdev->min_mtu = 64 - OCTEON_MGMT_RX_HEADROOM; + netdev->max_mtu = 16383 - OCTEON_MGMT_RX_HEADROOM; + mac = of_get_mac_address(pdev->dev.of_node); if (mac) |