ethdev: reset unsupported stats
authorIntel <intel.com>
Wed, 18 Sep 2013 10:00:00 +0000 (12:00 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 9 Oct 2013 14:14:52 +0000 (16:14 +0200)
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

index 7bbc66e..fbe2286 100644 (file)
@@ -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);