Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4440896yba; Tue, 9 Apr 2019 19:48:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1cFDv97SbiIT7tJoqCdXBhgBD5zv9MjMU6FM5FCGH+XotWb0tGtNQVJbK34hj62l9th6l X-Received: by 2002:a62:b61a:: with SMTP id j26mr40946911pff.203.1554864526255; Tue, 09 Apr 2019 19:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554864526; cv=none; d=google.com; s=arc-20160816; b=L427tta1cdbnIPAiWOUbO6r1MvrEaTrR9A/wqFjyfmvnALCOs4yLic6a0uecr6Traw HZuXMtk7fFoPZOipnZHndvKvi1AZ4dCAS0xqOfE1CooYeXWSm2x5HPC0MXEbIOJPJIfB TQF+bTxL5x4gmHUrharMtKCAlydVPCUGl2wnOiddmzfqaVV8MOAKwN6dJpAVztxSJfc8 ZMWDr5lY3ug3zQ5Ynxl1/VNklIpDwTtALhcSS5yTJGaDrHKmYVv2eNbocNmtggp8Fb7v Dh3nl5JExcIFoNQ0u7RCvb2/pkposJqctR6LTAfBKPFLcLf5hKplWOyinNOM6vZAehXu PmKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kpCEf/Qq7tuBHkUCvzw9RDQhyuv+fkTrLJtMvQIPB04=; b=MIV2oyYvvzhHiDoE5MWaC6MSJ06RoLbMAHX7pJoxxAzgI+EieKUEeUdbXejbMZ2UpI T/mziVJp4GITPpsbEb781Zg04pmKPDWfXTvaeX+kBqUiBNM4aygBQbtHNs+/UT4q1fJX cnHlx/174vROmW/7kLHgYd6GC5ghM3SHtANDOompm92shsvq4D8Aq2UN9KGEV9+LQ15j jfjwEIfiFVY5Ufl/zMvxLQGs0b3N7XiY25qUiPt1ToZMQdah9ynjxGeZIzUhqKWbv2ei 5S5R3fu0PUAddB7JNsgGDVnYq8Xe4JZW3VLDP9CgDC+N2xkeUMHNYTXUiAb3mw5s+gQs i8XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=qk4XpOUr; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si22488295pgc.12.2019.04.09.19.48.30; Tue, 09 Apr 2019 19:48:46 -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=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=qk4XpOUr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727130AbfDJCjR (ORCPT + 99 others); Tue, 9 Apr 2019 22:39:17 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40976 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbfDJCjQ (ORCPT ); Tue, 9 Apr 2019 22:39:16 -0400 Received: by mail-pg1-f195.google.com with SMTP id f6so561203pgs.8 for ; Tue, 09 Apr 2019 19:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kpCEf/Qq7tuBHkUCvzw9RDQhyuv+fkTrLJtMvQIPB04=; b=qk4XpOUrgdAyWaYDdG7h6tprWKEK6itk0//ZrqrqyoY7gjC+0AgDmpzNeW9N+4twsb PNeU7GmxnWKBUWcpK5Mu+MjTzeTgI5HNruxyPimpPtni+YYo2Mq946tsXYAwXnA4VM6c e6zR94qu1RzUUSsce4TQFBR9pXfg8IKhMptrM9q+VckxVJUdM08X79lwWhG4IesgnSVD y6/P0JoZSfEshzh8XDsNtF9tx8p/I+yW9F69pylWW6XVhov23qd57f092E3ucoyy+OZK VCxOdzbydInBLhlKaLwOXFsXKA2xWTm6IDHhrT0g2UFPICef5AweOOV66Vc9+Upgofiy gKfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kpCEf/Qq7tuBHkUCvzw9RDQhyuv+fkTrLJtMvQIPB04=; b=S+UisqIkAvFlP/RWIVa9FpSaBVOVkXSsLGbRhNlWvF3EZ6UWAzRz68Kh47+X94mi1X 9kRpSD5om3+yR/wp6OHfpQAtp+S4iEbek0YGStCNEmZqeld48YU6/RtHJkGFKO/STpIy QgwjY61Xk0fN+z40sKBCTteSjz+LpK2BC6TBcvcQMEWrG5rDMPf8YwtYAUPjQKLIoWQI YhUna+tvEkOeTg+fRLlAzchKyROlVzOnx8MiC1+u+pbtrpmwjMr+8mjpOQz1rf0zvvPD ipXycnscML38FpWc7LuBN6LjzzTH0qf8/d2sSRrzria8fYT0iZ/qAVhaBtNCDERqFFxy NdzA== X-Gm-Message-State: APjAAAVZe8TGckn6awUnhnaeD4rgt2GLCz2O2m8jit4HPJiAy0GQZmHx 03uZSkMiE0Mgab7w9kkGY//53w== X-Received: by 2002:a63:6988:: with SMTP id e130mr22004349pgc.150.1554863955782; Tue, 09 Apr 2019 19:39:15 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id c1sm40310406pgk.44.2019.04.09.19.39.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 19:39:15 -0700 (PDT) Date: Tue, 9 Apr 2019 19:39:11 -0700 From: Stephen Hemminger To: Huang Rui Cc: davem@davemloft.net, 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, roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, bridge@lists.linux-foundation.org Subject: Re: [PATCH] net:bridge:always disable auto-tuning when the user specified MTU Message-ID: <20190409193911.2d68a64d@shemminger-XPS-13-9360> In-Reply-To: <20190410023208.25435-1-huangruiPPP@gmail.com> References: <20190410023208.25435-1-huangruiPPP@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Apr 2019 02:32:08 +0000 Huang Rui wrote: > For example. > My purpose is to create a bridge br0 and join eth0 into br0. > if we use this following way, the auto-tuning flag will not be disabled. > > If eth0's mtu is 1200 > step 1.brctl addbr br0 > step 2.brctl addif br0 eth0 > step 3.ifconfig br0 mtu 1200 > step 4.ifconfig eth0 mtu 1500 > > Result: > br0's MTU: 1500, eth0's MTU: 1500 > > Expected: > br0's MTU: 1200, eth0's MTU: 1500 > > I have specified br0's MTU, but auto-min policy works. So the MTU is > not the result what we expected. > As expected, if i have specified bridge's MTU, it will set the flag: > BROPT_MTU_SET_BY_USER in net_bridge_opts disabled and auto-min/max > policy will not work.But in this case, because the dev_set_mtu return > early, the BROPT_MTU_SET_BY_USER flag will not be disabled and > auto-min/max policy will still work. > > Signed-off-by: Huang Rui A bridge like this going to drop frames. A frame received with MTU of 1200 will get dropped. The proper way to do this is to change MTU of both interfaces to match.