src/dpdk/drivers/net/mlx5/mlx5_stats.c
int
mlx5_stats_reset(struct rte_eth_dev *dev)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	struct mlx5_stats_ctrl *stats_ctrl = &priv->stats_ctrl;
	unsigned int i;

	for (i = 0; (i != priv->rxqs_n); ++i) {
		if ((*priv->rxqs)[i] == NULL)
			continue;
		memset(&(*priv->rxqs)[i]->stats, 0,
		       sizeof(struct mlx5_rxq_stats));
	}
	for (i = 0; (i != priv->txqs_n); ++i) {
		if ((*priv->txqs)[i] == NULL)
			continue;
		memset(&(*priv->txqs)[i]->stats, 0,
		       sizeof(struct mlx5_txq_stats));
	}
	mlx5_os_read_dev_stat(priv, "out_of_buffer", &stats_ctrl->imissed_base);
	stats_ctrl->imissed = 0;
#ifndef MLX5_PMD_SOFT_COUNTERS
	/* FIXME: reset hardware counters. */
#endif

	return 0;
}
/**
 * DPDK callback to clear device statistics.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 *
 * @return
 *   always 0 on success and stats is reset
 */
DPDK callback to clear device statistics.
@param dev
Pointer to Ethernet device structure.

@return
always 0 on success and stats is reset
DPDK callback to clear device statistics . @param dev Pointer to Ethernet device structure . @return always 0 on success and stats is reset
int
mlx5_stats_reset(struct rte_eth_dev *dev)
{
	struct mlx5_priv *priv = dev->data->dev_private;
	struct mlx5_stats_ctrl *stats_ctrl = &priv->stats_ctrl;
	unsigned int i;
	for (i = 0; (i != priv->rxqs_n); ++i) {
		if ((*priv->rxqs)[i] == NULL)
			continue;
		memset(&(*priv->rxqs)[i]->stats, 0,
		       sizeof(struct mlx5_rxq_stats));
	}
	for (i = 0; (i != priv->txqs_n); ++i) {
		if ((*priv->txqs)[i] == NULL)
			continue;
		memset(&(*priv->txqs)[i]->stats, 0,
		       sizeof(struct mlx5_txq_stats));
	}
	mlx5_os_read_dev_stat(priv, "out_of_buffer", &stats_ctrl->imissed_base);
	stats_ctrl->imissed = 0;
#ifndef MLX5_PMD_SOFT_COUNTERS
#endif
	return 0;
}
int mlx5_stats_reset ( struct rte_eth_dev * dev ) { struct mlx5_priv * priv = dev -> data -> dev_private ; struct mlx5_stats_ctrl * stats_ctrl = & priv -> stats_ctrl ; unsigned int i ; for ( i = 0 ; ( i != priv -> rxqs_n ) ; ++ i ) { if ( ( * priv -> rxqs ) [ i ] == NULL ) continue ; memset ( & ( * priv -> rxqs ) [ i ] -> stats , 0 , sizeof ( struct mlx5_rxq_stats ) ) ; } for ( i = 0 ; ( i != priv -> txqs_n ) ; ++ i ) { if ( ( * priv -> txqs ) [ i ] == NULL ) continue ; memset ( & ( * priv -> txqs ) [ i ] -> stats , 0 , sizeof ( struct mlx5_txq_stats ) ) ; } mlx5_os_read_dev_stat ( priv , " " , & stats_ctrl -> imissed_base ) ; stats_ctrl -> imissed = 0 ; #ifndef MLX5_PMD_SOFT_COUNTERS #endif return 0 ; }
DPDK callback to clear device statistics.
DPDK callback to clear device statistics .
/* FIXME: reset hardware counters. */