Subject: Re: VLAN and the "real" interface vs accounting
To: None <tech-net@netbsd.org>
From: David Young <dyoung@ojctech.com>
List: tech-net
Date: 08/25/2002 19:11:50
Should you increase the bytes-output statistic before vlan calls if_start,
by analogy to ether_output?  That is should you add the line I mark to
this code fragment from vlan_start?

                IFQ_ENQUEUE(&p->if_snd, m, &pktattr, error);
                if (error) {
                        /* mbuf is already freed */
                        ifp->if_oerrors++;
                        continue;
                }

>               ifp->if_obytes += m->m_pkthdr.len;
                ifp->if_opackets++;
                if ((p->if_flags & IFF_OACTIVE) == 0)
                        (*p->if_start)(p);

Possibly some more statistics deserve to be counted, too.

Dave

On Sun, Aug 25, 2002 at 04:22:34PM -0700, Michael Graff wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I have two vlans on my physical fxp0.  I see that netstat shows bytes
> coming into fxp0, but nothing going out.  The vlans are doing what
> appears to be correct accounting.
> 
> I suspect the right thing to do is to move the output accounting for
> the physcial interface, so it will have accurate (aggregate) stats.
> This would make it harder to do untaged and tagged on the same
> interface, but is anyone routinely doing that?
> 
> - --Michael
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (NetBSD)
> Comment: See http://www.flame.org/~explorer/pgp for my keys
> 
> iD8DBQE9aWa6l6Nz7kJWYWYRAnROAJsFnUUWK4OV02OJRputOO+ka9HwIgCfc3/D
> 1j0B75/4alzqDl8BJeVz71E=
> =MT8m
> -----END PGP SIGNATURE-----

-- 
David Young             OJC Technologies
dyoung@onthejob.net     Engineering from the Right Brain
                        Urbana, IL * (217) 278-3933