diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2020-07-07 01:36:50 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2020-07-07 01:36:50 +0000 |
commit | 2ec85f72334b2b2fb8da586a9719f45c6e75596b (patch) | |
tree | a74c118dcc0e0b3de8e181979b9a7eee4cf73af4 /usr.sbin | |
parent | f435648b783901fc6f430e780bc7c8e0ea202f7c (diff) |
add kstat support for reading the "hardware" counters for each ring.
the counters happen to be a series of uint64_t values in memory,
so we treat them as arrays that get mapped to a series of kstat_kv
structs that are set up as 64 bit counters with either packet or
byte counters as appropriate. this helps keep the code size down.
while we export the counters as separate kstats per rx and tx ring,
you request an update from the hypervisor at the controller level.
this code ratelimits these requests to 1 per second per interface
to try and debounce this a bit so each kstat read doesnt cause a
vmexit.
here's an example of the stats. note that we get to see how many
packets that rx ring moderation drops for the first time. see the
"no buffers" stat.
vmx0:0:rxq:5
packets: 2372483 packets
bytes: 3591909057 bytes
qdrops: 0 packets
errors: 0 packets
qlen: 0 packets
...
vmx0:0:txq:5
packets: 1316856 packets
bytes: 86961577 bytes
qdrops: 0 packets
errors: 0 packets
qlen: 1 packets
maxqlen: 512 packets
oactive: false
...
vmx0:0:vmx-rxstats:5
LRO packets: 0 packets
LRO bytes: 0 bytes
ucast packets: 2372483 packets
ucast bytes: 3591909053 bytes
mcast packets: 0 packets
mcast bytes: 0 bytes
bcast packets: 0 packets
bcast bytes: 0 bytes
no buffers: 696 packets
errors: 0 packets
...
vmx0:0:vmx-txstats:5
TSO packets: 0 packets
TSO bytes: 0 bytes
ucast packets: 1316839 packets
ucast bytes: 86960455 bytes
mcast packets: 0 packets
mcast bytes: 0 bytes
bcast packets: 0 packets
bcast bytes: 0 bytes
errors: 0 packets
discards: 0 packets
Diffstat (limited to 'usr.sbin')
0 files changed, 0 insertions, 0 deletions