drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxsw/spectrum1_acl_tcam.c- Extension
.c- Size
- 7334 bytes
- Lines
- 255
- 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/kernel.hlinux/slab.hreg.hcore.hspectrum.hspectrum_acl_tcam.h
Detected Declarations
struct mlxsw_sp1_acl_tcam_regionstruct mlxsw_sp1_acl_tcam_chunkstruct mlxsw_sp1_acl_tcam_entryfunction mlxsw_sp1_acl_ctcam_region_entry_insertfunction mlxsw_sp1_acl_ctcam_region_entry_removefunction mlxsw_sp1_acl_tcam_initfunction mlxsw_sp1_acl_tcam_finifunction mlxsw_sp1_acl_ctcam_region_catchall_delfunction mlxsw_sp1_acl_tcam_region_initfunction mlxsw_sp1_acl_tcam_region_finifunction mlxsw_sp1_acl_tcam_region_associatefunction mlxsw_sp1_acl_tcam_chunk_initfunction mlxsw_sp1_acl_tcam_chunk_finifunction mlxsw_sp1_acl_tcam_entry_addfunction mlxsw_sp1_acl_tcam_entry_delfunction mlxsw_sp1_acl_tcam_entry_action_replacefunction mlxsw_sp1_acl_tcam_region_entry_activity_getfunction mlxsw_sp1_acl_tcam_entry_activity_get
Annotated Snippet
struct mlxsw_sp1_acl_tcam_region {
struct mlxsw_sp_acl_ctcam_region cregion;
struct mlxsw_sp_acl_tcam_region *region;
struct {
struct mlxsw_sp_acl_ctcam_chunk cchunk;
struct mlxsw_sp_acl_ctcam_entry centry;
struct mlxsw_sp_acl_rule_info *rulei;
} catchall;
};
struct mlxsw_sp1_acl_tcam_chunk {
struct mlxsw_sp_acl_ctcam_chunk cchunk;
};
struct mlxsw_sp1_acl_tcam_entry {
struct mlxsw_sp_acl_ctcam_entry centry;
};
static int
mlxsw_sp1_acl_ctcam_region_entry_insert(struct mlxsw_sp_acl_ctcam_region *cregion,
struct mlxsw_sp_acl_ctcam_entry *centry,
const char *mask)
{
return 0;
}
static void
mlxsw_sp1_acl_ctcam_region_entry_remove(struct mlxsw_sp_acl_ctcam_region *cregion,
struct mlxsw_sp_acl_ctcam_entry *centry)
{
}
static const struct mlxsw_sp_acl_ctcam_region_ops
mlxsw_sp1_acl_ctcam_region_ops = {
.entry_insert = mlxsw_sp1_acl_ctcam_region_entry_insert,
.entry_remove = mlxsw_sp1_acl_ctcam_region_entry_remove,
};
static int mlxsw_sp1_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv,
struct mlxsw_sp_acl_tcam *tcam)
{
return 0;
}
static void mlxsw_sp1_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv)
{
}
static int
mlxsw_sp1_acl_ctcam_region_catchall_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp1_acl_tcam_region *region)
{
struct mlxsw_sp_acl_rule_info *rulei;
int err;
mlxsw_sp_acl_ctcam_chunk_init(®ion->cregion,
®ion->catchall.cchunk,
MLXSW_SP_ACL_TCAM_CATCHALL_PRIO);
rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, NULL);
if (IS_ERR(rulei)) {
err = PTR_ERR(rulei);
goto err_rulei_create;
}
err = mlxsw_sp_acl_rulei_act_continue(rulei);
if (WARN_ON(err))
goto err_rulei_act_continue;
err = mlxsw_sp_acl_rulei_commit(rulei);
if (err)
goto err_rulei_commit;
err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, ®ion->cregion,
®ion->catchall.cchunk,
®ion->catchall.centry,
rulei, false);
if (err)
goto err_entry_add;
region->catchall.rulei = rulei;
return 0;
err_entry_add:
err_rulei_commit:
err_rulei_act_continue:
mlxsw_sp_acl_rulei_destroy(mlxsw_sp, rulei);
err_rulei_create:
mlxsw_sp_acl_ctcam_chunk_fini(®ion->catchall.cchunk);
return err;
}
static void
mlxsw_sp1_acl_ctcam_region_catchall_del(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp1_acl_tcam_region *region)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/slab.h`, `reg.h`, `core.h`, `spectrum.h`, `spectrum_acl_tcam.h`.
- Detected declarations: `struct mlxsw_sp1_acl_tcam_region`, `struct mlxsw_sp1_acl_tcam_chunk`, `struct mlxsw_sp1_acl_tcam_entry`, `function mlxsw_sp1_acl_ctcam_region_entry_insert`, `function mlxsw_sp1_acl_ctcam_region_entry_remove`, `function mlxsw_sp1_acl_tcam_init`, `function mlxsw_sp1_acl_tcam_fini`, `function mlxsw_sp1_acl_ctcam_region_catchall_del`, `function mlxsw_sp1_acl_tcam_region_init`, `function mlxsw_sp1_acl_tcam_region_fini`.
- 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.