netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* difference in counters values between vlan and parent device
@ 2009-06-29 14:16 Or Gerlitz
  2009-06-29 14:37 ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Or Gerlitz @ 2009-06-29 14:16 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netdev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-29 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-29 14:16 difference in counters values between vlan and parent device Or Gerlitz
2009-06-29 14:37 ` Patrick McHardy
2009-06-29 15:05   ` Or Gerlitz

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).