From: "Mahesh Bandewar (महेश बंडेवार)" <maheshb@google.com>
To: Jiri Benc <jbenc@redhat.com>
Cc: liuqifa@huawei.com, David Miller <davem@davemloft.net>,
dsahern@gmail.com, mschiffer@universe-factory.net,
idosch@mellanox.com, fw@strlen.de, kjlx@templeofstupid.com,
girish.moodalbail@oracle.com, sainath.grandhi@intel.com,
linux-netdev <netdev@vger.kernel.org>,
weiyongjun1@huawei.com, chenweilong@huawei.com,
maowenan@huawei.com, wangyufen@huawei.com, yuehaibing@huawei.com,
liujian56@huawei.com, liuzhe24@huawei.com,
wangkefeng.wang@huawei.com, dingtianhong@huawei.com
Subject: Re: [PATCH V2] ipvlan: fix ipvlan MTU limits
Date: Fri, 12 Jan 2018 09:50:35 -0800 [thread overview]
Message-ID: <CAF2d9jgQT3rez_yrbHtHcnMcmfHr76zHpPUNWA9Fs_ByTb120g@mail.gmail.com> (raw)
In-Reply-To: <20180112094833.70926efa@redhat.com>
On Fri, Jan 12, 2018 at 12:48 AM, Jiri Benc <jbenc@redhat.com> wrote:
> On Fri, 12 Jan 2018 09:34:13 +0100, Jiri Benc wrote:
>> I don't think this works currently. When someone (does not have to be
>> you, it can be a management software running in background) sets the
>> MTU to the current value, the magic behavior is lost without any way to
>> restore it (unless I'm missing a way to restore it, see my question
>> above). So any user that depends on the magic behavior is broken anyway
>> even now.
>
> Upon further inspection, it seems that currently, slaves always follow
> master's MTU without a way to change it. Tough situation. Even
> implementing user space toggleable mtu_adj could break users in the way
> I described. But it seems to be the lesser evil, at least there would
> be a way to unbreak the scripts with one line addition.
>
> But it's absolute must to have this visible to the user space and
> changeable. Something like this:
>
> # ip a
> 123: ipvlan0: <FLAGS> mtu 1500 (auto) qdisc ...
> # ip l s ipvlan0 mtu 1400
> # ip a
> 123: ipvlan0: <FLAGS> mtu 1400 qdisc ...
> # ip l s ipvlan0 mtu auto
> # ip a
> 123: ipvlan0: <FLAGS> mtu 1500 (auto) qdisc ...
>
(Looks like you missed the last update I mentioned)
Here is the approach in details -
(a) At slave creation time - it's exactly how it's done currently
where slave copies masters' mtu. at the same time max_mtu of the slave
is set as the current mtu of the master.
(b) If slave updates mtu - ipvlan_change_mtu() will be called and the
slave's mtu will get set and it will set a flag indicating that slave
has changed it's mtu (dissociation from master if the mtu is different
from masters'). If slave mtu is set same as masters' then this flag
will get reset-ed indicating it wants to follow master (current
behavior).
(c) When master updates mtu - ipvlan_adj_mtu() gets called where all
slaves' max_mtu changes to the master's mtu value (clamping applies
for the all slaves which are not following master). All the slaves
which are following master (flag per slave) will get this new mtu.
Another consequence of this is that slaves' flag might get reset-ed if
the master's mtu is reduced to the value that was set earlier for the
slave (and it will start following slave).
The above should work? The user-space can query the mtu of the slave
device just like any other device. I was thinking about 'mtu_adj' with
some additional future extention but for now; we can live with a flag
on the slave device(s).
thanks,
--mahesh..
> Jiri
next prev parent reply other threads:[~2018-01-12 17:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 7:21 [PATCH V2] ipvlan: fix ipvlan MTU limits liuqifa
2018-01-11 2:09 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-11 11:25 ` Jiri Benc
2018-01-11 16:59 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-11 18:35 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-12 8:34 ` Jiri Benc
2018-01-12 8:48 ` Jiri Benc
2018-01-12 17:50 ` Mahesh Bandewar (महेश बंडेवार) [this message]
2018-01-12 18:10 ` Jiri Benc
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=CAF2d9jgQT3rez_yrbHtHcnMcmfHr76zHpPUNWA9Fs_ByTb120g@mail.gmail.com \
--to=maheshb@google.com \
--cc=chenweilong@huawei.com \
--cc=davem@davemloft.net \
--cc=dingtianhong@huawei.com \
--cc=dsahern@gmail.com \
--cc=fw@strlen.de \
--cc=girish.moodalbail@oracle.com \
--cc=idosch@mellanox.com \
--cc=jbenc@redhat.com \
--cc=kjlx@templeofstupid.com \
--cc=liujian56@huawei.com \
--cc=liuqifa@huawei.com \
--cc=liuzhe24@huawei.com \
--cc=maowenan@huawei.com \
--cc=mschiffer@universe-factory.net \
--cc=netdev@vger.kernel.org \
--cc=sainath.grandhi@intel.com \
--cc=wangkefeng.wang@huawei.com \
--cc=wangyufen@huawei.com \
--cc=weiyongjun1@huawei.com \
--cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).