DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] virtio: Fix stats issue
@ 2015-03-23  6:56 Ouyang Changchun
  2015-03-23  7:20 ` David Marchand
  0 siblings, 1 reply; 7+ messages in thread
From: Ouyang Changchun @ 2015-03-23  6:56 UTC (permalink / raw)
  To: dev

It need clear/reset the stats information before count in all queues data.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
 lib/librte_pmd_virtio/virtio_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c
index 603be2d..e4cb55e 100644
--- a/lib/librte_pmd_virtio/virtio_ethdev.c
+++ b/lib/librte_pmd_virtio/virtio_ethdev.c
@@ -572,6 +572,10 @@ virtio_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
 	unsigned i;
 
+	stats->opackets = 0;
+	stats->obytes = 0;
+	stats->oerrors = 0;
+
 	for (i = 0; i < dev->data->nb_tx_queues; i++) {
 		const struct virtqueue *txvq = dev->data->tx_queues[i];
 		if (txvq == NULL)
@@ -587,6 +591,10 @@ virtio_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		}
 	}
 
+	stats->ipackets = 0;
+	stats->ibytes = 0;
+	stats->ierrors = 0;
+
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		const struct virtqueue *rxvq = dev->data->rx_queues[i];
 		if (rxvq == NULL)
-- 
1.8.4.2

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

end of thread, other threads:[~2015-03-27 15:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23  6:56 [dpdk-dev] [PATCH] virtio: Fix stats issue Ouyang Changchun
2015-03-23  7:20 ` David Marchand
2015-03-23  8:38   ` Ouyang, Changchun
2015-03-23 10:42     ` Thomas Monjalon
2015-03-23 22:53       ` Stephen Hemminger
2015-03-27 14:26       ` Ouyang, Changchun
2015-03-27 15:25         ` 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).