From: Li RongQing <lirongqing@baidu.com>
To: netdev@vger.kernel.org
Cc: nikolay@cumulusnetworks.com
Subject: [PATCH][net-next] bridge: clean up mtu_set_by_user setting to false and comments
Date: Fri, 13 Jul 2018 14:47:24 +0800 [thread overview]
Message-ID: <1531464444-26517-1-git-send-email-lirongqing@baidu.com> (raw)
Once mtu_set_by_user is set to true, br_mtu_auto_adjust will
not run, and no chance to clear mtu_set_by_user.
and br_mtu_auto_adjust will run only if mtu_set_by_user is
false, so not need to set it to false again
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
net/bridge/br_device.c | 1 -
net/bridge/br_if.c | 4 ----
2 files changed, 5 deletions(-)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index e682a668ce57..c636bc2749c2 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -227,7 +227,6 @@ static int br_change_mtu(struct net_device *dev, int new_mtu)
dev->mtu = new_mtu;
- /* this flag will be cleared if the MTU was automatically adjusted */
br->mtu_set_by_user = true;
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
/* remember the MTU in the rtable for PMTU */
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 05e42d86882d..47c65da4b1be 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -450,11 +450,7 @@ void br_mtu_auto_adjust(struct net_bridge *br)
if (br->mtu_set_by_user)
return;
- /* change to the minimum MTU and clear the flag which was set by
- * the bridge ndo_change_mtu callback
- */
dev_set_mtu(br->dev, br_mtu_min(br));
- br->mtu_set_by_user = false;
}
static void br_set_gso_limits(struct net_bridge *br)
--
2.16.2
next reply other threads:[~2018-07-13 7:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 6:47 Li RongQing [this message]
2018-07-13 8:00 ` [PATCH][net-next] bridge: clean up mtu_set_by_user setting to false and comments Nikolay Aleksandrov
2018-07-13 9:11 ` 答复: " Li,Rongqing
2018-07-13 9:19 ` Nikolay Aleksandrov
2018-07-13 10:56 ` 答复: " Li,Rongqing
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=1531464444-26517-1-git-send-email-lirongqing@baidu.com \
--to=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.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