-/* Meter table structure. */
-struct mlx5_meter_domain_info {
- struct mlx5_flow_tbl_resource *tbl;
- /**< Meter table. */
- struct mlx5_flow_tbl_resource *sfx_tbl;
- /**< Meter suffix table. */
- struct mlx5_flow_dv_matcher *drop_matcher;
- /**< Matcher for Drop. */
- struct mlx5_flow_dv_matcher *color_matcher;
- /**< Matcher for Color. */
- void *jump_actn;
- /**< Meter match action. */
- void *green_rule;
- /**< Meter green rule. */
- void *drop_rule;
- /**< Meter drop rule. */
-};
-
-/* Meter table set for TX RX FDB. */
-struct mlx5_meter_domains_infos {
- uint32_t ref_cnt;
- /**< Table user count. */
- struct mlx5_meter_domain_info egress;
- /**< TX meter table. */
- struct mlx5_meter_domain_info ingress;
- /**< RX meter table. */
- struct mlx5_meter_domain_info transfer;
- /**< FDB meter table. */
- void *green_count;
- /**< Counters for green rule. */
- void *drop_count;
- /**< Counters for green rule. */
- uint32_t fmp[MLX5_ST_SZ_DW(flow_meter_parameters)];
- /**< Flow meter parameter. */
- size_t fmp_size;
- /**< Flow meter parameter size. */
- void *meter_action;
- /**< Flow meter action. */
-};
-
-/* Meter parameter structure. */
-struct mlx5_flow_meter {
- TAILQ_ENTRY(mlx5_flow_meter) next;
- /**< Pointer to the next flow meter structure. */
- uint32_t idx; /* Index to meter object. */
- uint32_t meter_id;
- /**< Meter id. */
- struct mlx5_flow_meter_profile *profile;
- /**< Meter profile parameters. */
-
- rte_spinlock_t sl; /**< Meter action spinlock. */
-
- /** Policer actions (per meter output color). */
- enum rte_mtr_policer_action action[RTE_COLORS];
-
- /** Set of stats counters to be enabled.
- * @see enum rte_mtr_stats_type
- */
- uint64_t stats_mask;
-
- /**< Rule applies to ingress traffic. */
- uint32_t ingress:1;
-
- /**< Rule applies to egress traffic. */
- uint32_t egress:1;
- /**
- * Instead of simply matching the properties of traffic as it would
- * appear on a given DPDK port ID, enabling this attribute transfers
- * a flow rule to the lowest possible level of any device endpoints
- * found in the pattern.
- *
- * When supported, this effectively enables an application to
- * re-route traffic not necessarily intended for it (e.g. coming
- * from or addressed to different physical ports, VFs or
- * applications) at the device level.
- *
- * It complements the behavior of some pattern items such as
- * RTE_FLOW_ITEM_TYPE_PHY_PORT and is meaningless without them.
- *
- * When transferring flow rules, ingress and egress attributes keep
- * their original meaning, as if processing traffic emitted or
- * received by the application.
- */
- uint32_t transfer:1;
- struct mlx5_meter_domains_infos *mfts;
- /**< Flow table created for this meter. */
- struct mlx5_flow_policer_stats policer_stats;
- /**< Meter policer statistics. */
- uint32_t ref_cnt;
- /**< Use count. */
- uint32_t active_state:1;
- /**< Meter state. */
- uint32_t shared:1;
- /**< Meter shared or not. */
- struct mlx5_indexed_pool *flow_ipool;
- /**< Index pool for flow id. */
-};
-
-/* RFC2697 parameter structure. */
-struct mlx5_flow_meter_srtcm_rfc2697_prm {
- /* green_saturation_value = cbs_mantissa * 2^cbs_exponent */
- uint32_t cbs_exponent:5;
- uint32_t cbs_mantissa:8;
- /* cir = 8G * cir_mantissa * 1/(2^cir_exponent) Bytes/Sec */
- uint32_t cir_exponent:5;
- uint32_t cir_mantissa:8;
- /* yellow _saturation_value = ebs_mantissa * 2^ebs_exponent */
- uint32_t ebs_exponent:5;
- uint32_t ebs_mantissa:8;
-};