summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNelson Escobar <neescoba@cisco.com>2016-07-13 09:52:34 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-15 23:37:13 +0200
commitd142e1ac10893b7a5b0240809325ac737237a57a (patch)
treef8c85bccc34cd637786cc40f61c95ff65795c5f4 /drivers
parent837e68ae94a2db471c7e1c158bab5517d9a408fc (diff)
downloaddpdk-d142e1ac10893b7a5b0240809325ac737237a57a.zip
dpdk-d142e1ac10893b7a5b0240809325ac737237a57a.tar.gz
dpdk-d142e1ac10893b7a5b0240809325ac737237a57a.tar.xz
net/enic: fix calculation of truncated packets
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/enic/enic_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index d117f30..329559a 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -172,7 +172,8 @@ void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
* 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;