Skip to contentSkip to conversation

net: mvneta: fix error message when MTU too large for XDP

PATCH Superseded Marek Behún 2 participants 3 messages Jan 5, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvneta: fix error message when MTU too large for XDP

The error message says that "Jumbo frames are not supported on XDP", but the code checks for mtu > MVNETA_MAX_RX_BUF_SIZE, not mtu > 1500.

Fix this error message.

Fixes 0db51da7a8e9 ("net: mvneta: add basic XDP support")
Cc Lorenzo Bianconi <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +1 -1
index 563ceac3060f..8adbfa25465d 100644
@@ -4432,7 +4432,7 @@ static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog,
 	struct bpf_prog *old_prog;
 
 	if (prog && dev->mtu > MVNETA_MAX_RX_BUF_SIZE) {
-		NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not supported on XDP");
+		NL_SET_ERR_MSG_MOD(extack, "XDP is not supported with MTU > %d", dev->mtu);
 		return -EOPNOTSUPP;
 	}
 
Signature · 1 line
2.26.2
#1 lore raw

OMG, please ignore this, I thought that NL_SET_ERR_MSG_MOD takes printf like arguments.

#2 lore raw
In reply to Marek Behún
Quoted 18 lines · Marek Behún

The error message says that "Jumbo frames are not supported on XDP", but the code checks for mtu > MVNETA_MAX_RX_BUF_SIZE, not mtu > 1500.

Fix this error message.

Fixes 0db51da7a8e9 ("net: mvneta: add basic XDP support")
Cc Lorenzo Bianconi <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +0 -0
index 563ceac3060f..8adbfa25465d 100644

drivers/net/ethernet/marvell/mvneta.c static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, · line 4436

Quoted 6 lines
drivers/net/ethernet/marvell/mvneta.c +1 -1
@@ -4432,7 +4432,7 @@ static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog,
 	struct bpf_prog *old_prog;
 
 	if (prog && dev->mtu > MVNETA_MAX_RX_BUF_SIZE) {
-		NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not supported on XDP");
+		NL_SET_ERR_MSG_MOD(extack, "XDP is not supported with MTU > %d", dev->mtu);
 		return -EOPNOTSUPP;

Hi Marek

In addition to the OMG, don't you actually want to print MVNETA_MAX_RX_BUF_SIZE, not the dev->mtu?

Andrew