Skip to contentSkip to conversation

2.6.37 regression: adding main interface to a bridge breaks vlan interface RX

DISCUSSION Simon Arlott 7 participants 25 messages Jan 16, 2011 – Mar 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
[    1.666706] forcedeth 0000:00:08.0: ifname eth0, PHY OUI 0x5043 @ 16, addr 00:e0:81:4d:2b:ec
[    1.666767] forcedeth 0000:00:08.0: highdma csum vlan pwrctl mgmt gbit lnktim msi desc-v3

I have eth0 and eth0.3840 which works until I add eth0 to a bridge. While eth0 is in a bridge (the bridge device is up), eth0.3840 is unable to receive packets. Using tcpdump on eth0 shows the packets being received with a VLAN tag but they don't appear on eth0.3840. They appear with the VLAN tag on the bridge interface.

If I remove eth0 from the bridge, eth0.3840 starts working again. It still works if eth0.3840 is part of a bridge but eth0 isn't (the device is in promiscuous mode). I've only tested with broadcast traffic.

This works with 2.6.36.

git bisect produces 3701e51382a026cba10c60b03efabe534fba4ca4 as the first bad commit.

The behaviour of drivers/net/forcedeth.c nv_rx_process_optimized looks ok - vlan_gro_receive and napi_gro_receive are called correctly. (The likely(!np->vlangrp) looks odd as it'll always be false if vlans are in use).

Signature · 1 line
Simon Arlott
#1 lore raw
Quoted 8 lines · Simon Arlott
[    1.666706] forcedeth 0000:00:08.0: ifname eth0, PHY OUI 0x5043 @ 16, addr 00:e0:81:4d:2b:ec
[    1.666767] forcedeth 0000:00:08.0: highdma csum vlan pwrctl mgmt gbit lnktim msi desc-v3

I have eth0 and eth0.3840 which works until I add eth0 to a bridge. While eth0 is in a bridge (the bridge device is up), eth0.3840 is unable to receive packets. Using tcpdump on eth0 shows the packets being received with a VLAN tag but they don't appear on eth0.3840. They appear with the VLAN tag on the bridge interface.

[...]

This means the behaviour is now consistent, whether or not hardware VLAN tag stripping is enabled. (I previously pointed out the inconsistent behaviour in <http://thread.gmane.org/gmane.linux.network/149864>.) I would consider this an improvement.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
#2 lore raw
Quoted 9 lines · Ben Hutchings
Quoted 8 lines · Simon Arlott
[    1.666706] forcedeth 0000:00:08.0: ifname eth0, PHY OUI 0x5043 @ 16, addr 00:e0:81:4d:2b:ec
[    1.666767] forcedeth 0000:00:08.0: highdma csum vlan pwrctl mgmt gbit lnktim msi desc-v3

I have eth0 and eth0.3840 which works until I add eth0 to a bridge. While eth0 is in a bridge (the bridge device is up), eth0.3840 is unable to receive packets. Using tcpdump on eth0 shows the packets being received with a VLAN tag but they don't appear on eth0.3840. They appear with the VLAN tag on the bridge interface.

Quoted 6 lines

[...]

This means the behaviour is now consistent, whether or not hardware VLAN tag stripping is enabled. (I previously pointed out the inconsistent behaviour in <http://thread.gmane.org/gmane.linux.network/149864>.) I would consider this an improvement.

Shouldn't the kernel also prevent a device from being both part of a bridge and having VLANs? Instead everything appears to work except incoming traffic.

Signature · 1 line
Simon Arlott
#3 lore raw
Quoted 12 lines · Simon Arlott
Quoted 11 lines · Ben Hutchings
Quoted 8 lines · Simon Arlott

[    1.666706] forcedeth 0000:00:08.0: ifname eth0, PHY OUI 0x5043 @ 16, addr 00:e0:81:4d:2b:ec [    1.666767] forcedeth 0000:00:08.0: highdma csum vlan pwrctl mgmt gbit lnktim msi desc-v3

I have eth0 and eth0.3840 which works until I add eth0 to a bridge. While eth0 is in a bridge (the bridge device is up), eth0.3840 is unable to receive packets. Using tcpdump on eth0 shows the packets being received with a VLAN tag but they don't appear on eth0.3840. They appear with the VLAN tag on the bridge interface.

[...]

Quoted 8 lines
Quoted 4 lines

This means the behaviour is now consistent, whether or not hardware VLAN tag stripping is enabled.  (I previously pointed out the inconsistent behaviour in <http://thread.gmane.org/gmane.linux.network/149864>.)  I would consider this an improvement.

Shouldn't the kernel also prevent a device from being both part of a bridge and having VLANs? Instead everything appears to work except incoming traffic.

It might make sense, although you have similar effects with non-vlan traffic to the device as well. You could make the same argument that we shouldn't allow IP addresses, etc. to be assigned to bridged devices. There are also other components that use the bridge hooks that would need to be checked. All this starts to get a bit messy.

#4 lore raw
In reply to Simon Arlott

I created a Bugzilla entry at
https://bugzilla.kernel.org/show_bug.cgi?id=27432
for your bug report, please add your address to the CC list in there, thanks!

Quoted 23 lines · On niedziela, 16 stycznia 2011 o 15:09:32 Simon Arlott wrote:
[    1.666706] forcedeth 0000:00:08.0: ifname eth0, PHY OUI 0x5043 @ 16,

addr 00:e0:81:4d:2b:ec [ 1.666767] forcedeth 0000:00:08.0: highdma csum
vlan pwrctl mgmt gbit lnktim msi desc-v3

I have eth0 and eth0.3840 which works until I add eth0 to a bridge. While eth0 is in a bridge (the bridge device is up), eth0.3840 is unable to receive packets. Using tcpdump on eth0 shows the packets being received with a VLAN tag but they don't appear on eth0.3840. They appear with the VLAN tag on the bridge interface.

If I remove eth0 from the bridge, eth0.3840 starts working again. It still works if eth0.3840 is part of a bridge but eth0 isn't (the device is in promiscuous mode). I've only tested with broadcast traffic.

This works with 2.6.36.

git bisect produces 3701e51382a026cba10c60b03efabe534fba4ca4 as the first bad commit.

The behaviour of drivers/net/forcedeth.c nv_rx_process_optimized looks ok - vlan_gro_receive and napi_gro_receive are called correctly. (The likely(!np->vlangrp) looks odd as it'll always be false if vlans are in use).

Signature · 2 lines
Maciej Rutecki
http://www.maciek.unixy.pl
#6 lore raw
Quoted 10 lines · On niedziela, 23 stycznia 2011 o 22:29:02 Jesse Gross wrote:

On Sun, Jan 23, 2011 at 9:45 AM, Maciej Rutecki

Quoted 4 lines · <[email protected]> wrote:

I created a Bugzilla entry at
https://bugzilla.kernel.org/show_bug.cgi?id=27432
for your bug report, please add your address to the CC list in there, thanks!

This isn't a bug - the change resolved behavior that varied depending on what NIC was in use.

Thanks for the update. Closing.

Regards

Signature · 2 lines
Maciej Rutecki
http://www.maciek.unixy.pl
#7 lore raw
Quoted 10 lines · Maciej Rutecki <maciej.rutecki <at> gmail.com> writes:
Quoted 8 lines · On niedziela, 23 stycznia 2011 o 22:29:02 Jesse Gross wrote:

On Sun, Jan 23, 2011 at 9:45 AM, Maciej Rutecki

Quoted 4 lines · <maciej.rutecki <at> gmail.com> wrote:

I created a Bugzilla entry at
https://bugzilla.kernel.org/show_bug.cgi?id=27432
for your bug report, please add your address to the CC list in there, thanks!

Quoted 6 lines
Quoted 2 lines

This isn't a bug - the change resolved behavior that varied depending on what NIC was in use.

Thanks for the update. Closing.

Regards

Hi

How am i supposed to put my eth to a bridge and have a seprate vlan besides that bridge?

regards

#8 lore raw
Quoted 17 lines · chriss
Quoted 15 lines · Maciej Rutecki <maciej.rutecki <at> gmail.com> writes:
Quoted 10 lines · On niedziela, 23 stycznia 2011 o 22:29:02 Jesse Gross wrote:

On Sun, Jan 23, 2011 at 9:45 AM, Maciej Rutecki

Quoted 4 lines · <maciej.rutecki <at> gmail.com> wrote:

I created a Bugzilla entry at
https://bugzilla.kernel.org/show_bug.cgi?id=27432
for your bug report, please add your address to the CC list in there, thanks!

This isn't a bug - the change resolved behavior that varied depending on what NIC was in use.

Thanks for the update. Closing.

Quoted 7 lines
Quoted 1 line

Regards

Hi

How am i supposed to put my eth to a bridge and have a seprate vlan besides that bridge?

You should either attached a bridge to a vlan device or stack a vlan device on the bridge port depending on what you are trying to achieve.

The bridge handler takes all packets of the device that it is attached to, so having a vlan also attached to the same device will not work. You may get different results on older kernels depending on what NIC you were using but that was a bug.

#9 lore raw
Quoted 4 lines · Jesse Gross <jesse <at> nicira.com> writes:

You should either attached a bridge to a vlan device or stack a vlan device on the bridge port depending on what you are trying to achieve.

Quoted 10 lines

The bridge handler takes all packets of the device that it is attached to, so having a vlan also attached to the same device will not work. You may get different results on older kernels depending on what NIC you were using but that was a bug.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Hi and thanks for your reply

I tried that.

I had under 2.6.36.3 following combination:

eth1 in br0 -> all traffic without vlan id eth1.3 -> traffic with vlan 3

with 2.6.37 i should do the following eth1 in br0 -> traffic w/o vlans and br0.3 -> traffic with vlan id 3

But still there is no rx for vlan 3. Any suggestions? Or am i missing something?

regards

#10 lore raw
Quoted 27 lines · chriss
Quoted 4 lines · Jesse Gross<jesse<at> nicira.com> writes:

You should either attached a bridge to a vlan device or stack a vlan device on the bridge port depending on what you are trying to achieve.

Quoted 10 lines

The bridge handler takes all packets of the device that it is attached to, so having a vlan also attached to the same device will not work. You may get different results on older kernels depending on what NIC you were using but that was a bug.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo<at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Hi and thanks for your reply

I tried that.

I had under 2.6.36.3 following combination:

eth1 in br0 -> all traffic without vlan id eth1.3 -> traffic with vlan 3

Quoted 6 lines

with 2.6.37 i should do the following eth1 in br0 -> traffic w/o vlans and br0.3 -> traffic with vlan id 3

But still there is no rx for vlan 3. Any suggestions? Or am i missing something?

I think you should have a look at ebtables command, in particular, the BROUTING chain of broute table. If this chain ask the packet to be dropped, then bridge will ignore it and give a chance to the upper layer to use it. Upper layer might be IP, or in your particular setup, VLAN.

HTH,

Nicolas.

In order for eth1.3 to receive the traffic with VLANID=3, while having the bridge get everything else, you should add an entry to the

#11 lore raw
Quoted 1 line · Nicolas de Pesloüan <nicolas.2p.debian <at> gmail.com> writes:

I think you should have a look at ebtables command, in particular, the

BROUTING chain of broute

Quoted 1 line

table. If this chain ask the packet to be dropped, then bridge will ignore it

and give a chance to

Quoted 1 line

the upper layer to use it. Upper layer might be IP, or in your particular

setup, VLAN.

Quoted 4 lines

HTH,

Nicolas.

Thank you very much for the ebtables hint.

I also tried to add the vlan to my bridge device but only droping the vlan tagged paket with ebtables got it working.

I'm not sure if this is the wanted behavior for bridging vlan actions. ..or my network setup is just to ..f%%%'ed up?!

Thanks nicolas

regards//chriss

#12 lore raw
Quoted 13 lines · chriss
Quoted 1 line · Nicolas de Pesloüan <nicolas.2p.debian <at> gmail.com> writes:

I think you should have a look at ebtables command, in particular, the

BROUTING chain of broute

Quoted 1 line

table. If this chain ask the packet to be dropped, then bridge will ignore it

and give a chance to

Quoted 1 line

the upper layer to use it. Upper layer might be IP, or in your particular

setup, VLAN.

Quoted 4 lines

HTH,

      Nicolas.

Quoted 7 lines

Thank you very much for the ebtables hint.

I also tried to add the vlan to my bridge device but only droping the vlan tagged paket with ebtables got it working.

I'm not sure if this is the wanted behavior for bridging vlan actions. ..or my network setup is just to ..f%%%'ed up?!

It should work even without ebtables (running vlan on top of bridge, not side by side). I'll try to look at this in the next couple of days.

#13 lore raw
In reply to chriss
Quoted 13 lines · chriss
Quoted 1 line · Nicolas de Pesloüan <nicolas.2p.debian <at> gmail.com> writes:

I think you should have a look at ebtables command, in particular, the

BROUTING chain of broute

Quoted 1 line

table. If this chain ask the packet to be dropped, then bridge will ignore it

and give a chance to

Quoted 1 line

the upper layer to use it. Upper layer might be IP, or in your particular

setup, VLAN.

Quoted 4 lines

HTH,

      Nicolas.

Quoted 7 lines

Thank you very much for the ebtables hint.

I also tried to add the vlan to my bridge device but only droping the vlan tagged paket with ebtables got it working.

I'm not sure if this is the wanted behavior for bridging vlan actions. ..or my network setup is just to ..f%%%'ed up?!

What driver is in use with the NIC you are seeing this on?

#14 lore raw
Quoted 3 lines · Jesse Gross <jesse <at> nicira.com> writes:

What driver is in use with the NIC you are seeing this on?

He there

the device in question is (as lspci told)
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet (rev 10)

handled by kernel module r8169.

I also tried to set up the vlan on the bridge. like br0.3. but that did not work.

regards//chriss

#15 lore raw
Quoted 6 lines · chriss
Quoted 3 lines · Jesse Gross <jesse <at> nicira.com> writes:

What driver is in use with the NIC you are seeing this on?

Quoted 7 lines

He there

the device in question is (as lspci told)
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet (rev 10)

handled by kernel module r8169.

I'm guessing that you're hitting the special case in this code in r8169.c:rtl8169_vlan_rx_register():

         /*
          * Do not disable RxVlan on 8110SCd.
          */
         if (tp->vlgrp || (tp->mac_version == RTL_GIGA_MAC_VER_05))
                 tp->cp_cmd |= RxVlan;
         else
                 tp->cp_cmd &= ~RxVlan;

Since before you were getting the vlans directly off the device there was a vlan group configured. However, now that the packets are going through the bridge, the group is not being configured on the device and the tag gets dropped. Assuming that this is the case, the solution is to convert the driver to use the new vlan model, which does not require knowledge of the vlan group.

Can you confirm this by running tcpdump -eni br0? I would expect that you see the correct packets but without vlan tags.

#16 lore raw
Quoted 4 lines · Jesse Gross <jesse <at> nicira.com> writes:

Can you confirm this by running tcpdump -eni br0? I would expect that you see the correct packets but without vlan tags.

Thats correct. i see the packets in br0 without tags and tagged in eth1. thats why i added the brouting rule in ebtables to drop it at eth1 and the it apears in eth1.3 (untagged)...

#17 lore raw
Quoted 10 lines · chriss
Quoted 4 lines · Jesse Gross <jesse <at> nicira.com> writes:

Can you confirm this by running tcpdump -eni br0?  I would expect that you see the correct packets but without vlan tags.

Thats correct. i see the packets in br0 without tags and tagged in eth1. thats why i added the brouting rule in ebtables to drop it at eth1 and the it apears in eth1.3 (untagged)...

Putting a vlan device on eth1 actually affects the behavior of the driver, which is why that works. I suspect that if you put the vlan device on both the physical interface and the bridge you would see packets with tags on the bridge.

Regardless, the solution is to remove the dependency on vlan devices by converting over to the new vlan model. Francois, any chance that you might have some time to look at this?

#18 lore raw

Jesse Gross <[email protected]> :
[...]

Quoted 8 lines

Putting a vlan device on eth1 actually affects the behavior of the driver, which is why that works. I suspect that if you put the vlan device on both the physical interface and the bridge you would see packets with tags on the bridge.

Regardless, the solution is to remove the dependency on vlan devices by converting over to the new vlan model. Francois, any chance that you might have some time to look at this?

The completely untested patch below is available for the (really) desperate souls.

I should do a -next testing session this afternoon for this patch + Oliver's Neukum advertisement control + Hayes 8105e stuff (in reverse order).

drivers/net/Kconfig +0 -9
index 0382332..8e7da78 100644
@@ -2235,15 +2235,6 @@ config R8169
 	  To compile this driver as a module, choose M here: the module
 	  will be called r8169.  This is recommended.
 
-config R8169_VLAN
-	bool "VLAN support"
-	depends on R8169 && VLAN_8021Q
-	---help---
-	  Say Y here for the r8169 driver to support the functions required
-	  by the kernel 802.1Q code.
-
-	  If in doubt, say Y.
-
 config SB1250_MAC
 	tristate "SB1250 Gigabit Ethernet support"
 	depends on SIBYTE_SB1xxx_SOC
drivers/net/r8169.c +49 -61

191 lines not on this page · raw message

Reviewed-by
#19 lore raw
Quoted 11 lines · Francois Romieu

Jesse Gross <[email protected]> :
[...]

Quoted 8 lines

Putting a vlan device on eth1 actually affects the behavior of the driver, which is why that works.  I suspect that if you put the vlan device on both the physical interface and the bridge you would see packets with tags on the bridge.

Regardless, the solution is to remove the dependency on vlan devices by converting over to the new vlan model.  Francois, any chance that you might have some time to look at this?

Quoted 5 lines

The completely untested patch below is available for the (really) desperate souls.

I should do a -next testing session this afternoon for this patch + Oliver's Neukum advertisement control + Hayes 8105e stuff (in reverse order).

Thanks Francois. When you are ready this looks good to me.

#20 lore raw
In reply to Francois Romieu

Francois Romieu <[email protected]> :

Quoted 11 lines

Jesse Gross <[email protected]> :
[...]

Quoted 3 lines

Regardless, the solution is to remove the dependency on vlan devices by converting over to the new vlan model. Francois, any chance that you might have some time to look at this?

The completely untested patch below is available for the (really) desperate souls.

I should do a -next testing session this afternoon for this patch + Oliver's Neukum advertisement control + Hayes 8105e stuff (in reverse order).

It took a bit longer than expected but the patch seems to work.

Chriss, can you give it a try against current -rc / -git and see if it makes a difference ?

Signature · 1 line
Ueimor
#21 lore raw
Quoted 4 lines · Francois Romieu <romieu <at> fr.zoreil.com> writes:

Chriss, can you give it a try against current -rc / -git and see if it makes a difference ?

I hope i'm doing it right. i checked out the 'git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git'

and will try to apply the patch you provided. please correct me if i'm wrong. I will report back.

regards//chriss

#22 lore raw

chriss <[email protected]> :
[...]

Quoted 5 lines

I hope i'm doing it right. i checked out the 'git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git'

and will try to apply the patch you provided. please correct me if i'm wrong. I will report back.

I have tested it against davem's -next somewhere along -rc5 but it should be fine as well.

Signature · 1 line
Ueimor
#23 lore raw
Quoted 12 lines · Francois Romieu <romieu <at> fr.zoreil.com> writes:

chriss <mail_to_chriss <at> gmx.net> :
[...]

Quoted 5 lines

I hope i'm doing it right. i checked out the 'git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git'

and will try to apply the patch you provided. please correct me if i'm wrong. I will report back.

I have tested it against davem's -next somewhere along -rc5 but it should be fine as well.

My hat gows of to you kindly sir! Everything works as expected. im looking forward to see this patch in the stable releases.

thank you very much
//chriss

#24 lore raw
In reply to chriss
Quoted 27 lines · chriss
Quoted 4 lines · Jesse Gross <jesse <at> nicira.com> writes:

You should either attached a bridge to a vlan device or stack a vlan device on the bridge port depending on what you are trying to achieve.

Quoted 10 lines

The bridge handler takes all packets of the device that it is attached to, so having a vlan also attached to the same device will not work. You may get different results on older kernels depending on what NIC you were using but that was a bug.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo <at> vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hi and thanks for your reply

I tried that.

I had under 2.6.36.3 following combination:

eth1 in br0 -> all traffic without vlan id eth1.3 -> traffic with vlan 3

Quoted 6 lines

with 2.6.37 i should do the following eth1 in br0 -> traffic w/o vlans and br0.3 -> traffic with vlan id 3

But still there is no rx for vlan 3. Any suggestions? Or am i missing something?

That configuration should work (and I've tested it in the past). I would try running tcpdump on the various interfaces in the path (eth1, br0, br0.3) to see where traffic is flowing or not.