@@ -1723,6 +1723,7 @@ int dsa_slave_create(struct dsa_port *port)
const char *name = port->name;
struct net_device *slave_dev;
struct dsa_slave_priv *p;
+ int mtu;
int ret;
if (!ds->num_tx_queues)
@@ -1767,8 +1768,10 @@ int dsa_slave_create(struct dsa_port *port)
p->xmit = cpu_dp->tag_ops->xmit;
port->slave = slave_dev;
+ mtu = min_t(int, master->max_mtu - cpu_dp->tag_ops->overhead,
+ ETH_DATA_LEN);
rtnl_lock();
- ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
+ ret = dsa_slave_change_mtu(slave_dev, mtu);
rtnl_unlock();
if (ret && ret != -EOPNOTSUPP) {
dev_err(ds->dev, "error %d setting MTU on port %d\n",