The calculation of truncated packets didn't take into account packet
errors due to the adapter not having buffers, causing both the
ipackets, and imissed counts to be wrong if such errors occurred. In
order to properly calculate the number of packets truncated, we need
to subtract the count of errors due to no buffers.
Fixes:
c44d9f01adf3 ("net/enic: count truncated packets")
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
* which can make ibytes be slightly higher than it should be.
*/
rx_packet_errors = rte_atomic64_read(&soft_stats->rx_packet_errors);
- rx_truncated = rx_packet_errors - stats->rx.rx_errors;
+ rx_truncated = rx_packet_errors - stats->rx.rx_errors -
+ stats->rx.rx_no_bufs;
r_stats->ipackets = stats->rx.rx_frames_ok - rx_truncated;
r_stats->opackets = stats->tx.tx_frames_ok;