From: Stefano Brivio <sbrivio@redhat.com>
To: Matthias Schiffer <mschiffer@universe-factory.net>
Cc: "David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Junhan Yan <juyan@redhat.com>,
Jiri Benc <jbenc@redhat.com>, Hangbin Liu <haliu@redhat.com>
Subject: Re: [PATCH net] vxlan: Restore initial MTU setting based on lower device
Date: Thu, 14 Dec 2017 01:10:42 +0100 [thread overview]
Message-ID: <20171214011042.6b4a2e8b@elisabeth> (raw)
In-Reply-To: <f7ce892a-60e7-4dfd-31d4-ee8fa06c9c1f@universe-factory.net>
On Thu, 14 Dec 2017 00:57:32 +0100
Matthias Schiffer <mschiffer@universe-factory.net> wrote:
> As you note, there is another occurrence of this calculation in
> vxlan_config_apply():
>
>
> [...]
> if (lowerdev) {
> [...]
> max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM :
> VXLAN_HEADROOM);
> }
>
> if (dev->mtu > max_mtu)
> dev->mtu = max_mtu;
> [...]
>
>
> Unless I'm overlooking something, this should already do the same thing and
> your patch is redundant.
The code above sets max_mtu, and only if dev->mtu exceeds that, the
latter is then clamped.
What my patch does is to actually set dev->mtu to that value, no matter
what's the previous value set by ether_setup() (only on creation, and
only if lowerdev is there), just like the previous behaviour used to be.
Let's consider these two cases, on the existing code:
1. lowerdev->mtu is 1500:
- ether_setup(), called by vxlan_setup(), sets dev->mtu to 1500
- here max_mtu is 1450
- we enter the second if clause above (dev->mtu > max_mtu)
- at the end of vxlan_config_apply(), dev->mtu will be 1450
which is consistent with the previous behaviour.
2. lowerdev->mtu is 9000:
- ether_setup(), called by vxlan_setup(), sets dev->mtu to 1500
- here max_mtu is 8950
- we do not enter the second if clause above (dev->mtu < max_mtu)
- at the end of vxlan_config_apply(), dev->mtu will still be 1500
which is not consistent with the previous behaviour, where it used to
be 8950 instead.
--
Stefano
next prev parent reply other threads:[~2017-12-14 0:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 22:37 [PATCH net] vxlan: Restore initial MTU setting based on lower device Stefano Brivio
2017-12-13 23:19 ` Stephen Hemminger
2017-12-13 23:57 ` Matthias Schiffer
2017-12-14 0:10 ` Stefano Brivio [this message]
2017-12-14 0:25 ` Matthias Schiffer
2017-12-14 0:31 ` Stefano Brivio
2017-12-14 0:53 ` Matthias Schiffer
2017-12-14 11:23 ` Alexey Kodanev
2017-12-14 12:36 ` Stefano Brivio
2017-12-14 16:26 ` Alexey Kodanev
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=20171214011042.6b4a2e8b@elisabeth \
--to=sbrivio@redhat.com \
--cc=davem@davemloft.net \
--cc=haliu@redhat.com \
--cc=jbenc@redhat.com \
--cc=juyan@redhat.com \
--cc=mschiffer@universe-factory.net \
--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).