drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h- Extension
.h- Size
- 11273 bytes
- Lines
- 306
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/parman.hlinux/idr.hreg.hspectrum.hcore_acl_flex_keys.h
Detected Declarations
struct mlxsw_sp_acl_tcamstruct mlxsw_sp_acl_profile_opsstruct mlxsw_sp_acl_tcam_groupstruct mlxsw_sp_acl_tcam_vregionstruct mlxsw_sp_acl_tcam_regionstruct mlxsw_sp_acl_ctcam_regionstruct mlxsw_sp_acl_ctcam_chunkstruct mlxsw_sp_acl_ctcam_entrystruct mlxsw_sp_acl_ctcam_region_opsstruct mlxsw_sp_acl_atcamstruct mlxsw_sp_acl_atcam_regionstruct mlxsw_sp_acl_atcam_entry_ht_keystruct mlxsw_sp_acl_atcam_chunkstruct mlxsw_sp_acl_atcam_entrystruct mlxsw_sp_acl_erp_deltastruct mlxsw_sp_acl_erp_maskstruct mlxsw_sp_acl_bfstruct mlxsw_sp_acl_bf_opsenum mlxsw_sp_acl_atcam_region_typefunction mlxsw_sp_acl_ctcam_entry_offsetfunction mlxsw_sp_acl_tcam_cregion_aregionfunction mlxsw_sp_acl_tcam_centry_aentry
Annotated Snippet
struct mlxsw_sp_acl_tcam {
struct ida used_regions;
unsigned int max_regions;
struct ida used_groups;
unsigned int max_groups;
unsigned int max_group_size;
struct mutex lock; /* guards vregion list */
struct list_head vregion_list;
u32 vregion_rehash_intrvl; /* ms */
unsigned long priv[];
/* priv has to be always the last item */
};
size_t mlxsw_sp_acl_tcam_priv_size(struct mlxsw_sp *mlxsw_sp);
int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_tcam *tcam);
void mlxsw_sp_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_tcam *tcam);
int mlxsw_sp_acl_tcam_priority_get(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_rule_info *rulei,
u32 *priority, bool fillup_priority);
struct mlxsw_sp_acl_profile_ops {
size_t ruleset_priv_size;
int (*ruleset_add)(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_tcam *tcam, void *ruleset_priv,
struct mlxsw_afk_element_usage *tmplt_elusage,
unsigned int *p_min_prio, unsigned int *p_max_prio);
void (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);
int (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
struct mlxsw_sp_port *mlxsw_sp_port,
bool ingress);
void (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
struct mlxsw_sp_port *mlxsw_sp_port,
bool ingress);
u16 (*ruleset_group_id)(void *ruleset_priv);
size_t rule_priv_size;
int (*rule_add)(struct mlxsw_sp *mlxsw_sp,
void *ruleset_priv, void *rule_priv,
struct mlxsw_sp_acl_rule_info *rulei);
void (*rule_del)(struct mlxsw_sp *mlxsw_sp, void *rule_priv);
int (*rule_action_replace)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
struct mlxsw_sp_acl_rule_info *rulei);
int (*rule_activity_get)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
bool *activity);
};
const struct mlxsw_sp_acl_profile_ops *
mlxsw_sp_acl_tcam_profile_ops(struct mlxsw_sp *mlxsw_sp,
enum mlxsw_sp_acl_profile profile);
#define MLXSW_SP_ACL_TCAM_REGION_BASE_COUNT 16
#define MLXSW_SP_ACL_TCAM_REGION_RESIZE_STEP 16
#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (~0U)
#define MLXSW_SP_ACL_TCAM_MASK_LEN \
(MLXSW_REG_PTCEX_FLEX_KEY_BLOCKS_LEN * BITS_PER_BYTE)
struct mlxsw_sp_acl_tcam_group;
struct mlxsw_sp_acl_tcam_vregion;
struct mlxsw_sp_acl_tcam_region {
struct mlxsw_sp_acl_tcam_vregion *vregion;
struct mlxsw_sp_acl_tcam_group *group;
struct list_head list; /* Member of a TCAM group */
enum mlxsw_reg_ptar_key_type key_type;
u16 id; /* ACL ID and region ID - they are same */
char tcam_region_info[MLXSW_REG_PXXX_TCAM_REGION_INFO_LEN];
struct mlxsw_afk_key_info *key_info;
struct mlxsw_sp *mlxsw_sp;
unsigned long priv[];
/* priv has to be always the last item */
};
struct mlxsw_sp_acl_ctcam_region {
struct parman *parman;
const struct mlxsw_sp_acl_ctcam_region_ops *ops;
struct mlxsw_sp_acl_tcam_region *region;
};
struct mlxsw_sp_acl_ctcam_chunk {
struct parman_prio parman_prio;
};
struct mlxsw_sp_acl_ctcam_entry {
struct parman_item parman_item;
};
struct mlxsw_sp_acl_ctcam_region_ops {
Annotation
- Immediate include surface: `linux/list.h`, `linux/parman.h`, `linux/idr.h`, `reg.h`, `spectrum.h`, `core_acl_flex_keys.h`.
- Detected declarations: `struct mlxsw_sp_acl_tcam`, `struct mlxsw_sp_acl_profile_ops`, `struct mlxsw_sp_acl_tcam_group`, `struct mlxsw_sp_acl_tcam_vregion`, `struct mlxsw_sp_acl_tcam_region`, `struct mlxsw_sp_acl_ctcam_region`, `struct mlxsw_sp_acl_ctcam_chunk`, `struct mlxsw_sp_acl_ctcam_entry`, `struct mlxsw_sp_acl_ctcam_region_ops`, `struct mlxsw_sp_acl_atcam`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.