Skip to content

Commit bdc40a3

Browse files
Rasmus Villemoeskuba-moo
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8e98387 commit bdc40a3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

net/dsa/master.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,15 @@ static struct lock_class_key dsa_master_addr_list_lock_key;
308308

309309
int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp)
310310
{
311+
int mtu = ETH_DATA_LEN + cpu_dp->tag_ops->overhead;
311312
int ret;
312313

313314
rtnl_lock();
314-
ret = dev_set_mtu(dev, ETH_DATA_LEN + cpu_dp->tag_ops->overhead);
315+
ret = dev_set_mtu(dev, mtu);
315316
rtnl_unlock();
316317
if (ret)
317-
netdev_warn(dev, "error %d setting MTU to include DSA overhead\n",
318-
ret);
318+
netdev_warn(dev, "error %d setting MTU to %d to include DSA overhead\n",
319+
ret, mtu);
319320

320321
/* If we use a tagging format that doesn't have an ethertype
321322
* field, make sure that all packets from this point on get

net/dsa/slave.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,8 +1850,8 @@ int dsa_slave_create(struct dsa_port *port)
18501850
ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
18511851
rtnl_unlock();
18521852
if (ret && ret != -EOPNOTSUPP)
1853-
dev_warn(ds->dev, "nonfatal error %d setting MTU on port %d\n",
1854-
ret, port->index);
1853+
dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n",
1854+
ret, ETH_DATA_LEN, port->index);
18551855

18561856
netif_carrier_off(slave_dev);
18571857

0 commit comments

Comments
 (0)