7#ifndef __INCLUDE_RTE_MTR_H__
8#define __INCLUDE_RTE_MTR_H__
46#include <rte_compat.h>
525 RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
526 RTE_MTR_ERROR_TYPE_METER_PROFILE,
527 RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE,
528 RTE_MTR_ERROR_TYPE_MTR_ID,
529 RTE_MTR_ERROR_TYPE_MTR_PARAMS,
530 RTE_MTR_ERROR_TYPE_POLICER_ACTION_GREEN,
531 RTE_MTR_ERROR_TYPE_POLICER_ACTION_YELLOW,
532 RTE_MTR_ERROR_TYPE_POLICER_ACTION_RED,
533 RTE_MTR_ERROR_TYPE_STATS_MASK,
534 RTE_MTR_ERROR_TYPE_STATS,
535 RTE_MTR_ERROR_TYPE_SHARED,
536 RTE_MTR_ERROR_TYPE_METER_POLICY_ID,
537 RTE_MTR_ERROR_TYPE_METER_POLICY,
594 uint32_t meter_profile_id,
615 uint32_t meter_profile_id,
632struct rte_flow_meter_profile *
634 uint32_t meter_profile_id,
705struct rte_flow_meter_policy *
714#define rte_mtr_policy_pass_color(policy) \
715struct rte_mtr_meter_policy_params policy = \
717 .actions[RTE_COLOR_GREEN] = (struct rte_flow_action[]) { \
719 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \
720 .conf = &(struct rte_flow_action_meter_color) { \
721 .color = RTE_COLOR_GREEN, \
725 .type = RTE_FLOW_ACTION_TYPE_END, \
728 .actions[RTE_COLOR_YELLOW] = (struct rte_flow_action[]) { \
730 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \
731 .conf = &(struct rte_flow_action_meter_color) { \
732 .color = RTE_COLOR_YELLOW, \
736 .type = RTE_FLOW_ACTION_TYPE_END, \
739 .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) { \
741 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \
742 .conf = &(struct rte_flow_action_meter_color) { \
743 .color = RTE_COLOR_RED, \
747 .type = RTE_FLOW_ACTION_TYPE_END, \
756#define rte_mtr_policy_drop_red(policy) \
757struct rte_mtr_meter_policy_params policy = \
759 .actions[RTE_COLOR_GREEN] = NULL, \
760 .actions[RTE_COLOR_YELLOW] = NULL, \
761 .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) { \
763 .type = RTE_FLOW_ACTION_TYPE_DROP, \
766 .type = RTE_FLOW_ACTION_TYPE_END, \
907 uint32_t meter_profile_id,
927 uint32_t meter_policy_id,
1027 uint64_t *proto_mask,
1072 uint64_t stats_mask,
1104 uint64_t *stats_mask,
int rte_mtr_capabilities_get(uint16_t port_id, struct rte_mtr_capabilities *cap, struct rte_mtr_error *error)
int rte_mtr_create(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_params *params, int shared, struct rte_mtr_error *error)
int rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_meter_policy_params *policy, struct rte_mtr_error *error)
int rte_mtr_meter_dscp_table_update(uint16_t port_id, uint32_t mtr_id, enum rte_mtr_color_in_protocol proto, enum rte_color *dscp_table, struct rte_mtr_error *error)
int rte_mtr_meter_policy_delete(uint16_t port_id, uint32_t policy_id, struct rte_mtr_error *error)
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)
int rte_mtr_meter_disable(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
struct rte_flow_meter_profile * rte_mtr_meter_profile_get(uint16_t port_id, uint32_t meter_profile_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
int rte_mtr_meter_vlan_table_update(uint16_t port_id, uint32_t mtr_id, enum rte_mtr_color_in_protocol proto, enum rte_color *vlan_table, struct rte_mtr_error *error)
int rte_mtr_meter_policy_update(uint16_t port_id, uint32_t mtr_id, uint32_t meter_policy_id, struct rte_mtr_error *error)
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)
int rte_mtr_color_in_protocol_priority_get(uint16_t port_id, uint32_t mtr_id, enum rte_mtr_color_in_protocol proto, uint32_t *priority, struct rte_mtr_error *error)
int rte_mtr_color_in_protocol_get(uint16_t port_id, uint32_t mtr_id, uint64_t *proto_mask, struct rte_mtr_error *error)
int rte_mtr_destroy(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
int rte_mtr_stats_update(uint16_t port_id, uint32_t mtr_id, uint64_t stats_mask, struct rte_mtr_error *error)
int rte_mtr_meter_enable(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
@ RTE_MTR_ERROR_TYPE_NONE
@ RTE_MTR_ERROR_TYPE_UNSPECIFIED
int rte_mtr_color_in_protocol_set(uint16_t port_id, uint32_t mtr_id, enum rte_mtr_color_in_protocol proto, uint32_t priority, struct rte_mtr_error *error)
struct rte_flow_meter_policy * rte_mtr_meter_policy_get(uint16_t port_id, uint32_t policy_id, struct rte_mtr_error *error)
int rte_mtr_meter_profile_update(uint16_t port_id, uint32_t mtr_id, uint32_t meter_profile_id, struct rte_mtr_error *error)
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)
int rte_mtr_meter_profile_delete(uint16_t port_id, uint32_t meter_profile_id, struct rte_mtr_error *error)
rte_mtr_color_in_protocol
@ RTE_MTR_COLOR_IN_PROTO_OUTER_VLAN
@ RTE_MTR_COLOR_IN_PROTO_OUTER_IP
@ RTE_MTR_COLOR_IN_PROTO_INNER_IP
@ RTE_MTR_COLOR_IN_PROTO_INNER_VLAN
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 separate_input_color_table_per_port
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
uint64_t input_color_proto_mask
enum rte_mtr_error_type type
const struct rte_flow_action * actions[RTE_COLORS]
struct rte_mtr_meter_profile::@233::@237 trtcm_rfc4115
enum rte_mtr_algorithm alg
struct rte_mtr_meter_profile::@233::@235 srtcm_rfc2697
struct rte_mtr_meter_profile::@233::@236 trtcm_rfc2698
uint32_t meter_profile_id
enum rte_color * dscp_table
enum rte_color default_input_color
enum rte_color * vlan_table
uint64_t n_pkts[RTE_COLORS]
uint64_t n_bytes[RTE_COLORS]