Skip to contentSkip to conversation

net: dsa: don't print non-fatal MTU error if not supported

PATCH Applied Vladimir Oltean 4 participants 5 messages Sep 7, 2020 – Sep 8, 2020

Subsystems (3)
lore
Share & tools
lore

Vladimir Oltean

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: don't print non-fatal MTU error if not supported

Commit 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") changed, for some reason, the "err && err != -EOPNOTSUPP" check into a simple "err". This causes the MTU warning to be printed even for drivers that don't have the MTU operations implemented. Fix that.

---
 net/dsa/slave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/slave.c +1 -1
index 27931141d30f..4987f94a8f52 100644
@@ -1784,7 +1784,7 @@ int dsa_slave_create(struct dsa_port *port)
 	rtnl_lock();
 	ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
 	rtnl_unlock();
-	if (ret)
+	if (ret && ret != -EOPNOTSUPP)
 		dev_warn(ds->dev, "nonfatal error %d setting MTU on port %d\n",
 			 ret, port->index);
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Vladimir Oltean

Commit 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") changed, for some reason, the "err && err != -EOPNOTSUPP" check into a simple "err". This causes the MTU warning to be printed even for drivers that don't have the MTU operations implemented. Fix that.

Hi Vladimir

In some ways, this has been good. A lot more DSA drivers now have MTU support and jumbo packet support.

Quoted 1 line

Andrew

author maintainer
#2 lore raw
Quoted 4 lines · Andrew Lunn

Hi Vladimir

In some ways, this has been good. A lot more DSA drivers now have MTU support and jumbo packet support.

Yes, I suspect this is because many people wanted to experiment with jumbo frames anyway, and the warning in dmesg acted as a sort of reminder that the infrastructure is there. If it weren't for this pre-existing interest, I would have expected a patch that silenced this warning sooner, and not from me (the switches that I have don't print this message).

Thanks,
-Vladimir

Reviewed-by on v1 1/1
#3 lore raw
In reply to Vladimir Oltean
Quoted 7 lines · Vladimir Oltean

Commit 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") changed, for some reason, the "err && err != -EOPNOTSUPP" check into a simple "err". This causes the MTU warning to be printed even for drivers that don't have the MTU operations implemented. Fix that.

Signature · 1 line
Florian
maintainer Applied
#4 lore raw
In reply to Vladimir Oltean
Quoted 7 lines · On Tue, 8 Sep 2020 02:25:56 +0300 Vladimir Oltean wrote:

Commit 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") changed, for some reason, the "err && err != -EOPNOTSUPP" check into a simple "err". This causes the MTU warning to be printed even for drivers that don't have the MTU operations implemented. Fix that.

Applied, thanks everyone!