From: Andrey Ignatov <rdna@apple.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbo.xia@intel.com>, Wei Shen <wshen0123@apple.com>,
Andrey Ignatov <rdna@apple.com>
Subject: [PATCH] net/vhost: report TX errors in port stats
Date: Fri, 29 Sep 2023 18:00:24 -0700 [thread overview]
Message-ID: <20230930010024.34377-1-rdna@apple.com> (raw)
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
next reply other threads:[~2023-09-30 1:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-30 1:00 Andrey Ignatov [this message]
2023-10-06 7:05 ` Maxime Coquelin
2023-10-12 13:49 ` Maxime Coquelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230930010024.34377-1-rdna@apple.com \
--to=rdna@apple.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=wshen0123@apple.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).