Skip to content

Commit

Permalink
net: dsa: use the ETH_MIN_MTU and ETH_DATA_LEN default values
Browse files Browse the repository at this point in the history
Now that DSA supports MTU configuration, undo the effects of commit
8b1efc0 ("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 <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vladimiroltean authored and davem330 committed Jul 21, 2020
1 parent f58d259 commit 71d4364
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,11 +1754,8 @@ int dsa_slave_create(struct dsa_port *port)
eth_hw_addr_inherit(slave_dev, master);
slave_dev->priv_flags |= IFF_NO_QUEUE;
slave_dev->netdev_ops = &dsa_slave_netdev_ops;
slave_dev->min_mtu = 0;
if (ds->ops->port_max_mtu)
slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index);
else
slave_dev->max_mtu = ETH_MAX_MTU;
SET_NETDEV_DEVTYPE(slave_dev, &dsa_type);

netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one,
Expand Down

0 comments on commit 71d4364

Please sign in to comment.