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

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

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
Extension
.h
Size
29344 bytes
Lines
942
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_context_attr {
	u16 queues;
	u16 queue_size;
};

struct mlx5hws_table_attr {
	enum mlx5hws_table_type type;
	u32 level;
	u16 uid;
};

enum mlx5hws_matcher_flow_src {
	MLX5HWS_MATCHER_FLOW_SRC_ANY = 0x0,
	MLX5HWS_MATCHER_FLOW_SRC_WIRE = 0x1,
	MLX5HWS_MATCHER_FLOW_SRC_VPORT = 0x2,
};

enum mlx5hws_matcher_insert_mode {
	MLX5HWS_MATCHER_INSERT_BY_HASH = 0x0,
	MLX5HWS_MATCHER_INSERT_BY_INDEX = 0x1,
};

enum mlx5hws_matcher_distribute_mode {
	MLX5HWS_MATCHER_DISTRIBUTE_BY_HASH = 0x0,
	MLX5HWS_MATCHER_DISTRIBUTE_BY_LINEAR = 0x1,
};

enum mlx5hws_matcher_size_type {
	MLX5HWS_MATCHER_SIZE_TYPE_RX,
	MLX5HWS_MATCHER_SIZE_TYPE_TX,
	MLX5HWS_MATCHER_SIZE_TYPE_MAX,
};

union mlx5hws_matcher_size {
	struct {
		u8 sz_row_log;
		u8 sz_col_log;
	} table;

	struct {
		u8 num_log;
	} rule;
};

struct mlx5hws_matcher_attr {
	/* Processing priority inside table */
	u32 priority;
	/* Provide all rules with unique rule_idx in num_log range to reduce locking */
	bool optimize_using_rule_idx;
	/* Resource mode and corresponding size */
	enum mlx5hws_matcher_resource_mode mode;
	/* Optimize insertion in case packet origin is the same for all rules */
	enum mlx5hws_matcher_flow_src optimize_flow_src;
	/* Define the insertion and distribution modes for this matcher */
	enum mlx5hws_matcher_insert_mode insert_mode;
	enum mlx5hws_matcher_distribute_mode distribute_mode;
	/* Define whether the created matcher supports resizing into a bigger matcher */
	bool resizable;
	union mlx5hws_matcher_size size[MLX5HWS_MATCHER_SIZE_TYPE_MAX];
	/* Optional AT attach configuration - Max number of additional AT */
	u8 max_num_of_at_attach;
	/* Optional end FT (miss FT ID) for match RTC (for isolated matcher) */
	u32 isolated_matcher_end_ft_id;
};

struct mlx5hws_rule_attr {
	void *user_data;
	/* Valid if matcher optimize_using_rule_idx is set or
	 * if matcher is configured to insert rules by index.
	 */
	u32 rule_idx;
	u32 flow_source;
	u16 queue_id;
	u32 burst:1;
};

/* In actions that take offset, the offset is unique, pointing to a single
 * resource and the user should not reuse the same index because data changing
 * is not atomic.
 */
struct mlx5hws_rule_action {
	struct mlx5hws_action *action;
	union {
		struct {
			u32 value;
		} tag;

		struct {
			u32 offset;
		} counter;

Annotation

Implementation Notes