7 #ifndef __INCLUDE_RTE_MTR_H__ 8 #define __INCLUDE_RTE_MTR_H__ 49 #include <rte_compat.h> 530 RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
531 RTE_MTR_ERROR_TYPE_METER_PROFILE,
532 RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE,
533 RTE_MTR_ERROR_TYPE_MTR_ID,
534 RTE_MTR_ERROR_TYPE_MTR_PARAMS,
535 RTE_MTR_ERROR_TYPE_POLICER_ACTION_GREEN,
536 RTE_MTR_ERROR_TYPE_POLICER_ACTION_YELLOW,
537 RTE_MTR_ERROR_TYPE_POLICER_ACTION_RED,
538 RTE_MTR_ERROR_TYPE_STATS_MASK,
539 RTE_MTR_ERROR_TYPE_STATS,
540 RTE_MTR_ERROR_TYPE_SHARED,
541 RTE_MTR_ERROR_TYPE_METER_POLICY_ID,
542 RTE_MTR_ERROR_TYPE_METER_POLICY,
601 uint32_t meter_profile_id,
623 uint32_t meter_profile_id,
686 #define rte_mtr_policy_pass_color(policy) \ 687 struct rte_mtr_meter_policy_params policy = \ 689 .actions[RTE_COLOR_GREEN] = (struct rte_flow_action[]) { \ 691 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \ 692 .conf = &(struct rte_flow_action_meter_color) { \ 693 .color = RTE_COLOR_GREEN, \ 697 .type = RTE_FLOW_ACTION_TYPE_END, \ 700 .actions[RTE_COLOR_YELLOW] = (struct rte_flow_action[]) { \ 702 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \ 703 .conf = &(struct rte_flow_action_meter_color) { \ 704 .color = RTE_COLOR_YELLOW, \ 708 .type = RTE_FLOW_ACTION_TYPE_END, \ 711 .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) { \ 713 .type = RTE_FLOW_ACTION_TYPE_METER_COLOR, \ 714 .conf = &(struct rte_flow_action_meter_color) { \ 715 .color = RTE_COLOR_RED, \ 719 .type = RTE_FLOW_ACTION_TYPE_END, \ 728 #define rte_mtr_policy_drop_red(policy) \ 729 struct rte_mtr_meter_policy_params policy = \ 731 .actions[RTE_COLOR_GREEN] = NULL, \ 732 .actions[RTE_COLOR_YELLOW] = NULL, \ 733 .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) { \ 735 .type = RTE_FLOW_ACTION_TYPE_DROP, \ 738 .type = RTE_FLOW_ACTION_TYPE_END, \ 885 uint32_t meter_profile_id,
906 uint32_t meter_policy_id,
1006 uint64_t *proto_mask,
1053 uint64_t stats_mask,
1086 uint64_t *stats_mask,
__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)
int color_aware_srtcm_rfc2697_supported
__rte_experimental int rte_mtr_meter_policy_delete(uint16_t port_id, uint32_t policy_id, struct rte_mtr_error *error)
uint32_t meter_srtcm_rfc2697_n_max
__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_meter_vlan_table_update(uint16_t port_id, uint32_t mtr_id, enum rte_color *vlan_table, 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_experimental 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)
uint64_t input_color_proto_mask
uint32_t meter_trtcm_rfc2698_n_max
int srtcm_rfc2697_byte_mode_supported
enum rte_color * vlan_table
__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_profile_delete(uint16_t port_id, uint32_t meter_profile_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_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)
uint64_t n_pkts[RTE_COLORS]
__rte_experimental int rte_mtr_meter_enable(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
uint64_t n_bytes[RTE_COLORS]
__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_color_in_protocol
int separate_input_color_table_per_port
__rte_experimental int rte_mtr_stats_update(uint16_t port_id, uint32_t mtr_id, uint64_t stats_mask, struct rte_mtr_error *error)
int color_aware_trtcm_rfc2698_supported
__rte_experimental int rte_mtr_meter_policy_validate(uint16_t port_id, struct rte_mtr_meter_policy_params *policy, struct rte_mtr_error *error)
int srtcm_rfc2697_packet_mode_supported
int trtcm_rfc4115_byte_mode_supported
__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)
uint64_t meter_policy_n_max
int color_aware_trtcm_rfc4115_supported
int chaining_use_prev_mtr_color_supported
uint32_t meter_profile_id
int chaining_use_prev_mtr_color_enforced
__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_capabilities_get(uint16_t port_id, struct rte_mtr_capabilities *cap, struct rte_mtr_error *error)
__rte_experimental int rte_mtr_color_in_protocol_get(uint16_t port_id, uint32_t mtr_id, uint64_t *proto_mask, struct rte_mtr_error *error)
uint32_t shared_n_flows_per_mtr_max
enum rte_color * dscp_table
int trtcm_rfc2698_packet_mode_supported
int trtcm_rfc2698_byte_mode_supported
uint32_t meter_trtcm_rfc4115_n_max
__rte_experimental int rte_mtr_destroy(uint16_t port_id, uint32_t mtr_id, struct rte_mtr_error *error)
uint32_t chaining_n_mtrs_per_flow_max
int trtcm_rfc4115_packet_mode_supported