FreeBSD em driver overwrites incoming vlan tagged frames 802.1p priority field
Code:
# ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=20db<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,POLLING,VLAN_HWCSUM,WOL_MAGIC>
ether 00:07:e9:a5:9b:fa
media: Ethernet autoselect (1000baseTX <full-duplex>)
status: active
# tcpdump -nni em0 -ve -l | grep --color ', p '
tcpdump: WARNING: em0: no IPv4 address assigned
tcpdump: listening on em0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:51:50.654610 00:07:e9:a5:9b:fa > 2c:21:72:c6:c1:88, ethertype 802.1Q (0x8100), length 190: vlan 10, p 0, ethertype IPv4, (tos 0x10, ttl 64, id 22972, offset 0, flags [DF], proto TCP (6), length 172)
15:51:50.658896 2c:21:72:c6:c1:88 > 01:00:5e:00:00:05, ethertype 802.1Q (0x8100), length 98: vlan 10, p 0, ethertype IPv4, (tos 0xc0, ttl 1, id 40899, offset 0, flags [none], proto OSPF (89), length 80)
15:51:50.685883 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 60: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 114, id 17349, offset 0, flags [DF], proto TCP (6), length 40)
15:51:50.808874 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 60: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 114, id 17362, offset 0, flags [DF], proto TCP (6), length 40)
15:51:50.816865 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 60: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 114, id 17363, offset 0, flags [DF], proto TCP (6), length 40)
All packets received by the FreeBSD kernel from the em0 card have the vlan priority 802.1p field set to 0 (vlan 10, p 0).
Disabling vlan hardware tagging on em0, shows the actual priority of the frames:
Code:
# ifconfig em0 -vlanhwtag
# ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=20cb<RXCSUM,TXCSUM,VLAN_MTU,POLLING,VLAN_HWCSUM,WOL_MAGIC>
ether 00:07:e9:a5:9b:fa
media: Ethernet autoselect (1000baseTX <full-duplex>)
status: active
# tcpdump -nni em0 -ve -l | grep --color ', p '
tcpdump: WARNING: em0: no IPv4 address assigned
tcpdump: listening on em0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:58:00.635855 00:07:e9:a5:9b:fa > 2c:21:72:c6:c1:88, ethertype 802.1Q (0x8100), length 190: vlan 10, p 0, ethertype IPv4, (tos 0x10, ttl 64, id 25387, offset 0, flags [DF], proto TCP (6), length 172)
15:58:00.668627 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 60: vlan 10, p 2, ethertype IPv4, (tos 0x0, ttl 114, id 44052, offset 0, flags [DF], proto TCP (6), length 40)
15:58:00.842601 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 60: vlan 10, p 2, ethertype IPv4, (tos 0x0, ttl 114, id 44065, offset 0, flags [DF], proto TCP (6), length 40)
15:58:01.003578 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 94: vlan 10, p 2, ethertype IPv4, (tos 0x0, ttl 114, id 44073, offset 0, flags [DF], proto TCP (6), length 76)
15:58:01.528516 2c:21:72:c6:c1:88 > 00:07:e9:a5:9b:fa, ethertype 802.1Q (0x8100), length 81: vlan 10, p 2, ethertype IPv4, (tos 0x0, ttl 254, id 59756, offset 0, flags [none], proto UDP (17), length 63)
Priority 2 == 010 which means "Excellent Effort" (
http://en.wikipedia.org/wiki/IEEE_P802.1p).