VLAN vs bridging receive precedence
Subsystems (2)
When a physical device is attached to a bridge device and also to one or more VLAN devices, received tagged frames might be passed on to either the appropriate VLAN device or to the bridge.
Drivers that support VLAN receive acceleration call __vlan_hwaccel_rx(), which updates skb->dev to point to the VLAN device.
In the absence of VLAN receive acceleration, 802.1q is treated as just another protocol, and netif_receive_skb() does:
skb = handle_bridge(skb, &pt_prev, &ret, orig_dev);
if (!skb)
goto out;
...
type = skb->protocol;
list_for_each_entry_rcu(ptype,
&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
...
}So the bridge device claims the skb before the VLAN code has a chance to.
It is not clear which behaviour is 'correct'. However it appears that the XenCenter network management software currently depends on the accelerated behaviour.
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.
Quoted 4 lines · Ben Hutchings
It is not clear which behaviour is 'correct'. However it appears that the XenCenter network management software currently depends on the accelerated behaviour.
My question would be why would you have both VLAN and bridging on the same physical interface in the first place?
These two configurations are well-defined and work as expected:
1) Bridging after VLAN: The bridge only includes the VLAN device, ethX.Y, not the physical ethX.
2) VLAN after bridging: The VLAN should be linked to the bridge device, i.e., brX.Y, and not the physical ethX.
So what exactly is the admin trying to achieve here?
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 9 lines · Herbert Xu
Quoted 4 lines · Ben Hutchings
It is not clear which behaviour is 'correct'. However it appears that the XenCenter network management software currently depends on the accelerated behaviour.
My question would be why would you have both VLAN and bridging on the same physical interface in the first place?
Quoted 8 lines
These two configurations are well-defined and work as expected:
1) Bridging after VLAN: The bridge only includes the VLAN device, ethX.Y, not the physical ethX.
2) VLAN after bridging: The VLAN should be linked to the bridge device, i.e., brX.Y, and not the physical ethX.So what exactly is the admin trying to achieve here?
The administrator might just be trying to bridge a VLAN to a guest.
XenCenter attaches a bridge interface ('Network') to each NIC. The administrator can define additional Networks which are associated with VLANs on specific NICs; for each of these it attaches a VLAN interface to the physical interface and a bridge interface to the VLAN interface.
Ideally people wouldn't mix tagged and untagged traffic, and then XenCenter could refuse to bridge both a physical interface and a VLAN attached to it. In practice, people do mix them, and I think we need to work out what the proper semantics are.
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.
On Fri, Jan 22, 2010 at 05:11:42PM +0000, Ben Hutchings wrote:
.
Quoted 6 lines
The administrator might just be trying to bridge a VLAN to a guest.
XenCenter attaches a bridge interface ('Network') to each NIC. The administrator can define additional Networks which are associated with VLANs on specific NICs; for each of these it attaches a VLAN interface to the physical interface and a bridge interface to the VLAN interface.
But that should work perfectly. The problem here is that the bridge is being attached to the physical interface, no?
Quoted 4 lines
Ideally people wouldn't mix tagged and untagged traffic, and then XenCenter could refuse to bridge both a physical interface and a VLAN attached to it. In practice, people do mix them, and I think we need to work out what the proper semantics are.
Mixing should work as well, as long as you don't attach both bridging and VLAN to the physical interface.
Cheeers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 11 lines · Herbert Xu
On Fri, Jan 22, 2010 at 05:11:42PM +0000, Ben Hutchings wrote:
.Quoted 6 lines
The administrator might just be trying to bridge a VLAN to a guest.
XenCenter attaches a bridge interface ('Network') to each NIC. The administrator can define additional Networks which are associated with VLANs on specific NICs; for each of these it attaches a VLAN interface to the physical interface and a bridge interface to the VLAN interface.
But that should work perfectly. The problem here is that the bridge is being attached to the physical interface, no?
As I said, it attaches a bridge interface to each NIC (physical interface) to start with - whether or not the administrator chooses to bridge the NIC to any guest interfaces. So it doesn't work without VLAN receive acceleration.
Quoted 7 lines
Quoted 4 lines
Ideally people wouldn't mix tagged and untagged traffic, and then XenCenter could refuse to bridge both a physical interface and a VLAN attached to it. In practice, people do mix them, and I think we need to work out what the proper semantics are.
Mixing should work as well, as long as you don't attach both bridging and VLAN to the physical interface.
And if you are going to mix them, on a virtualised server you may want to bridge them both to guests, separately. That seems to require either that a VLAN interface and a bridge interface can be attached to the physical interface, with the VLAN interface taking precedence on receive; or that a virtual interface accepting only untagged traffic can be attached to the physical interface.
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.
On Fri, Jan 22, 2010 at 08:34:56PM +0000, Ben Hutchings wrote:
.
Quoted 4 lines
As I said, it attaches a bridge interface to each NIC (physical interface) to start with - whether or not the administrator chooses to bridge the NIC to any guest interfaces. So it doesn't work without VLAN receive acceleration.
That should work fine, as long as it doesn't also attach a VLAN device to the same physical device. The VLAN device should instead be attached to the bridge device.
No you won't get VLAN acceleration, but really the cost wouldn't be worth it anyway.
Quoted 6 lines
And if you are going to mix them, on a virtualised server you may want to bridge them both to guests, separately. That seems to require either that a VLAN interface and a bridge interface can be attached to the physical interface, with the VLAN interface taking precedence on receive; or that a virtual interface accepting only untagged traffic can be attached to the physical interface.
You mean you want to bridge both the physical device and VLAN devices on top of it? Again it works fine if you set it up right. You first create a bridge which includes the physical device, then you add a VLAN on top of the bridge, and not the physical device, finally you bridge that VLAN device.
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt