summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-01-23 19:59:15 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2019-07-09 12:20:56 +0100
commit516efbc61d0cd8551a595cf4fdb264e28e4e37ce (patch)
tree8425fa4967c9160ec52a466732f5febafff56818
parent953d64453aafcbf9937587989efa38fca490df21 (diff)
net: marvell: mvpp2x: allow jumbo frames to be configured
The driver fails to configure the minimum and maximum mtu sizes, for jumbo frame operation, so fill these in. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c b/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
index c2a58726cd66..f00e0f7bab24 100644
--- a/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
@@ -3812,22 +3812,6 @@ void mv_pp2x_stop_dev(struct mv_pp2x_port *port)
}
}
-/* Return positive if MTU is valid */
-static int mv_pp2x_check_mtu_valid(struct net_device *dev, int mtu)
-{
- if (mtu < 68) {
- netdev_err(dev, "cannot change mtu to less than 68\n");
- return -EINVAL;
- }
-
- if (MVPP2_RX_PKT_SIZE(mtu) > MVPP2_BM_JUMBO_PKT_SIZE) {
- netdev_info(dev, "illegal MTU value %d, round to 9704\n", mtu);
- mtu = MVPP2_RX_MTU_SIZE(MVPP2_BM_JUMBO_PKT_SIZE);
- }
-
- return mtu;
-}
-
int mv_pp2x_check_ringparam_valid(struct net_device *dev,
struct ethtool_ringparam *ring)
{
@@ -4282,12 +4266,6 @@ static int mv_pp2x_change_mtu(struct net_device *dev, int mtu)
}
#endif
- mtu = mv_pp2x_check_mtu_valid(dev, mtu);
- if (mtu < 0) {
- err = mtu;
- goto error;
- }
-
if (!netif_running(dev)) {
err = mv_pp2x_bm_update_mtu(dev, mtu);
if (!err) {
@@ -4914,6 +4892,10 @@ static int mv_pp2x_port_probe(struct platform_device *pdev,
port->dev = dev;
SET_NETDEV_DEV(dev, &pdev->dev);
dev->dev.of_node = port_node;
+ /* MTU range: 68 - 9704 */
+ dev->min_mtu = ETH_MIN_MTU;
+ /* 9704 == 9728 - 20 and rounding to 8 */
+ dev->max_mtu = MVPP2_RX_MTU_SIZE(MVPP2_BM_JUMBO_PKT_SIZE);
port->priv = priv;
mv_pp2x_port_init_config(port);