linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net:bridge:bridge mtu auto tuning does not always work
@ 2019-04-09  7:36 Huang Rui
  0 siblings, 0 replies; only message in thread
From: Huang Rui @ 2019-04-09  7:36 UTC (permalink / raw)
  To: davem
  Cc: ast, daniel, jakub.kicinski, hawk, john.fastabend, kafai,
	songliubraving, yhs, jiri, ecree, idosch, petrm,
	alexander.h.duyck, amritha.nambiar, lirongqing, netdev,
	linux-kernel, xdp-newbies, bpf, huangruiPPP

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-09  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09  7:36 [PATCH] net:bridge:bridge mtu auto tuning does not always work Huang Rui

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).