All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@mellanox.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Huang Rui <huangruippp@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"kafai@fb.com" <kafai@fb.com>,
	"songliubraving@fb.com" <songliubraving@fb.com>,
	"yhs@fb.com" <yhs@fb.com>, Jiri Pirko <jiri@mellanox.com>,
	"ecree@solarflare.com" <ecree@solarflare.com>,
	Ido Schimmel <idosch@mellanox.com>,
	"alexander.h.duyck@intel.com" <alexander.h.duyck@intel.com>,
	"amritha.nambiar@intel.com" <amritha.nambiar@intel.com>,
	Li Rongqing <lirongqing@baidu.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"roopa@cumulusnetworks.com" <roopa@cumulusnetworks.com>,
	"nikolay@cumulusnetworks.com" <nikolay@cumulusnetworks.com>,
	"bridge@lists.linux-foundation.org" 
	<bridge@lists.linux-foundation.org>
Subject: Re: [PATCH] net:bridge:always disable auto-tuning when the user specified MTU
Date: Wed, 10 Apr 2019 10:34:17 +0000	[thread overview]
Message-ID: <87y34ijgil.fsf@mellanox.com> (raw)
In-Reply-To: <20190409193911.2d68a64d@shemminger-XPS-13-9360>


Stephen Hemminger <stephen@networkplumber.org> writes:

> On Wed, 10 Apr 2019 02:32:08 +0000
> Huang Rui <huangruippp@gmail.com> 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 <huangruiPPP@gmail.com>
>
> A bridge like this going to drop frames.
> A frame received with MTU of 1200 will get dropped.

That's true even if above you set br0's MTU to 1201, but then the
auto-tuning is disabled as expected. The problem is that setting MTU to
1200 is perceived as a non-change, whereas it should instead be
perceived as a signal that the user takes over the MTU management.

> The proper way to do this is to change MTU of both interfaces to match.

WARNING: multiple messages have this Message-ID (diff)
From: Petr Machata <petrm@mellanox.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "songliubraving@fb.com" <songliubraving@fb.com>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"ecree@solarflare.com" <ecree@solarflare.com>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"bridge@lists.linux-foundation.org"
	<bridge@lists.linux-foundation.org>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	Li Rongqing <lirongqing@baidu.com>,
	Huang Rui <huangruippp@gmail.com>, "yhs@fb.com" <yhs@fb.com>,
	"alexander.h.duyck@intel.com" <alexander.h.duyck@intel.com>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"nikolay@cumulusnetworks.com" <nikolay@cumulusnetworks.com>,
	"roopa@cumulusnetworks.com" <roopa@cumulusnetworks.com>,
	Ido Schimmel <idosch@mellanox.com>,
	Jiri Pirko <jiri@mellanox.com>,
	"amritha.nambiar@intel.com" <amritha.nambiar@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"kafai@fb.com" <kafai@fb.com>
Subject: Re: [Bridge] [PATCH] net:bridge:always disable auto-tuning when the user specified MTU
Date: Wed, 10 Apr 2019 10:34:17 +0000	[thread overview]
Message-ID: <87y34ijgil.fsf@mellanox.com> (raw)
In-Reply-To: <20190409193911.2d68a64d@shemminger-XPS-13-9360>


Stephen Hemminger <stephen@networkplumber.org> writes:

> On Wed, 10 Apr 2019 02:32:08 +0000
> Huang Rui <huangruippp@gmail.com> 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 <huangruiPPP@gmail.com>
>
> A bridge like this going to drop frames.
> A frame received with MTU of 1200 will get dropped.

That's true even if above you set br0's MTU to 1201, but then the
auto-tuning is disabled as expected. The problem is that setting MTU to
1200 is perceived as a non-change, whereas it should instead be
perceived as a signal that the user takes over the MTU management.

> The proper way to do this is to change MTU of both interfaces to match.

  reply	other threads:[~2019-04-10 10:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10  2:32 [PATCH] net:bridge:always disable auto-tuning when the user specified MTU Huang Rui
2019-04-10  2:32 ` [Bridge] " Huang Rui
2019-04-10  2:39 ` Stephen Hemminger
2019-04-10  2:39   ` [Bridge] " Stephen Hemminger
2019-04-10 10:34   ` Petr Machata [this message]
2019-04-10 10:34     ` Petr Machata
2019-04-10 11:05     ` Nikolay Aleksandrov
2019-04-10 11:05       ` [Bridge] " Nikolay Aleksandrov
2019-04-16  7:19       ` 黄睿
2019-04-16  7:19         ` [Bridge] " 黄睿

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=87y34ijgil.fsf@mellanox.com \
    --to=petrm@mellanox.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=amritha.nambiar@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=ecree@solarflare.com \
    --cc=hawk@kernel.org \
    --cc=huangruippp@gmail.com \
    --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=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=songliubraving@fb.com \
    --cc=stephen@networkplumber.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.