* Re: [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device [not found] <bug-13467-10286@http.bugzilla.kernel.org/> @ 2009-06-09 21:34 ` Andrew Morton 2009-07-06 10:19 ` Herbert Xu 0 siblings, 1 reply; 4+ messages in thread From: Andrew Morton @ 2009-06-09 21:34 UTC (permalink / raw) To: netdev; +Cc: bugzilla-daemon, bugme-daemon, tomek (switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Sat, 6 Jun 2009 17:43:46 GMT bugzilla-daemon@bugzilla.kernel.org wrote: > http://bugzilla.kernel.org/show_bug.cgi?id=13467 > > Summary: Cannot set larger mtu on vlan then on underlying > untagged device > Product: Networking > Version: 2.5 > Kernel Version: 2.6.27.24-170.2.68.fc10.i686 > Platform: All > OS/Version: Linux > Tree: Fedora > Status: NEW > Severity: normal > Priority: P1 > Component: Other > AssignedTo: acme@ghostprotocols.net > ReportedBy: tomek@jot23.org > Regression: No > > > I want to create vlan interface which uses jumbo frames while underlying > network device is still using standerd 1500 bytes frames. So I tried: > > tkepczyx-mobl1:~# ip link show dev eth0 > 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP > qlen 100 > link/ether 00:0d:60:79:e0:9d brd ff:ff:ff:ff:ff:ff > tkepczyx-mobl1:~# vconfig add eth0 12 > Added VLAN with VID == 12 to IF -:eth0:- > tkepczyx-mobl1:~# ip link set dev eth0.12 mtu 9000 > RTNETLINK answers: Numerical result out of range > > So I made sure that eth0 supports 9000 bytes mtu: > > tkepczyx-mobl1:~# ip link set dev eth0 mtu 9000 > tkepczyx-mobl1:~# ip link show dev eth0 > 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP > qlen 100 > link/ether 00:0d:60:79:e0:9d brd ff:ff:ff:ff:ff:ff > > It apparently does. So I gave it another try: > > tkepczyx-mobl1:~# ip link set dev eth0.12 mtu 9000 > tkepczyx-mobl1:~# ip link show dev eth0.12 > 4: eth0.12@eth0: <BROADCAST,MULTICAST> mtu 9000 qdisc noop state DOWN > link/ether 00:0d:60:79:e0:9d brd ff:ff:ff:ff:ff:ff > > Now it worked. So lets decrease mtu on eth0: > > tkepczyx-mobl1:~# ip link set dev eth0 mtu 1500 > tkepczyx-mobl1:~# ip link show dev eth0 > 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP > qlen 100 > link/ether 00:0d:60:79:e0:9d brd ff:ff:ff:ff:ff:ff > tkepczyx-mobl1:~# ip link show dev eth0.12 > 4: eth0.12@eth0: <BROADCAST,MULTICAST> mtu 9000 qdisc noop state DOWN > link/ether 00:0d:60:79:e0:9d brd ff:ff:ff:ff:ff:ff > > It also worked. > Now - if there is a reason which prevents me to increase mtu on vlan over mtu > on underlyng device, the very same reason should have prevented me from > decreasing mtu on underlying eth0 below mtu on eth0.12 vlan. This is a fault. > > I started digging a bit in sources and there is one thing which rings a bell: > vlan_dev_change_mtu function in net/8021q/vlan_dev.c: > > static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu) > { > /* TODO: gotta make sure the underlying layer can handle it, > * maybe an IFF_VLAN_CAPABLE flag for devices? > */ > if (vlan_dev_info(dev)->real_dev->mtu < new_mtu) > return -ERANGE; > > dev->mtu = new_mtu; > > return 0; > } > > My guess is that check in if() statement above is against currently configured > mtu while it probably should check what physically device can transmit. > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device 2009-06-09 21:34 ` [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device Andrew Morton @ 2009-07-06 10:19 ` Herbert Xu 2009-07-17 2:30 ` David Miller 2009-07-20 14:36 ` David Miller 0 siblings, 2 replies; 4+ messages in thread From: Herbert Xu @ 2009-07-06 10:19 UTC (permalink / raw) To: Andrew Morton Cc: netdev, bugzilla-daemon, bugme-daemon, tomek, David S. Miller Andrew Morton <akpm@linux-foundation.org> wrote: > >> Summary: Cannot set larger mtu on vlan then on underlying >> untagged device Please try this patch. 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> 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++) { Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <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 related [flat|nested] 4+ messages in thread
* Re: [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device 2009-07-06 10:19 ` Herbert Xu @ 2009-07-17 2:30 ` David Miller 2009-07-20 14:36 ` David Miller 1 sibling, 0 replies; 4+ messages in thread From: David Miller @ 2009-07-17 2:30 UTC (permalink / raw) To: herbert; +Cc: akpm, netdev, bugzilla-daemon, bugme-daemon, tomek From: Herbert Xu <herbert@gondor.apana.org.au> Date: Mon, 6 Jul 2009 18:19:50 +0800 > Andrew Morton <akpm@linux-foundation.org> wrote: >> >>> Summary: Cannot set larger mtu on vlan then on underlying >>> untagged device > > Please try this patch. > > 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> Please can we have some test results for this patch? It's been more than a week since this patch and request for testing was posted. Thanks. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device 2009-07-06 10:19 ` Herbert Xu 2009-07-17 2:30 ` David Miller @ 2009-07-20 14:36 ` David Miller 1 sibling, 0 replies; 4+ messages in thread From: David Miller @ 2009-07-20 14:36 UTC (permalink / raw) To: herbert; +Cc: akpm, netdev, bugzilla-daemon, bugme-daemon, tomek From: Herbert Xu <herbert@gondor.apana.org.au> Date: Mon, 6 Jul 2009 18:19:50 +0800 > 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> Applied to net-next-2.6, thanks. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-20 14:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <bug-13467-10286@http.bugzilla.kernel.org/>
2009-06-09 21:34 ` [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device Andrew Morton
2009-07-06 10:19 ` Herbert Xu
2009-07-17 2:30 ` David Miller
2009-07-20 14:36 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox