diff mbox series

[net-next] net: mvneta: fix error message when MTU too large for XDP

Message ID 20210105163833.389-1-kabel@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: mvneta: fix error message when MTU too large for XDP | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: kuba@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit fail Errors and warnings before: 2 this patch: 8
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch warning WARNING: line length of 91 exceeds 80 columns
netdev/build_allmodconfig_warn fail Errors and warnings before: 2 this patch: 8
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Marek Behún Jan. 5, 2021, 4:38 p.m. UTC
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.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Behún Jan. 5, 2021, 5:15 p.m. UTC | #1
OMG, please ignore this, I thought that NL_SET_ERR_MSG_MOD takes printf
like arguments.
Andrew Lunn Jan. 5, 2021, 8:06 p.m. UTC | #2
On Tue, Jan 05, 2021 at 05:38:33PM +0100, Marek Behún wrote:
> 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.
> 
> Signed-off-by: Marek Behún <kabel@kernel.org>
> Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
> Cc: Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  drivers/net/ethernet/marvell/mvneta.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 563ceac3060f..8adbfa25465d 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -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
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 563ceac3060f..8adbfa25465d 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -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;
 	}