mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
e1000e: Fix tx/rx counters
The bytes and packets counter registers are cleared on read. Copying the "total counter" registers to the "good counter" registers has side effects. If the "total" register is never read by the OS, it only gets incremented. This leads to exponential growth of the "good" register. This commit increments the counters individually to avoid this. Signed-off-by: Timothée Cocault <timothee.cocault@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
886c0453cb
commit
8d689f6aae
4 changed files with 8 additions and 12 deletions
|
@ -711,9 +711,8 @@ e1000e_on_tx_done_update_stats(E1000ECore *core, struct NetTxPkt *tx_pkt)
|
|||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
core->mac[GPTC] = core->mac[TPT];
|
||||
core->mac[GOTCL] = core->mac[TOTL];
|
||||
core->mac[GOTCH] = core->mac[TOTH];
|
||||
e1000x_inc_reg_if_not_full(core->mac, GPTC);
|
||||
e1000x_grow_8reg_if_not_full(core->mac, GOTCL, tot_len);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue