Skip to contentSkip to conversation

net: dsa: use the ETH_MIN_MTU and ETH_DATA_LEN default values

PATCH Applied Vladimir Oltean 3 participants 3 messages Jul 18, 2020 – Jul 21, 2020

Subsystems (3)
lore
Share & tools
lore

Vladimir Oltean

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 net/dsa/slave.c | 3 ---
 1 file changed, 3 deletions(-)
net/dsa/slave.c +0 -3
index 3856a5788e39..58412a664b98 100644
@@ -1940,11 +1940,8 @@ int dsa_slave_create(struct dsa_port *port)
 	if (ds->ops->port_fdb_add && ds->ops->port_egress_floods)
 		slave_dev->priv_flags |= IFF_UNICAST_FLT;
 	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);
 	vlan_dev_ivdf_set(slave_dev, true);
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Vladimir Oltean

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.

Signature · 1 line
Florian
maintainer Applied
#2 lore raw
In reply to Vladimir Oltean

From: Vladimir Oltean <[email protected]>
Date: Sat, 18 Jul 2020 21:04:18 +0300

Quoted 9 lines

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.

Applied, thanks.