From: Patrick McHardy <kaber@trash.net>
To: Or Gerlitz <ogerlitz@voltaire.com>
Cc: netdev@vger.kernel.org
Subject: Re: difference in counters values between vlan and parent device
Date: Mon, 29 Jun 2009 16:37:05 +0200 [thread overview]
Message-ID: <4A48D191.9020903@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0906291654310.27208@zuben.voltaire.com>
Or Gerlitz wrote:
> I noticed that the rx byte counters for 8021q/vlan devices are showing lower
> quantities then the parent device. Below are three cuts of /proc/net/dev
> where one can see clearly that after running unidirectional traffic over
> the vlan the vlan TX packet/byte counters follow well the parent counters,
> where after running bidirectional traffic the parent RX byte counters are
> 30% (30M vs 22M) higher, the packet counters follow the parent.
>
> Now, looking in net/8021q/vlan_dev.c :: vlan_skb_recv() I see this code,
>
> stats->rx_packets++;
> stats->rx_bytes += skb->len;
>
> I understand that skb->len as seen by the parent device may be different
> then the len seen by 8021q but I don't see how it can account to 30%.
>
> For what it worth, this is 2.6.30
>
> Or.
>
> 1. both devices are fresh, just loaded the NIC driver (igb) and then setup a vlan
>
> Inter-| Receive | Transmit
> face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
> eth1: 0 0 0 0 0 0 0 0 14456 55 0 0 0 0 0 0
> eth1.4001: 0 0 0 0 0 0 0 0 6434 23 0 0 0 0 0 0
>
> 2. after running unidirectional traffic over the vlan (netperf UDP_STREAM)
>
> Inter-| Receive | Transmit
> face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
> eth1: 1644 11 0 0 0 0 0 0 1136967388 17764927 0 0 0 0 0 0
> eth1.4001: 1490 11 0 0 0 0 0 0 1136959282 17764893 0 0 0 0 0 0
>
> 3. after running bidirectional traffic over the vlan (netperf UDP_RR)
>
> Inter-| Receive | Transmit
> face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
> eth1:30611926 546614 0 0 0 0 0 0 1160471756 18311532 0 0 0 0 0 0
> eth1.4001:22959330 546614 0 0 0 0 0 0 1160463650 18311498 0 0 0 0 0 0
>
So the average packet size is 56 bytes on eth1 and 42 bytes
on eth1.4001. So the difference is 14 bytes, which is expected
since the mac header is pulled off before delivery to the
VLAN device.
next prev parent reply other threads:[~2009-06-29 14:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 14:16 difference in counters values between vlan and parent device Or Gerlitz
2009-06-29 14:37 ` Patrick McHardy [this message]
2009-06-29 15:05 ` Or Gerlitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A48D191.9020903@trash.net \
--to=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@voltaire.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).