Re: [PATCH v2 net-next 3/4] ionic: restrict received packets to mtu size
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2020-01-07 21:30:23
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2020-01-07 21:30:23
Hi Andrew, On Tue, 7 Jan 2020 at 21:46, Andrew Lunn [off-list ref] wrote:
quoted
Hi Andrew,Hi Shannonquoted
In my experience the driver typically tells the NIC about the current max_frame size (e.g. MTU + ETH_HLEN), the NIC only copies max_frame bytes, and the NIC returns an error indication on a packets that had more than max_frame.Having played around with a few different NICs for DSA, it seems more like 75% don't care about the 'MRU' and will happily accept bigger frames. Anyway, it does not hurt to drop received frames bigger than what you can transmit.
In the general case, would we want a knob in Linux for the MRU, or is it ok to go ahead with patches such as this one, and e.g. set up port policers for limiting the frame length at the value of the MTU?
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew-Vladimir