| Summary: | VLAN parent device does not count VLAN output bytes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | peter.jeremy <peter.jeremy> | ||||
| Component: | kern | Assignee: | Yar Tikhiy <yar> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.1-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
State Changed From-To: open->feedback The bug has been fixed in -stable, and it no longer exists in -current due to some changes. Please check if the fix works. Responsible Changed From-To: freebsd-bugs->yar Over to the committer who deals with the problem (me) State Changed From-To: feedback->closed The bug has been fixed. The originator hasn't provided feedback for two months. |
Each network device includes counters for bytes and packets in and out. For a physical interface associated with a VLAN interface, incoming and outgoing packets, as well as incoming bytes associated with the VLAN are counted, but outgoing bytes from the VLAN are not counted. This is inconsistent. The problem is that output bytes are accumulated by ether_output_frame(). Packets sent to the VLAN go through this routine - which calls vlan_start() to process the packet. vlan_start() directly calls the XX_start() routine associated with the physical interface. vlan_start() replicates the relevant code within ether_output_frame(), but does not update the output byte count. Likewise, the number of multicast frames sent via the VLAN are not counted. (There's also no support for bridging packets into an 802.1Q VLAN trunk. Fixing this looks non-trivial, and I don't need this functionality, so I'll skip it). How-To-Repeat: Create (eg) vlan0 associated with (eg) fxp0 and pass traffic via vlan0 (with no traffic addressed directly to fxp0). A netstat shows: wansim# netstat -I fxp0 1 input (fxp0) output packets errs bytes packets errs bytes colls 564 0 78690 586 0 0 0 506 0 81024 521 0 0 0 504 0 84068 519 0 0 0 509 0 100559 530 0 0 0 532 0 85011 557 0 0 0 ^C