net: dsa: print the MTU value that could not be set

These warnings become somewhat more informative when they include the
MTU value that could not be set and not just the errno.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Link: https://lore.kernel.org/r/20201205133944.10182-1-rasmus.villemoes@prevas.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Rasmus Villemoes 2020-12-05 14:39:44 +01:00 коммит произвёл Jakub Kicinski
Родитель 8e98387b16
Коммит bdc40a3f4b
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -308,14 +308,15 @@ static struct lock_class_key dsa_master_addr_list_lock_key;
int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp) int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp)
{ {
int mtu = ETH_DATA_LEN + cpu_dp->tag_ops->overhead;
int ret; int ret;
rtnl_lock(); rtnl_lock();
ret = dev_set_mtu(dev, ETH_DATA_LEN + cpu_dp->tag_ops->overhead); ret = dev_set_mtu(dev, mtu);
rtnl_unlock(); rtnl_unlock();
if (ret) if (ret)
netdev_warn(dev, "error %d setting MTU to include DSA overhead\n", netdev_warn(dev, "error %d setting MTU to %d to include DSA overhead\n",
ret); ret, mtu);
/* If we use a tagging format that doesn't have an ethertype /* If we use a tagging format that doesn't have an ethertype
* field, make sure that all packets from this point on get * field, make sure that all packets from this point on get

Просмотреть файл

@ -1850,8 +1850,8 @@ int dsa_slave_create(struct dsa_port *port)
ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN); ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
rtnl_unlock(); rtnl_unlock();
if (ret && ret != -EOPNOTSUPP) if (ret && ret != -EOPNOTSUPP)
dev_warn(ds->dev, "nonfatal error %d setting MTU on port %d\n", dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n",
ret, port->index); ret, ETH_DATA_LEN, port->index);
netif_carrier_off(slave_dev); netif_carrier_off(slave_dev);