drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_types.h

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

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_types.h
Extension
.h
Size
46333 bytes
Lines
1598
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 mlx5dr_ste {
	/* refcount: indicates the num of rules that using this ste */
	u32 refcount;

	/* this ste is part of a rule, located in ste's chain */
	u8 ste_chain_location;

	/* attached to the miss_list head at each htbl entry */
	struct list_head miss_list_node;

	/* this ste is member of htbl */
	struct mlx5dr_ste_htbl *htbl;

	struct mlx5dr_ste_htbl *next_htbl;

	/* The rule this STE belongs to */
	struct mlx5dr_rule_rx_tx *rule_rx_tx;
};

struct mlx5dr_ste_htbl_ctrl {
	/* total number of valid entries belonging to this hash table. This
	 * includes the non collision and collision entries
	 */
	unsigned int num_of_valid_entries;

	/* total number of collisions entries attached to this table */
	unsigned int num_of_collisions;
};

struct mlx5dr_ste_htbl {
	u16 lu_type;
	u16 byte_mask;
	u32 refcount;
	struct mlx5dr_icm_chunk *chunk;
	struct mlx5dr_ste *pointing_ste;
	struct mlx5dr_ste_htbl_ctrl ctrl;
};

struct mlx5dr_ste_send_info {
	struct mlx5dr_ste *ste;
	struct list_head send_list;
	u16 size;
	u16 offset;
	u8 data_cont[DR_STE_SIZE];
	u8 *data;
};

void mlx5dr_send_fill_and_append_ste_send_info(struct mlx5dr_ste *ste, u16 size,
					       u16 offset, u8 *data,
					       struct mlx5dr_ste_send_info *ste_info,
					       struct list_head *send_list,
					       bool copy_data);

struct mlx5dr_ste_build {
	u8 inner:1;
	u8 rx:1;
	u8 vhca_id_valid:1;
	struct mlx5dr_domain *dmn;
	struct mlx5dr_cmd_caps *caps;
	u16 lu_type;
	u16 byte_mask;
	u8 bit_mask[DR_STE_SIZE_MASK];
	int (*ste_build_tag_func)(struct mlx5dr_match_param *spec,
				  struct mlx5dr_ste_build *sb,
				  u8 *tag);
};

struct mlx5dr_ste_htbl *
mlx5dr_ste_htbl_alloc(struct mlx5dr_icm_pool *pool,
		      enum mlx5dr_icm_chunk_size chunk_size,
		      u16 lu_type, u16 byte_mask);

int mlx5dr_ste_htbl_free(struct mlx5dr_ste_htbl *htbl);

static inline void mlx5dr_htbl_put(struct mlx5dr_ste_htbl *htbl)
{
	htbl->refcount--;
	if (!htbl->refcount)
		mlx5dr_ste_htbl_free(htbl);
}

static inline void mlx5dr_htbl_get(struct mlx5dr_ste_htbl *htbl)
{
	htbl->refcount++;
}

/* STE utils */
u32 mlx5dr_ste_calc_hash_index(u8 *hw_ste_p, struct mlx5dr_ste_htbl *htbl);
bool mlx5dr_ste_is_miss_addr_set(struct mlx5dr_ste_ctx *ste_ctx, u8 *hw_ste_p);
void mlx5dr_ste_set_miss_addr(struct mlx5dr_ste_ctx *ste_ctx,

Annotation

Implementation Notes