DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/vhost: report TX errors in port stats
@ 2023-09-30  1:00 Andrey Ignatov
  2023-10-06  7:05 ` Maxime Coquelin
  2023-10-12 13:49 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Ignatov @ 2023-09-30  1:00 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia, Wei Shen, Andrey Ignatov

vhost device doesn't report TX errors what complicates debugging of
dropped packets. Add oerrors to port stats.

- before (testpmd `show port stats`):
  TX-packets: 18328512   TX-errors: 0          TX-bytes:  1173024768

- after:
  TX-packets: 1737728    TX-errors: 131367616  TX-bytes:  111214592

Signed-off-by: Andrey Ignatov <rdna@apple.com>
---
 drivers/net/vhost/rte_eth_vhost.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 8d37ec9775..48a9a79efe 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1299,6 +1299,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	unsigned i;
 	unsigned long rx_total = 0, tx_total = 0;
 	unsigned long rx_total_bytes = 0, tx_total_bytes = 0;
+	unsigned long tx_total_errors = 0;
 	struct vhost_queue *vq;
 
 	for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS &&
@@ -1323,12 +1324,15 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 		stats->q_obytes[i] = vq->stats.bytes;
 		tx_total_bytes += stats->q_obytes[i];
+
+		tx_total_errors += vq->stats.missed_pkts;
 	}
 
 	stats->ipackets = rx_total;
 	stats->opackets = tx_total;
 	stats->ibytes = rx_total_bytes;
 	stats->obytes = tx_total_bytes;
+	stats->oerrors = tx_total_errors;
 
 	return 0;
 }
-- 
2.37.3


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

end of thread, other threads:[~2023-10-12 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-30  1:00 [PATCH] net/vhost: report TX errors in port stats Andrey Ignatov
2023-10-06  7:05 ` Maxime Coquelin
2023-10-12 13:49 ` Maxime Coquelin

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).