[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5d8a47f5-b712-b19c-832f-e6492c6e729f@intel.com>
Date: Fri, 24 Feb 2023 16:57:45 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: "mengyuanlou@...-swift.com" <mengyuanlou@...-swift.com>
CC: <netdev@...r.kernel.org>, Jiawen Wu <jiawenwu@...stnetic.com>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next] net: wangxun: Implement the ndo change mtu
interface
From: Mengyuan Lou <mengyuanlou@...-swift.com>
Date: Mon, 20 Feb 2023 15:49:35 +0800
>
>
>> 2023年2月17日 01:38,Alexander Lobakin <aleksander.lobakin@...el.com> 写道:
>>
>> From: Mengyuan Lou <mengyuanlou@...-swift.com>
>> Date: Thu, 16 Feb 2023 16:44:13 +0800
[...]
>>> +static int ngbe_change_mtu(struct net_device *netdev, int new_mtu)
>>> +{
>>> + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
>>
>> You must also account `2 * VLAN_HLEN`. The difference between MTU and
>> frame size is `ETH_HLEN + 2 * VLAN_HLEN + ETH_FCS_LEN`, i.e. 26 bytes.
>> ...except for if your device doesn't handle VLANs, but I doubt so.
>
> The code to support vlan has not been added, so VLAN_HLEN is not considered for now.
What do you mean by "code to support vlan"? You want to say that without
some code, your NIC/driver doesn't receive VLAN-tagged packets at all or
what? VLANs can be handled purely by software if you don't configure
anything on a device. Unless you have some strange HW.
>>
>>> + struct wx *wx = netdev_priv(netdev);
>>> +
>>> + if (max_frame > WX_MAX_JUMBO_FRAME_SIZE)
>>> + return -EINVAL;
>>
>> (Andrew already said that...)
>>
>>> +
>>> + netdev_info(netdev, "Changing MTU from %d to %d.\n",
>>> + netdev->mtu, new_mtu);
[...]
Thanks,
Olek
Powered by blists - more mailing lists