[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8ffef39-ce76-4028-b54f-7ec919a4620c@lunn.ch>
Date: Wed, 18 Dec 2024 19:31:04 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Xin Tian <tianx@...silicon.com>
Cc: netdev@...r.kernel.org, andrew+netdev@...n.ch, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com, davem@...emloft.net,
jeff.johnson@....qualcomm.com, przemyslaw.kitszel@...el.com,
weihg@...silicon.com, wanry@...silicon.com
Subject: Re: [PATCH v1 16/16] net-next/yunsilicon: Add change mtu
> +static int xsc_eth_change_mtu(struct net_device *netdev, int new_mtu)
> +{
> + struct xsc_adapter *adapter = netdev_priv(netdev);
> + int old_mtu = netdev->mtu;
> + int ret = 0;
> + int max_buf_len = 0;
> +
> + if (new_mtu > netdev->max_mtu || new_mtu < netdev->min_mtu) {
> + netdev_err(netdev, "%s: Bad MTU (%d), valid range is: [%d..%d]\n",
> + __func__, new_mtu, netdev->min_mtu, netdev->max_mtu);
> + return -EINVAL;
> + }
What checking does the core do for you, now that you have set max_mtu
and min_mtu?
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists