All of lore.kernel.org
 help / color / mirror / Atom feed
* Minimum MTU Mess
@ 2016-09-02 17:07 Jarod Wilson
  2016-09-06 16:50 ` [PATCH net-next] sfc: check MTU against minimum threshold Bert Kenward
  2016-09-06 23:55 ` Minimum MTU Mess David Miller
  0 siblings, 2 replies; 16+ messages in thread
From: Jarod Wilson @ 2016-09-02 17:07 UTC (permalink / raw)
  To: netdev

So... I had a bug reported, about a NIC that ceased to work, if it's MTU
was set to 0, then back to it's original value (1500). This got me
thinking... What does an MTU of 0 even mean? Why should it be allowed?

As it turns out, most (but not all) network drivers have a check in their
ndo_change_mtu function that returns -EINVAL if new_mtu < $magic_number,
which is often 68 (per page 25 of RFC 791), but is sometimes 64, or 60, or
46... Sometimes other manipulations are done. But the short version is
that it seems there's an almost universal need to check for a minimum MTU.
There's just some disagreement on what that minimum is.

So, rather than having nearly every ndo_change_mut callback do the exact
same thing, would it make sense to settle on one minimum MTU value, and
check that unilaterally (at least for certain netdev types) in
net/core/dev.c's dev_set_mtu()? Or is intentionally left vague, because
it's really up to the hardware to care?

Alternatively, perhaps each driver should set a netdev->min_mtu value, and
net/core/dev.c could check against that. Could even have a centralized
IP_MIN_MTU of 68 that all devices using ether_setup() and/or
alloc_etherdev() used by default.

In any case, the number of "mtu < 68" and "#define FOO_MIN_MTU 68", or
variations thereof, under drivers/net/ is kind of crazy.

In the interim, I think I'll just do a 3-line patch for this one driver
that mirrors all the existing drivers to keep it from going splat...

-- 
Jarod Wilson
jarod@redhat.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-09-12 14:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 17:07 Minimum MTU Mess Jarod Wilson
2016-09-06 16:50 ` [PATCH net-next] sfc: check MTU against minimum threshold Bert Kenward
2016-09-06 21:31   ` Jarod Wilson
2016-09-06 23:54   ` David Miller
2016-09-06 23:55 ` Minimum MTU Mess David Miller
2016-09-07 19:53   ` Jarod Wilson
2016-09-07 20:31     ` Andrew Lunn
2016-09-07 23:43       ` Jarod Wilson
2016-09-08  1:24         ` Andrew Lunn
2016-09-09 18:05           ` Jarod Wilson
2016-09-12  2:41             ` Andrew Lunn
2016-09-12 14:27               ` Jarod Wilson
2016-09-07 20:35     ` Stephen Hemminger
2016-09-07 23:44       ` Jarod Wilson
2016-09-12  2:59     ` YOSHIFUJI Hideaki
2016-09-12 14:31       ` Jarod Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.