[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+4rd1q58XzLlCOy@lunn.ch>
Date: Thu, 16 Feb 2023 14:11:19 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Mengyuan Lou <mengyuanlou@...-swift.com>
Cc: netdev@...r.kernel.org, jiawenwu@...stnetic.com
Subject: Re: [PATCH net-next] net: wangxun: Implement the ndo change mtu
interface
> +static int ngbe_change_mtu(struct net_device *netdev, int new_mtu)
> +{
> + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
> + struct wx *wx = netdev_priv(netdev);
> +
> + if (max_frame > WX_MAX_JUMBO_FRAME_SIZE)
> + return -EINVAL;
You set netdev->max_mtu. So was it possible to actually make this
happen?
> +
> + netdev_info(netdev, "Changing MTU from %d to %d.\n",
> + netdev->mtu, new_mtu);
netdev_dbg().
> +static void txgbe_reinit_locked(struct wx *wx)
> +{
> + /* prevent tx timeout */
> + netif_trans_update(wx->netdev);
> + txgbe_down(wx);
> + wx_configure(wx);
> + txgbe_up_complete(wx);
> +}
None of these can fail? None allocate memory, etc?
> +static int txgbe_change_mtu(struct net_device *netdev, int new_mtu)
> +{
> + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
> + struct wx *wx = netdev_priv(netdev);
> +
> + if (max_frame > WX_MAX_JUMBO_FRAME_SIZE)
> + return -EINVAL;
> +
> + netdev_info(netdev, "Changing MTU from %d to %d.\n",
> + netdev->mtu, new_mtu);
Same two comments as above.
Andrew
Powered by blists - more mailing lists