* [PATCH] vxlan: Accept user specified MTU value when create new vxlan link
@ 2016-05-27 2:49 Chen Haiquan
2016-05-27 16:09 ` Cong Wang
0 siblings, 1 reply; 4+ messages in thread
From: Chen Haiquan @ 2016-05-27 2:49 UTC (permalink / raw)
Cc: netdev, Chen Haiquan
When create a new vxlan link, example:
ip link add vtap mtu 1440 type vxlan vni 1 dev eth0
The argument "mtu" has no effect, because it is not set to conf->mtu. The
default value is used in vxlan_dev_configure function.
This problem was introduced by commit 0dfbdf4102b9 (vxlan: Factor out device
configuration).
Fixes: 0dfbdf4102b9 (vxlan: Factor out device configuration)
Signed-off-by: Chen Haiquan <oc@yunify.com>
---
drivers/net/vxlan.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 8ff30c3..f999db2 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3086,6 +3086,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL])
conf.flags |= VXLAN_F_REMCSUM_NOPARTIAL;
+ if (tb[IFLA_MTU])
+ conf.mtu = nla_get_u32(tb[IFLA_MTU]);
+
err = vxlan_dev_configure(src_net, dev, &conf);
switch (err) {
case -ENODEV:
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vxlan: Accept user specified MTU value when create new vxlan link
2016-05-27 2:49 [PATCH] vxlan: Accept user specified MTU value when create new vxlan link Chen Haiquan
@ 2016-05-27 16:09 ` Cong Wang
2016-05-28 15:22 ` oc
0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2016-05-27 16:09 UTC (permalink / raw)
To: Chen Haiquan; +Cc: Linux Kernel Network Developers
On Thu, May 26, 2016 at 7:49 PM, Chen Haiquan <oc@yunify.com> wrote:
> When create a new vxlan link, example:
> ip link add vtap mtu 1440 type vxlan vni 1 dev eth0
>
> The argument "mtu" has no effect, because it is not set to conf->mtu. The
> default value is used in vxlan_dev_configure function.
>
> This problem was introduced by commit 0dfbdf4102b9 (vxlan: Factor out device
> configuration).
>
> Fixes: 0dfbdf4102b9 (vxlan: Factor out device configuration)
>
> Signed-off-by: Chen Haiquan <oc@yunify.com>
> ---
> drivers/net/vxlan.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 8ff30c3..f999db2 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -3086,6 +3086,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
> if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL])
> conf.flags |= VXLAN_F_REMCSUM_NOPARTIAL;
>
> + if (tb[IFLA_MTU])
> + conf.mtu = nla_get_u32(tb[IFLA_MTU]);
> +
IFLA_MTU is already parsed in rtnl_create_link(),
so just use dev->mtu here? conf.mtu = dev->mtu?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vxlan: Accept user specified MTU value when create new vxlan link
2016-05-27 16:09 ` Cong Wang
@ 2016-05-28 15:22 ` oc
2016-05-31 3:27 ` Cong Wang
0 siblings, 1 reply; 4+ messages in thread
From: oc @ 2016-05-28 15:22 UTC (permalink / raw)
To: Cong Wang; +Cc: Linux Kernel Network Developers
On 2016/05/28 00:09, Cong Wang wrote:
> On Thu, May 26, 2016 at 7:49 PM, Chen Haiquan <oc@yunify.com> wrote:
>> When create a new vxlan link, example:
>> ip link add vtap mtu 1440 type vxlan vni 1 dev eth0
>>
>> The argument "mtu" has no effect, because it is not set to conf->mtu. The
>> default value is used in vxlan_dev_configure function.
>>
>> This problem was introduced by commit 0dfbdf4102b9 (vxlan: Factor out device
>> configuration).
>>
>> Fixes: 0dfbdf4102b9 (vxlan: Factor out device configuration)
>>
>> Signed-off-by: Chen Haiquan <oc@yunify.com>
>> ---
>> drivers/net/vxlan.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
>> index 8ff30c3..f999db2 100644
>> --- a/drivers/net/vxlan.c
>> +++ b/drivers/net/vxlan.c
>> @@ -3086,6 +3086,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
>> if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL])
>> conf.flags |= VXLAN_F_REMCSUM_NOPARTIAL;
>>
>> + if (tb[IFLA_MTU])
>> + conf.mtu = nla_get_u32(tb[IFLA_MTU]);
>> +
> IFLA_MTU is already parsed in rtnl_create_link(),
> so just use dev->mtu here? conf.mtu = dev->mtu?
Two reasons:
1. vxlan_dev_configure function check conf->mtu to determine if it need
to change value of dev->mtu.
The logical looks better to get conf->mtu from IFLA_MTU directly.
2. This problem is a regression. The old code check tb[IFLA_MTU]. I want
to use the same way as the past.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-31 3:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27 2:49 [PATCH] vxlan: Accept user specified MTU value when create new vxlan link Chen Haiquan
2016-05-27 16:09 ` Cong Wang
2016-05-28 15:22 ` oc
2016-05-31 3:27 ` Cong Wang
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).