linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Fredrik Markstrom <fredrik.markstrom@gmail.com>
Cc: netdev <netdev@vger.kernel.org>, Evan Jones <ej@evanjones.ca>,
	"David S. Miller" <davem@davemloft.net>,
	Cong Wang <cwang@twopensource.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vijay Pandurangan <vijayp@vijayp.ca>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	ebiederm <ebiederm@aristanetworks.com>
Subject: Re: Inconsistency in packet drop due to MTU (eth vs veth)
Date: Tue, 31 Jan 2017 08:27:09 -0800	[thread overview]
Message-ID: <1485880029.6360.118.camel@edumazet-glaptop3.roam.corp.google.com> (raw)
In-Reply-To: <159f4b9e4ab.12b79bda8122843.8859202944513905410@gmail.com>

On Tue, 2017-01-31 at 14:32 +0100, Fredrik Markstrom wrote:
>  ---- On Thu, 19 Jan 2017 19:53:47 +0100 Eric Dumazet <eric.dumazet@gmail.com> wrote ---- 
>  > On Thu, 2017-01-19 at 17:41 +0100, Fredrik Markstrom wrote: 
>  > > Hello, 
>  > >  
>  > > I've noticed an inconsistency between how physical ethernet and
> veth handles mtu. 
>  > >  
>  > > If I setup two physical interfaces (directly connected) with
> different mtu:s, only the size of the outgoing packets are limited by
> the mtu. But with veth a packet is dropped if the mtu of the receiving
> interface is smaller then the packet size.  
>  > >  
>  > > This seems inconsistent to me, but maybe there is a reason for
> it ?  
>  > >  
>  > > Can someone confirm if it's a deliberate inconsistency or just a
> side effect of using dev_forward_skb() ? 
>  >  
>  > It looks this was added in commit 
>  > 38d408152a86598a50680a82fe3353b506630409 
>  > ("veth: Allow setting the L3 MTU") 
>  >  
>  > But what was really needed here was a way to change MRU :( 
> 
> Ok, do we consider this correct and/or something we need to be
> backwards compatible with ? Is it insane to believe that we can fix
> this "inconsistency" by removing the check ?
> 
> The commit message reads "For consistency I drop packets on the
> receive side when they are larger than the MTU", do we know what it's
> supposed
> to be consistent with or is that lost in history ?

There is no consistency among existing Ethernet drivers.

Many ethernet drivers size the buffers they post in RX ring buffer
according to MTU.

If MTU is set to 1500, RX buffers are sized to be about 1536 bytes,
so you wont be able to receive a 1700 bytes frame.

I guess that you could add a specific veth attribute to precisely
control MRU, that would not break existing applications.

  reply	other threads:[~2017-01-31 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 16:41 Inconsistency in packet drop due to MTU (eth vs veth) Fredrik Markstrom
2017-01-19 18:53 ` Eric Dumazet
2017-01-31 13:32   ` Fredrik Markstrom
2017-01-31 16:27     ` Eric Dumazet [this message]
2017-02-03  8:07       ` Fredrik Markstrom
2017-02-03 14:42         ` Toshiaki Makita

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=1485880029.6360.118.camel@edumazet-glaptop3.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=cwang@twopensource.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@aristanetworks.com \
    --cc=ej@evanjones.ca \
    --cc=fredrik.markstrom@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vijayp@vijayp.ca \
    /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).