DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/enic: fix calculation of truncated packets
@ 2016-07-13 16:52 Nelson Escobar
  2016-07-15 21:32 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson Escobar @ 2016-07-13 16:52 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Nelson Escobar

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>
---
 drivers/net/enic/enic_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index d8669cc..9ec2a2d 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;
-- 
2.7.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-15 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 16:52 [dpdk-dev] [PATCH] net/enic: fix calculation of truncated packets Nelson Escobar
2016-07-15 21:32 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).