netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: netdev@vger.kernel.org
Subject: Minimum MTU Mess
Date: Fri, 2 Sep 2016 13:07:42 -0400	[thread overview]
Message-ID: <20160902170742.GA17677@redhat.com> (raw)

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

             reply	other threads:[~2016-09-02 17:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 17:07 Jarod Wilson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160902170742.GA17677@redhat.com \
    --to=jarod@redhat.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).