[dpdk-dev] [PATCH v3 13/16] net/avp: device statistics operations

Stephen Hemminger stephen at networkplumber.org
Thu Mar 2 01:35:25 CET 2017


On Wed, 1 Mar 2017 19:20:05 -0500
Allain Legacy <allain.legacy at windriver.com> 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);


More information about the dev mailing list