From: Huang Rui <huangruippp@gmail.com>
To: davem@davemloft.net
Cc: ast@kernel.org, daniel@iogearbox.net,
jakub.kicinski@netronome.com, hawk@kernel.org,
john.fastabend@gmail.com, kafai@fb.com, songliubraving@fb.com,
yhs@fb.com, jiri@mellanox.com, ecree@solarflare.com,
idosch@mellanox.com, petrm@mellanox.com,
alexander.h.duyck@intel.com, amritha.nambiar@intel.com,
lirongqing@baidu.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, xdp-newbies@vger.kernel.org,
bpf@vger.kernel.org, huangruiPPP@gmail.com
Subject: [PATCH] net:bridge:bridge mtu auto tuning does not always work
Date: Tue, 9 Apr 2019 07:36:42 +0000 [thread overview]
Message-ID: <20190409073642.12953-1-huangruiPPP@gmail.com> (raw)
If someone setup a bridge and add a port(for example: eth0)
into the bridge, but configure the bridge's mtu which is equal
to eth0's mtu, the auto tuning flag will not be set true. But
the meaning of the auto tuning flag is that it will be set true
if a user configure bridge's mtu.
Signed-off-by: Huang Rui <huangruiPPP@gmail.com>
---
net/core/dev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 2b67f2a..ba410d7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7670,8 +7670,12 @@ int dev_set_mtu_ext(struct net_device *dev, int new_mtu,
{
int err, orig_mtu;
- if (new_mtu == dev->mtu)
- return 0;
+ if (new_mtu == dev->mtu) {
+ if (dev->priv_flags & IFF_EBRIDGE)
+ return __dev_set_mtu(dev, new_mtu);
+ else
+ return 0;
+ }
/* MTU must be positive, and in range */
if (new_mtu < 0 || new_mtu < dev->min_mtu) {
--
1.8.3.1
reply other threads:[~2019-04-09 7:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190409073642.12953-1-huangruiPPP@gmail.com \
--to=huangruippp@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=amritha.nambiar@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=hawk@kernel.org \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=jiri@mellanox.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
--cc=songliubraving@fb.com \
--cc=xdp-newbies@vger.kernel.org \
--cc=yhs@fb.com \
/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).