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

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

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.h
Extension
.h
Size
2342 bytes
Lines
88
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_rule_match_tag {
	union {
		u8 jumbo[MLX5HWS_JUMBO_TAG_SZ];
		struct {
			u8 reserved[MLX5HWS_ACTIONS_SZ];
			u8 match[MLX5HWS_MATCH_TAG_SZ];
		};
	};
};

struct mlx5hws_rule_resize_info {
	u32 rtc_0;
	u32 rtc_1;
	u32 rule_idx;
	u8 state;
	u8 ctrl_seg[MLX5HWS_WQE_SZ_GTA_CTRL]; /* Ctrl segment of STE: 48 bytes */
	u8 data_seg[MLX5HWS_WQE_SZ_GTA_DATA]; /* Data segment of STE: 64 bytes */
};

struct mlx5hws_rule {
	struct mlx5hws_matcher *matcher;
	union {
		struct mlx5hws_rule_match_tag tag;
		struct mlx5hws_rule_resize_info *resize_info;
	};
	struct mlx5hws_action_ste_chunk action_ste;
	struct mlx5hws_action_ste_chunk old_action_ste;
	u32 rtc_0; /* The RTC into which the STE was inserted */
	u32 rtc_1; /* The RTC into which the STE was inserted */
	u8 status; /* enum mlx5hws_rule_status */
	u8 pending_wqes;
	bool skip_delete; /* For complex rules - another rule with same tag
			   * still exists, so don't actually delete this rule.
			   */
};

void mlx5hws_rule_skip(struct mlx5hws_matcher *matcher, u32 flow_source,
		       bool *skip_rx, bool *skip_tx);

void mlx5hws_rule_free_action_ste(struct mlx5hws_action_ste_chunk *action_ste);

int mlx5hws_rule_move_hws_remove(struct mlx5hws_rule *rule,
				 void *queue, void *user_data);

int mlx5hws_rule_move_hws_add(struct mlx5hws_rule *rule,
			      struct mlx5hws_rule_attr *attr);

bool mlx5hws_rule_move_in_progress(struct mlx5hws_rule *rule);

void mlx5hws_rule_clear_resize_info(struct mlx5hws_rule *rule);

#endif /* MLX5HWS_RULE_H_ */

Annotation

Implementation Notes