Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3611335yba; Tue, 9 Apr 2019 00:39:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNZWEx158Hndzbrmg07xx8bBRthR9SIhzgLx26W+ohla2681XN4BYTVH0oxqCcUamMfb9Z X-Received: by 2002:a63:3d06:: with SMTP id k6mr25102823pga.194.1554795553275; Tue, 09 Apr 2019 00:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554795553; cv=none; d=google.com; s=arc-20160816; b=xVdzQF+OAdz5rCgaR/YYFqo+M/LpGJTptZMjVCPMenbYHe8R/TNWApVUqqWyAh//4M hRH2/Qb2z6VTLZG0V55W3zVRZ+XhGU9+oR/9X4ankutkcXZglS9VIIxcZ1yW82tEZcSr zL4QKHyFPHb3PY5d7Zew3FzURsdYAMOyeLEPtG2IorPgUCC/21PFJlXNfWq+nhuh/W+l JlkPv3Ne5dEjZ4XybO5q+jJ8f3p+Z+AJj+E2m/bAYqQMZ9VQMIp6vluk937k6JwJufQs clAHK9GaL2UMHU4132oN9jjxYmnBT1hQXPtnj14dQcZAYS3nQpEh5MpXOn/n5sNM35Ff jr8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=9bEy5XG2sC3I8z9cfzh5IJXe7CaSLjpMHO9QO+hf0Tg=; b=P0xuLqFIP0x/lgvZtw+WhoPuFtgf+A3vCBth1mxDPFEdF5e3MvvBSKF5vRzChSPE0W sWIMrrGvYtc91SDbOgaLE7iKm9TqjgA12hzmuzhRc5S3jBX89OCHiTADymSLOtvUlHxR 3Vv0U6b6aV5jlBp0DXKGJZzDT23mGkvWJXbH60OK4k1hPbdgjMN4CKBfWpbUc2J1OFuG +5xqYSNxoBNamvKrrFxPS9lMCQ1lJ4e2OnvgF7sr9NNc5iu/B0qRK8smWmaiD0/WYwFF rWFtnXWqY0mQDYVXXD73KHrw1mzUnJ7s+iX1HYQ7aeaUuyR46A/vV67gG8IwRKfNnAlM lGww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CJATPsXQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si10064896pfi.62.2019.04.09.00.38.57; Tue, 09 Apr 2019 00:39:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CJATPsXQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbfDIHgu (ORCPT + 99 others); Tue, 9 Apr 2019 03:36:50 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41311 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbfDIHgt (ORCPT ); Tue, 9 Apr 2019 03:36:49 -0400 Received: by mail-pf1-f196.google.com with SMTP id 188so9181388pfd.8; Tue, 09 Apr 2019 00:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9bEy5XG2sC3I8z9cfzh5IJXe7CaSLjpMHO9QO+hf0Tg=; b=CJATPsXQJpxEH7KprBLLawEhmA2fZ6GiGwQdxGCL2n6PfseNTcEI6XfCY17EuHGC9d P5XODUE19v1i1kVNZjNN7K09l3j7H06l+7uJjg9nhWdD0Zn0COFy9SRoEkTIfYoM3Q9B S78b4ymV1t4A2dj5nUnloAv3Tp3R/SJMlEhSkkAtsMsjNXO4mzS2QAh2wWFgc7/4tt5w j+HGkk4sVqVfRe69BEY7d1GdwsuVVHjblO+KyfY0dE5UkK/IwNGw4F/rYlg4USMOmeuw YL9PP6gyOA/PhTMveCEiqAPiNXOZIk3WgQsBfyPlydJnUAHk0xqvkFlfUL7026zhJl2Q 0uRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9bEy5XG2sC3I8z9cfzh5IJXe7CaSLjpMHO9QO+hf0Tg=; b=lUSizg6y3ss47Y3nY62NR/55iwZtlJIeiCXC4xYyFP9xCYd7dX3mUC4r1+G5fQSJck 1xcBKdfgr5+DizxiZiJqYBc9fUPpUgaddDBWuNZJ4YbzTSgzlcq2/OplMyx+GgXj3fD7 spVQQHp/fPTrjoeIGVaNm9NlCzDEK/kON12pDx0/CZNO82fRVpgcM41V0cDbOuLCwWQf 5W1XQskYpV9TKjwOfuEv4K30JDUOIFQ+/OVkpP/IlfgkorsnHtlE5MLJhSMqbddC1crU YsQ5vF2pJiYmlghCN5CxyVKsk2z79JJuyI47mvvZ8DTOZA0OrvBd4NJqDRn4HyrbS9+B 4J5Q== X-Gm-Message-State: APjAAAVgkLr/YFH5a/yrRS6FLwi2rKOIFkQyWvf9wgBWUkUaRNk75lZc 5pXFCFsnirCQgdStg3g5hXw= X-Received: by 2002:aa7:8096:: with SMTP id v22mr5873344pff.94.1554795408852; Tue, 09 Apr 2019 00:36:48 -0700 (PDT) Received: from shadowsocks.asia-east1-b.c.nth-highlander-219506.internal. (191.202.194.35.bc.googleusercontent.com. [35.194.202.191]) by smtp.gmail.com with ESMTPSA id j14sm32862446pfa.57.2019.04.09.00.36.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 00:36:47 -0700 (PDT) From: Huang Rui X-Google-Original-From: Huang Rui 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 Message-Id: <20190409073642.12953-1-huangruiPPP@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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