* [PATCH net] vlan:make mtu of vlan equal to physical dev
@ 2011-10-08 10:12 Weiping Pan
2011-10-10 4:00 ` David Miller
2011-10-19 2:06 ` WeipingPan
0 siblings, 2 replies; 5+ messages in thread
From: Weiping Pan @ 2011-10-08 10:12 UTC (permalink / raw)
To: netdev; +Cc: Weiping Pan
Default mtu of vlan device is the same with mtu of physical device,
for example 1500, but when change physics mtu to 1600,
VLAN device's mtu is still 1500.
Certainly, you can change vlan device's mtu to 1600 manually,
but I think when you change physics device's mtu, VLAN's mtu should be changed
automatically instead of by manually.
Steps to Reproduce:
1.vconfig add eth4 3
2.ifconfig eth4 mtu 1600
3.check mtu on eth4.3
And what's worse is that if you decrease mtu of pyhsical device,
and when you want to increase it, the mtu of vlan device won't be changed.
Steps to Reproduce:
1.vconfig add eth4 3
2.ifconfig eth4 mtu 100
3.ifconfig eth4 mtu 1500
4.the mtu of eth4.3 is still 100
This bug is reported by Liang Zheng(lzheng@redhat.com).
Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
net/8021q/vlan.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 8970ba1..f6072b4 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -417,9 +417,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
if (!vlandev)
continue;
- if (vlandev->mtu <= dev->mtu)
- continue;
-
dev_set_mtu(vlandev, dev->mtu);
}
break;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] vlan:make mtu of vlan equal to physical dev
2011-10-08 10:12 [PATCH net] vlan:make mtu of vlan equal to physical dev Weiping Pan
@ 2011-10-10 4:00 ` David Miller
2011-10-19 2:06 ` WeipingPan
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2011-10-10 4:00 UTC (permalink / raw)
To: panweiping3; +Cc: netdev, herbert
From: Weiping Pan <panweiping3@gmail.com>
Date: Sat, 8 Oct 2011 18:12:15 +0800
[ Herbert, Weiping is suggesting to remove the "vlandev->mtu <= dev->mtu"
test in your patch below. ]
> Default mtu of vlan device is the same with mtu of physical device,
> for example 1500, but when change physics mtu to 1600,
> VLAN device's mtu is still 1500.
> Certainly, you can change vlan device's mtu to 1600 manually,
> but I think when you change physics device's mtu, VLAN's mtu should be changed
> automatically instead of by manually.
>
> Steps to Reproduce:
> 1.vconfig add eth4 3
> 2.ifconfig eth4 mtu 1600
> 3.check mtu on eth4.3
>
> And what's worse is that if you decrease mtu of pyhsical device,
> and when you want to increase it, the mtu of vlan device won't be changed.
>
> Steps to Reproduce:
> 1.vconfig add eth4 3
> 2.ifconfig eth4 mtu 100
> 3.ifconfig eth4 mtu 1500
> 4.the mtu of eth4.3 is still 100
>
> This bug is reported by Liang Zheng(lzheng@redhat.com).
>
> Signed-off-by: Weiping Pan <panweiping3@gmail.com>
But now this setting is unconditional, and thus value user made
settings will be ignored.
The code that is there now is just a safety measure, and the
test appears to very much be intentional:
--------------------
commit 2e477c9bd2bb6a1606e498adb53ba913378ecdf2
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon Jul 20 07:35:37 2009 -0700
vlan: Propagate physical MTU changes
When the physical MTU changes we want to ensure that all existing
VLAN device MTUs do not exceed the new underlying MTU. This patch
adds that propagation.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index fe64908..6d37b7e 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -468,6 +468,19 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
}
break;
+ case NETDEV_CHANGEMTU:
+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ vlandev = vlan_group_get_device(grp, i);
+ if (!vlandev)
+ continue;
+
+ if (vlandev->mtu <= dev->mtu)
+ continue;
+
+ dev_set_mtu(vlandev, dev->mtu);
+ }
+ break;
+
case NETDEV_FEAT_CHANGE:
/* Propagate device features to underlying device */
for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] vlan:make mtu of vlan equal to physical dev
2011-10-08 10:12 [PATCH net] vlan:make mtu of vlan equal to physical dev Weiping Pan
2011-10-10 4:00 ` David Miller
@ 2011-10-19 2:06 ` WeipingPan
2011-10-19 2:51 ` Ben Greear
2011-10-21 14:48 ` Herbert Xu
1 sibling, 2 replies; 5+ messages in thread
From: WeipingPan @ 2011-10-19 2:06 UTC (permalink / raw)
To: herbert; +Cc: open list:NETWORKING [GENERAL]
Hi, Herbert,
What do you think of this patch ?
thanks
Weiping Pan
On 10/08/2011 06:12 PM, Weiping Pan wrote:
> Default mtu of vlan device is the same with mtu of physical device,
> for example 1500, but when change physics mtu to 1600,
> VLAN device's mtu is still 1500.
> Certainly, you can change vlan device's mtu to 1600 manually,
> but I think when you change physics device's mtu, VLAN's mtu should be changed
> automatically instead of by manually.
>
> Steps to Reproduce:
> 1.vconfig add eth4 3
> 2.ifconfig eth4 mtu 1600
> 3.check mtu on eth4.3
>
> And what's worse is that if you decrease mtu of pyhsical device,
> and when you want to increase it, the mtu of vlan device won't be changed.
>
> Steps to Reproduce:
> 1.vconfig add eth4 3
> 2.ifconfig eth4 mtu 100
> 3.ifconfig eth4 mtu 1500
> 4.the mtu of eth4.3 is still 100
>
> This bug is reported by Liang Zheng(lzheng@redhat.com).
>
> Signed-off-by: Weiping Pan<panweiping3@gmail.com>
> ---
> net/8021q/vlan.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
> index 8970ba1..f6072b4 100644
> --- a/net/8021q/vlan.c
> +++ b/net/8021q/vlan.c
> @@ -417,9 +417,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
> if (!vlandev)
> continue;
>
> - if (vlandev->mtu<= dev->mtu)
> - continue;
> -
> dev_set_mtu(vlandev, dev->mtu);
> }
> break;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] vlan:make mtu of vlan equal to physical dev
2011-10-19 2:06 ` WeipingPan
@ 2011-10-19 2:51 ` Ben Greear
2011-10-21 14:48 ` Herbert Xu
1 sibling, 0 replies; 5+ messages in thread
From: Ben Greear @ 2011-10-19 2:51 UTC (permalink / raw)
To: WeipingPan; +Cc: herbert, open list:NETWORKING [GENERAL]
On 10/18/2011 07:06 PM, WeipingPan wrote:
> Hi, Herbert,
>
> What do you think of this patch ?
>
> thanks
> Weiping Pan
> On 10/08/2011 06:12 PM, Weiping Pan wrote:
>> Default mtu of vlan device is the same with mtu of physical device,
>> for example 1500, but when change physics mtu to 1600,
>> VLAN device's mtu is still 1500.
>> Certainly, you can change vlan device's mtu to 1600 manually,
>> but I think when you change physics device's mtu, VLAN's mtu should be changed
>> automatically instead of by manually.
I don't like the idea. It's perfectly valid to have the physical dev with 9000 MTU
and have vlans with 1500 MTU.
>> Steps to Reproduce:
>> 1.vconfig add eth4 3
>> 2.ifconfig eth4 mtu 1600
>> 3.check mtu on eth4.3
>>
>> And what's worse is that if you decrease mtu of pyhsical device,
>> and when you want to increase it, the mtu of vlan device won't be changed.
That *might* be worth fixing, but even so, some NICs might handle that
just fine, so my opinion is that this should not change either.
Thanks,
Ben
>>
>> Steps to Reproduce:
>> 1.vconfig add eth4 3
>> 2.ifconfig eth4 mtu 100
>> 3.ifconfig eth4 mtu 1500
>> 4.the mtu of eth4.3 is still 100
>>
>> This bug is reported by Liang Zheng(lzheng@redhat.com).
>>
>> Signed-off-by: Weiping Pan<panweiping3@gmail.com>
>> ---
>> net/8021q/vlan.c | 3 ---
>> 1 files changed, 0 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
>> index 8970ba1..f6072b4 100644
>> --- a/net/8021q/vlan.c
>> +++ b/net/8021q/vlan.c
>> @@ -417,9 +417,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
>> if (!vlandev)
>> continue;
>>
>> - if (vlandev->mtu<= dev->mtu)
>> - continue;
>> -
>> dev_set_mtu(vlandev, dev->mtu);
>> }
>> break;
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] vlan:make mtu of vlan equal to physical dev
2011-10-19 2:06 ` WeipingPan
2011-10-19 2:51 ` Ben Greear
@ 2011-10-21 14:48 ` Herbert Xu
1 sibling, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2011-10-21 14:48 UTC (permalink / raw)
To: WeipingPan; +Cc: open list:NETWORKING [GENERAL]
On Wed, Oct 19, 2011 at 10:06:48AM +0800, WeipingPan wrote:
>
> What do you think of this patch ?
I think the current behaviour is fine as it is.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-21 14:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-08 10:12 [PATCH net] vlan:make mtu of vlan equal to physical dev Weiping Pan
2011-10-10 4:00 ` David Miller
2011-10-19 2:06 ` WeipingPan
2011-10-19 2:51 ` Ben Greear
2011-10-21 14:48 ` Herbert Xu
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).