Thread (171 messages) 171 messages, 14 authors, 2017-03-29

Re: [PATCH v3 13/16] net/avp: device statistics operations

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2017-03-02 00:35:33

On Wed, 1 Mar 2017 19:20:05 -0500
Allain Legacy [off-list ref] wrote:
+static void
+avp_dev_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats)
+{
+	struct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	unsigned int i;
+
+	memset(stats, 0, sizeof(*stats));
Memset here is unnecessary since only caller is rte_eth_stats_get()
which already did memset

int
rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
{
	struct rte_eth_dev *dev;

	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);

	dev = &rte_eth_devices[port_id];
	memset(stats, 0, sizeof(*stats));

	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
	(*dev->dev_ops->stats_get)(dev, stats);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help