Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: use the ETH_MIN_MTU and ETH_DATA_LEN default values

Now that DSA supports MTU configuration, undo the effects of commit
8b1efc0f83f1 ("net: remove MTU limits on a few ether_setup callers") and
let DSA interfaces use the default min_mtu and max_mtu specified by
ether_setup(). This is more important for min_mtu: since DSA is
Ethernet, the minimum MTU is the same as of any other Ethernet
interface, and definitely not zero. For the max_mtu, we have a callback
through which drivers can override that, if they want to.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vladimir Oltean and committed by
David S. Miller
71d4364a f58d2598

-3
-3
net/dsa/slave.c
··· 1754 1754 eth_hw_addr_inherit(slave_dev, master); 1755 1755 slave_dev->priv_flags |= IFF_NO_QUEUE; 1756 1756 slave_dev->netdev_ops = &dsa_slave_netdev_ops; 1757 - slave_dev->min_mtu = 0; 1758 1757 if (ds->ops->port_max_mtu) 1759 1758 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index); 1760 - else 1761 - slave_dev->max_mtu = ETH_MAX_MTU; 1762 1759 SET_NETDEV_DEVTYPE(slave_dev, &dsa_type); 1763 1760 1764 1761 netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one,