* Some statistics are computed as A - B where A and B each increase * monotonically with some hardware counter(s) and the counters are read * asynchronously. * * If packet X is counted in A, but not counted in B yet, computed value is * greater than real. * * If packet X is not counted in A at the moment of reading the counter, * but counted in B at the moment of reading the counter, compu
| 670 | * the case when the MAC stats are zeroed as a result of a NIC reset. |
| 671 | */ |
| 672 | static void |
| 673 | sfc_update_diff_stat(uint64_t *stat, uint64_t newval) |
| 674 | { |
| 675 | if ((int64_t)(newval - *stat) > 0 || newval == 0) |
| 676 | *stat = newval; |
| 677 | } |
| 678 | |
| 679 | static int |
| 680 | sfc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) |