1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
5 #ifndef _RTE_BITRATE_H_
6 #define _RTE_BITRATE_H_
10 #include <rte_compat.h>
17 * Bitrate statistics data structure.
18 * This data structure is intentionally opaque.
20 struct rte_stats_bitrates;
24 * Allocate a bitrate statistics structure
27 * - Pointer to structure on success
28 * - NULL on error (zmalloc failure)
30 struct rte_stats_bitrates *rte_stats_bitrate_create(void);
33 * Free bitrate statistics structure
36 * Pointer allocated by rte_stats_bitrate_create()
39 void rte_stats_bitrate_free(struct rte_stats_bitrates *bitrate_data);
42 * Register bitrate statistics with the metric library.
45 * Pointer allocated by rte_stats_bitrate_create()
51 int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data);
55 * Calculate statistics for current time window. The period with which
56 * this function is called should be the intended sampling window width.
59 * Bitrate statistics data pointer
62 * Port id to calculate statistics for
66 * - Negative value on error
68 int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data,
75 #endif /* _RTE_BITRATE_H_ */