7#ifndef __INCLUDE_RTE_MTR_H__
8#define __INCLUDE_RTE_MTR_H__
49#include <rte_compat.h>
431 RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
432 RTE_MTR_ERROR_TYPE_METER_PROFILE,
433 RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE,
434 RTE_MTR_ERROR_TYPE_MTR_ID,
435 RTE_MTR_ERROR_TYPE_MTR_PARAMS,
436 RTE_MTR_ERROR_TYPE_POLICER_ACTION_GREEN,
437 RTE_MTR_ERROR_TYPE_POLICER_ACTION_YELLOW,
438 RTE_MTR_ERROR_TYPE_POLICER_ACTION_RED,
439 RTE_MTR_ERROR_TYPE_STATS_MASK,
440 RTE_MTR_ERROR_TYPE_STATS,
441 RTE_MTR_ERROR_TYPE_SHARED,
442 RTE_MTR_ERROR_TYPE_METER_POLICY_ID,
443 RTE_MTR_ERROR_TYPE_METER_POLICY,
502 uint32_t meter_profile_id,
524 uint32_t meter_profile_id,
587#define rte_mtr_policy_pass_color(policy) \
588struct rte_mtr_meter_policy_params policy = \
590 .actions[RTE_COLOR_GREEN] = (struct rte_flow_action[]) { \
592 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \
593 .conf = &(struct rte_flow_action_meter_color) { \
594 .color = RTE_COLOR_GREEN, \
598 .type = RTE_FLOW_ACTION_TYPE_END, \
601 .actions[RTE_COLOR_YELLOW] = (struct rte_flow_action[]) { \
603 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \
604 .conf = &(struct rte_flow_action_meter_color) { \
605 .color = RTE_COLOR_YELLOW, \
609 .type = RTE_FLOW_ACTION_TYPE_END, \
612 .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) { \
614 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \
615 .conf = &(struct rte_flow_action_meter_color) { \
616 .color = RTE_COLOR_RED, \
620 .type = RTE_FLOW_ACTION_TYPE_END, \
629#define rte_mtr_policy_drop_red(policy) \
630struct rte_mtr_meter_policy_params policy = \
632 .actions[RTE_COLOR_GREEN] = NULL, \
633 .actions[RTE_COLOR_YELLOW] = NULL, \
634 .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) { \
636 .type = RTE_FLOW_ACTION_TYPE_DROP, \
639 .type = RTE_FLOW_ACTION_TYPE_END, \
786 uint32_t meter_profile_id,
807 uint32_t meter_policy_id,
890 uint64_t *stats_mask,
__rte_experimental int rte_mtr_destroy(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_policy_delete(uint16_t port_id, uint32_t policy_id, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_stats_read(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_stats *stats, uint64_t *stats_mask, int clear, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_profile_update(uint16_t port_id, uint32_t mtr_id, uint32_t meter_profile_id, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_profile_delete(uint16_t port_id, uint32_t meter_profile_id, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_policy_update(uint16_t port_id, uint32_t mtr_id, uint32_t meter_policy_id, struct rte_mtr_error *error)
@ RTE_MTR_STATS_N_BYTES_GREEN
@ RTE_MTR_STATS_N_PKTS_GREEN
@ RTE_MTR_STATS_N_PKTS_RED
@ RTE_MTR_STATS_N_BYTES_YELLOW
@ RTE_MTR_STATS_N_PKTS_YELLOW
@ RTE_MTR_STATS_N_PKTS_DROPPED
@ RTE_MTR_STATS_N_BYTES_RED
@ RTE_MTR_STATS_N_BYTES_DROPPED
__rte_experimental int rte_mtr_stats_update(uint16_t port_id, uint32_t mtr_id, uint64_t stats_mask, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_profile_add(uint16_t port_id, uint32_t meter_profile_id, struct rte_mtr_meter_profile *profile, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_create(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_params *params, int shared, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_meter_policy_params *policy, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_policy_add(uint16_t port_id, uint32_t policy_id, struct rte_mtr_meter_policy_params *policy, struct rte_mtr_error *error)
@ RTE_MTR_ERROR_TYPE_NONE
@ RTE_MTR_ERROR_TYPE_UNSPECIFIED
__rte_experimental int rte_mtr_meter_enable(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_disable(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_meter_dscp_table_update(uint16_t port_id, uint32_t mtr_id, enum rte_color *dscp_table, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_capabilities *cap, struct rte_mtr_error *error)
int trtcm_rfc4115_packet_mode_supported
uint32_t meter_srtcm_rfc2697_n_max
int color_aware_srtcm_rfc2697_supported
int trtcm_rfc2698_packet_mode_supported
int chaining_use_prev_mtr_color_supported
uint32_t shared_n_flows_per_mtr_max
uint32_t meter_trtcm_rfc2698_n_max
uint32_t meter_trtcm_rfc4115_n_max
int color_aware_trtcm_rfc4115_supported
int srtcm_rfc2697_byte_mode_supported
int chaining_use_prev_mtr_color_enforced
int trtcm_rfc2698_byte_mode_supported
uint32_t chaining_n_mtrs_per_flow_max
int color_aware_trtcm_rfc2698_supported
uint64_t meter_policy_n_max
int srtcm_rfc2697_packet_mode_supported
int trtcm_rfc4115_byte_mode_supported
enum rte_mtr_error_type type
const struct rte_flow_action * actions[RTE_COLORS]
struct rte_mtr_meter_profile::@183::@186 trtcm_rfc2698
enum rte_mtr_algorithm alg
struct rte_mtr_meter_profile::@183::@185 srtcm_rfc2697
struct rte_mtr_meter_profile::@183::@187 trtcm_rfc4115
uint32_t meter_profile_id
enum rte_color * dscp_table
uint64_t n_pkts[RTE_COLORS]
uint64_t n_bytes[RTE_COLORS]