[ovs-dev] [PATCH] Add VLAN splinters unit test.
Ben Pfaff
blp at nicira.com
Tue Jun 25 00:03:15 UTC 2013
On Mon, Jun 24, 2013 at 03:56:31PM -0700, Alex Wang wrote:
> 1. What is usually the bug in the buggy driver? How can using vlan-splinter
> avoid that? I'm a bit confused here, since the "vlandev.c" code still talks
> to linux device driver (e.g. when creating ADD_VLAN_CMD) via the "ioctl"
> call.
ovs-vlan-bug-workaround(8) has a lot of information:
Some Linux network drivers support a feature called ``VLAN accelera‐
tion''. VLAN acceleration is associated with a data structure called a
vlan_group that is, abstractly, a dictionary that maps from a VLAN ID
(in the range 0 to 4095) to a VLAN device, that is, a Linux network
device associated with a particular VLAN, e.g. eth0.9 for VLAN 9 on
eth0.
Some drivers that support VLAN acceleration have bugs that fall roughly
into the categories listed below. ovs-vlan-test(8) can test for these
driver bugs.
· When NICs use VLAN stripping on receive they must pass a pointer
to a vlan_group when reporting the stripped tag to the network‐
ing core. If no vlan_group is in use then some drivers just
drop the extracted tag. Drivers are supposed to only enable
stripping if a vlan_group is registered but not all of them do
that.
· On receive, some drivers handle priority tagged packets spe‐
cially and don't pass the tag onto the network stack at all, so
Open vSwitch never has a chance to see it.
· Some drivers size their receive buffers based on whether a
vlan_group is enabled, meaning that a maximum size packet with a
VLAN tag will not fit if no vlan_group is configured.
· On transmit, some drivers expect that VLAN acceleration will be
used if it is available, which can only be done if a vlan_group
is configured. In these cases, the driver may fail to parse the
packet and correctly setup checksum offloading or TSO.
The correct long term solution is to fix these driver bugs.
For now, ovs-vlan-bug-workaround can enable a special-purpose work‐
around for devices with buggy VLAN acceleration. A kernel patch must
be applied for this workaround to work.
> 2. If vlan-splinter is not used, the vswitchd will learn the vlan
> configuration from the packets and record them in the learning table. right?
If the driver is buggy, then the packets won't have the right
information and vswitchd won't be able to compensate for it.
More information about the dev
mailing list