Bug 681973 - virsh domifstat results do not match that of netstat -i
Summary: virsh domifstat results do not match that of netstat -i
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.5
Hardware: i686
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-03 18:27 UTC by John Tavares
Modified: 2011-03-04 10:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-04 10:42:27 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description John Tavares 2011-03-03 18:27:29 UTC
Description of problem:
It appears as thought virsh domifstat is reporting all the rx_* metrics using the results the corresponding tx_* values and vice versa.

Version-Release number of selected component (if applicable):
I found this on RHEL 5.5

# cat /etc/*-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

# virsh version
Compiled against library: libvir 0.6.3
Using library: libvir 0.6.3
Using API: QEMU 0.6.3
Running hypervisor: QEMU 0.9.1

and every other previous version I have tried.

How reproducible:
Compare the results of netstat -i to that the virsh domifstat on any Xen/KVM Dom0 and compare the results

Steps to Reproduce:
1.Log onto Xen/Dom0
2.Run netstat -i
3.Run virsh domifstat on any virtual network
4.Compare results
  
Actual results:
# netstat -i | grep vnet10
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
vnet10     1500   0  6290598      0      0      0 402479772      0      0     24 BMRU

# virsh domifstat 10 vnet10
vnet10 rx_bytes 26160407282
vnet10 rx_packets 402478167
vnet10 rx_errs 0
vnet10 rx_drop 0
vnet10 tx_bytes 1513645419
vnet10 tx_packets 6290561
vnet10 tx_errs 0
vnet10 tx_drop 0


Expected results:
# netstat -i
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
vnet10     1500   0  6290598      0      0      0 402479772      0      0     24 BMRU

# virsh domifstat 10 vnet10
vnet10 rx_bytes 1513645419 
vnet10 rx_packets 6290561 
vnet10 rx_errs 0
vnet10 rx_drop 0
vnet10 tx_bytes 26160407282
vnet10 tx_packets 402478167
vnet10 tx_errs 0
vnet10 tx_drop 0

Additional info:
I have been able to reproduce this on all previous versions of virsh I could find.

Comment 1 Daniel Berrangé 2011-03-04 10:42:27 UTC
libvirt *is* actually reporting correctly here.  The 'vnet0' device seen in the host OS, is the backend of the 'eth0' device seen in the guest. Anything that the vnet0 reports as 'tx' is seen by the guest eth0 as 'rx', and vica-verca.  libvirt reports the stats from the guest eth0 POV, not the vnet0 POV.


Note You need to log in before you can comment on or make changes to this bug.