Date: Tue, 15 Aug 2000 14:51:05 +1000 (EST) From: peter.jeremy@alcatel.com.au To: FreeBSD-gnats-submit@freebsd.org Subject: kern/20611: VLAN parent device does not count VLAN output bytes Message-ID: <00Aug15.145110est.115224@border.alcanet.com.au>
next in thread | raw e-mail | index | archive | help
>Number: 20611 >Category: kern >Synopsis: VLAN parent device does not count VLAN output bytes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 14 22:00:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Peter Jeremy >Release: FreeBSD 4.1-STABLE i386 >Organization: Alcatel Australia Limited >Environment: `current' -stable >Description: 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 >Fix: Index: if_vlan.c =================================================================== RCS file: /gsmx07/CVSROOT/src/sys/net/if_vlan.c,v retrieving revision 1.15.2.2 diff -u -r1.15.2.2 if_vlan.c --- if_vlan.c 2000/07/17 21:24:34 1.15.2.2 +++ if_vlan.c 2000/08/15 04:47:01 @@ -268,6 +268,9 @@ m_freem(m); continue; } + p->if_obytes += m->m_pkthdr.len; + if (m->m_flags & M_MCAST) + p->if_omcasts++; IF_ENQUEUE(&p->if_snd, m); if ((p->if_flags & IFF_OACTIVE) == 0) { p->if_start(p); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00Aug15.145110est.115224>