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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mlx5/vport.hlinux/refcount.hfs_core.hwq.hlib/mlx5.hmlx5_ifc_dr.hmlx5dr.hdr_dbg.h
Detected Declarations
struct mlx5dr_ptrn_mgrstruct mlx5dr_arg_mgrstruct mlx5dr_arg_objstruct mlx5dr_icm_poolstruct mlx5dr_icm_chunkstruct mlx5dr_icm_buddy_memstruct mlx5dr_ste_htblstruct mlx5dr_match_paramstruct mlx5dr_cmd_capsstruct mlx5dr_rule_rx_txstruct mlx5dr_matcher_rx_txstruct mlx5dr_ste_ctxstruct mlx5dr_send_info_poolstruct mlx5dr_icm_hot_chunkstruct mlx5dr_stestruct mlx5dr_ste_htbl_ctrlstruct mlx5dr_ste_htblstruct mlx5dr_ste_send_infostruct mlx5dr_ste_buildstruct mlx5dr_ste_actions_attrstruct mlx5dr_match_specstruct mlx5dr_match_miscstruct mlx5dr_match_misc2struct mlx5dr_match_misc3struct mlx5dr_match_misc4struct mlx5dr_match_misc5struct mlx5dr_match_paramstruct mlx5dr_esw_capsstruct mlx5dr_cmd_vport_capstruct mlx5dr_roce_capstruct mlx5dr_vportsstruct mlx5dr_cmd_capsstruct mlx5dr_domain_rx_txstruct mlx5dr_domain_infostruct mlx5dr_domainstruct mlx5dr_table_rx_txstruct mlx5dr_tablestruct mlx5dr_matcher_rx_txstruct mlx5dr_matcherstruct mlx5dr_ste_action_modify_fieldstruct mlx5dr_ptrn_objstruct mlx5dr_arg_objstruct mlx5dr_action_rewritestruct mlx5dr_action_reformatstruct mlx5dr_action_samplerstruct mlx5dr_action_dest_tblstruct mlx5dr_action_rangestruct mlx5dr_action_ctr
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
- Immediate include surface: `linux/mlx5/vport.h`, `linux/refcount.h`, `fs_core.h`, `wq.h`, `lib/mlx5.h`, `mlx5_ifc_dr.h`, `mlx5dr.h`, `dr_dbg.h`.
- Detected declarations: `struct mlx5dr_ptrn_mgr`, `struct mlx5dr_arg_mgr`, `struct mlx5dr_arg_obj`, `struct mlx5dr_icm_pool`, `struct mlx5dr_icm_chunk`, `struct mlx5dr_icm_buddy_mem`, `struct mlx5dr_ste_htbl`, `struct mlx5dr_match_param`, `struct mlx5dr_cmd_caps`, `struct mlx5dr_rule_rx_tx`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.