drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.h
Extension
.h
Size
3141 bytes
Lines
115
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct mlx5hws_match_template {
	struct mlx5hws_definer *definer;
	struct mlx5hws_definer_fc *fc;
	u32 *match_param;
	u8 match_criteria_enable;
	u16 fc_sz;
};

struct mlx5hws_matcher_match_ste {
	u32 rtc_0_id;
	u32 rtc_1_id;
	u32 ste_0_base;
	u32 ste_1_base;
};

enum {
	MLX5HWS_MATCHER_IPV_UNSET = 0,
	MLX5HWS_MATCHER_IPV_4 = 1,
	MLX5HWS_MATCHER_IPV_6 = 2,
};

struct mlx5hws_matcher {
	struct mlx5hws_table *tbl;
	struct mlx5hws_matcher_attr attr;
	struct mlx5hws_match_template *mt;
	struct mlx5hws_action_template *at;
	u8 num_of_at;
	u8 size_of_at_array;
	u8 num_of_mt;
	u8 num_of_action_stes;
	/* enum mlx5hws_matcher_flags */
	u8 flags;
	u8 matches_outer_ethertype:1;
	u8 matches_outer_ip_version:1;
	u8 matches_inner_ethertype:1;
	u8 matches_inner_ip_version:1;
	u8 outer_ip_version:2;
	u8 inner_ip_version:2;
	u32 end_ft_id;
	struct mlx5hws_matcher *col_matcher;
	struct mlx5hws_matcher *resize_dst;
	struct mlx5hws_matcher_match_ste match_ste;
	struct list_head list_node;
};

static inline bool
mlx5hws_matcher_mt_is_jumbo(struct mlx5hws_match_template *mt)
{
	return mlx5hws_definer_is_jumbo(mt->definer);
}

static inline bool mlx5hws_matcher_is_resizable(struct mlx5hws_matcher *matcher)
{
	return !!(matcher->flags & MLX5HWS_MATCHER_FLAGS_RESIZABLE);
}

static inline bool mlx5hws_matcher_is_in_resize(struct mlx5hws_matcher *matcher)
{
	return !!matcher->resize_dst;
}

static inline bool mlx5hws_matcher_is_isolated(struct mlx5hws_matcher *matcher)
{
	return !!(matcher->flags & MLX5HWS_MATCHER_FLAGS_ISOLATED);
}

static inline bool mlx5hws_matcher_is_insert_by_idx(struct mlx5hws_matcher *matcher)
{
	return matcher->attr.insert_mode == MLX5HWS_MATCHER_INSERT_BY_INDEX;
}

int mlx5hws_matcher_update_end_ft_isolated(struct mlx5hws_table *tbl,
					   u32 miss_ft_id);

#endif /* HWS_MATCHER_H_ */

Annotation

Implementation Notes