From 02331c16ec0ba97b4716ddc4a68d2b3c1f15da0b Mon Sep 17 00:00:00 2001 From: Intel Date: Wed, 18 Sep 2013 12:00:00 +0200 Subject: [PATCH] ethdev: reset unsupported stats Initialize statistics structure to 0 before passing it to the PMD. This way, the unsupported fields will be 0. Signed-off-by: Intel --- lib/librte_ether/rte_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 7bbc66e559..fbe2286895 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -964,6 +964,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) return; } dev = &rte_eth_devices[port_id]; + memset(stats, 0, sizeof(*stats)); FUNC_PTR_OR_RET(*dev->dev_ops->stats_get); (*dev->dev_ops->stats_get)(dev, stats); -- 2.20.1