net/i40e: fix clear xstats bug in vf port
PATCH v2 1/2 net/i40e: fix clear xstats bug in vf port
From: root <[email protected]>
There is a bug in vf clear xstats command, it do not record the statics data in offset struct member.So, vf need to keep record of xstats data from pf and update the statics according to offset.
Fixes da61cd0849766 ("i40evf: add extended stats")
Signed-off-by Wei Zhao <[email protected]>
---
Changes in v2:
fix patch log check warning.
--- app/test-pmd/config.c | 6 ++-- drivers/net/i40e/i40e_ethdev_vf.c | 64 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 3 deletions(-)
app/test-pmd/config.c +4 -2
@@ -203,8 +203,10 @@ nic_stats_display(portid_t port_id)if (diff_cycles >0 ) diff_cycles = prev_cycles[port_id] - diff_cycles; - diff_pkts_rx = stats.ipackets - prev_pkts_rx[port_id]; - diff_pkts_tx = stats.opackets - prev_pkts_tx[port_id]; + diff_pkts_rx = (stats.ipackets > prev_pkts_rx[port_id]) ? + (stats.ipackets - prev_pkts_rx[port_id]) :0 ; + diff_pkts_tx = (stats.opackets > prev_pkts_tx[port_id]) ? + (stats.opackets - prev_pkts_tx[port_id]) :0 ; prev_pkts_rx[port_id] = stats.ipackets; prev_pkts_tx[port_id] = stats.opackets; mpps_rx = diff_cycles > 0 ?
drivers/net/i40e/i40e_ethdev_vf.c +63 -1
98 lines not on this page · raw message
Signature · 1 line
2.9.3