[Bug 273431] No PCP (priority code point) on outbound traffic via em(4) when PCP and hardware VLAN tag insertion is disabled

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 30 Aug 2023 02:07:16 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273431

            Bug ID: 273431
           Summary: No PCP (priority code point) on outbound traffic via
                    em(4) when PCP and hardware VLAN tag insertion is
                    disabled
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: zlei@FreeBSD.org

This is a crafted bug from WIP fix https://reviews.freebsd.org/D39536.

A setup:

em0 <---> igc0

Steps to repeat:

Capture on igc0
```
# ifconfig igc0 up
# tcpdump -nevi igc0
```

Disable PCP and hardware VLAN tag insertion, then send packets with priority
```
# ifconfig em0 -vlanhwtag -pcp
# ifconfig em0 inet 192.0.2.1/24
# arp -s 192.0.2.2 0:1:2:3:4:5
# ping -c1 -C3 192.0.2.2
```

Packets captured on igc0:
```
09:53:57.397415 00:0c:29:73:4f:98 > 00:01:02:03:04:05, ethertype IPv4 (0x0800),
length 98: (tos 0x0, ttl 64, id 19249, offset 0, flags [none], proto ICMP (1),
length 84)
    192.0.2.1 > 192.0.2.2: ICMP echo request, id 5382, seq 0, length 64
```

When either hardware VLAN tag insertion is enabled, or enable default PCP on
interface
```
# ifconfig em0 vlanhwtag
### or
# ifconfig em0 pcp 0
```

then the outbound packets looks good:
```
10:00:03.189436 00:0c:29:73:4f:98 > 00:01:02:03:04:05, ethertype 802.1Q
(0x8100), length 102: vlan 0, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 33532,
offset 0, flags [none], proto ICMP (1), length 84)
    192.0.2.1 > 192.0.2.2: ICMP echo request, id 6662, seq 0, length 64

10:02:17.070757 00:0c:29:73:4f:98 > 00:01:02:03:04:05, ethertype 802.1Q
(0x8100), length 102: vlan 0, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 19250,
offset 0, flags [none], proto ICMP (1), length 84)
    192.0.2.1 > 192.0.2.2: ICMP echo request, id 8198, seq 0, length 64
```


Expected behavior: outbound traffic should always have priority when
application requires.

-- 
You are receiving this mail because:
You are the assignee for the bug.