#ifndef HWS_BWC_COMPLEX_H_
#define HWS_BWC_COMPLEX_H_
#define MLX5HWS_BWC_COMPLEX_MAX_SUBMATCHERS 4
struct mlx5hws_bwc_complex_subrule_data {
struct mlx5hws_rule_match_tag match_tag;
refcount_t refcount;
u32 chain_id;
u32 rtc_0;
u32 rtc_1;
bool was_moved;
struct rhash_head hash_node;
};
struct mlx5hws_bwc_complex_submatcher {
struct mlx5hws_table *tbl;
struct mlx5hws_action *action_tbl;
struct mlx5hws_bwc_matcher *bwc_matcher;
struct rhashtable rules_hash;
struct ida chain_ida;
struct mutex hash_lock;
};
struct mlx5hws_bwc_matcher_complex_data {
struct mlx5hws_bwc_complex_submatcher
submatchers[MLX5HWS_BWC_COMPLEX_MAX_SUBMATCHERS];
int num_submatchers;
struct mlx5hws_action *action_metadata;
struct mlx5hws_action *action_last;
};
bool mlx5hws_bwc_match_params_is_complex(struct mlx5hws_context *ctx,
u8 match_criteria_enable,
struct mlx5hws_match_parameters *mask);
int mlx5hws_bwc_matcher_create_complex(struct mlx5hws_bwc_matcher *bwc_matcher,
struct mlx5hws_table *table,
u32 priority,
u8 match_criteria_enable,
struct mlx5hws_match_parameters *mask);
void mlx5hws_bwc_matcher_destroy_complex(struct mlx5hws_bwc_matcher *bwc_matcher);
int mlx5hws_bwc_matcher_complex_move(struct mlx5hws_bwc_matcher *bwc_matcher);
int
mlx5hws_bwc_matcher_complex_move_first(struct mlx5hws_bwc_matcher *bwc_matcher);
int mlx5hws_bwc_rule_create_complex(struct mlx5hws_bwc_rule *bwc_rule,
struct mlx5hws_match_parameters *params,
u32 flow_source,
struct mlx5hws_rule_action rule_actions[],
u16 bwc_queue_idx);
int mlx5hws_bwc_rule_destroy_complex(struct mlx5hws_bwc_rule *bwc_rule);
#endif