drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c- Extension
.c- Size
- 69424 bytes
- Lines
- 2410
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/macsec.hlinux/mlx5/qp.hlinux/if_vlan.hlinux/mlx5/fs_helpers.hlinux/mlx5/macsec.hfs_core.hlib/macsec_fs.hmlx5_core.h
Detected Declarations
struct mlx5_sectag_headerstruct mlx5_roce_macsec_tx_rulestruct mlx5_macsec_tx_rulestruct mlx5_macsec_flow_tablestruct mlx5_macsec_tablesstruct mlx5_fs_idstruct mlx5_macsec_devicestruct mlx5_macsec_txstruct mlx5_roce_macsec_rx_rulestruct mlx5_macsec_rx_rulestruct mlx5_macsec_missstruct mlx5_macsec_rx_rocestruct mlx5_macsec_rxstruct mlx5_macsec_fsfunction macsec_fs_destroy_groupsfunction macsec_fs_destroy_flow_tablefunction macsec_fs_tx_destroyfunction macsec_fs_tx_create_crypto_table_groupsfunction macsec_fs_tx_roce_createfunction macsec_fs_tx_createfunction macsec_fs_tx_ft_getfunction macsec_fs_tx_ft_putfunction macsec_fs_tx_setup_ftefunction macsec_fs_tx_create_sectag_headerfunction macsec_fs_is_macsec_device_emptyfunction macsec_fs_id_delfunction list_for_each_entryfunction macsec_fs_id_addfunction list_for_each_entryfunction macsec_fs_tx_del_rulefunction macsec_fs_tx_add_rulefunction macsec_fs_tx_cleanupfunction macsec_fs_tx_initfunction macsec_fs_rx_roce_miss_destroyfunction macsec_fs_rdma_rx_destroyfunction macsec_fs_rx_destroyfunction macsec_fs_rx_create_crypto_table_groupsfunction macsec_fs_rx_create_check_decap_rulefunction macsec_fs_rx_roce_miss_createfunction macsec_fs_rx_roce_jump_to_rdma_groups_createfunction macsec_fs_rx_roce_jump_to_rdma_rules_createfunction macsec_fs_rx_roce_jump_to_rdma_createfunction macsec_fs_rx_roce_createfunction macsec_fs_rx_createfunction macsec_fs_rx_ft_getfunction macsec_fs_rx_ft_putfunction macsec_fs_rx_del_rulefunction macsec_fs_rx_setup_fte
Annotated Snippet
struct mlx5_sectag_header {
__be16 ethertype;
u8 tci_an;
u8 sl;
u32 pn;
u8 sci[MACSEC_SCI_LEN]; /* optional */
} __packed;
struct mlx5_roce_macsec_tx_rule {
u32 fs_id;
u16 gid_idx;
struct list_head entry;
struct mlx5_flow_handle *rule;
struct mlx5_modify_hdr *meta_modhdr;
};
struct mlx5_macsec_tx_rule {
struct mlx5_flow_handle *rule;
struct mlx5_pkt_reformat *pkt_reformat;
u32 fs_id;
};
struct mlx5_macsec_flow_table {
int num_groups;
struct mlx5_flow_table *t;
struct mlx5_flow_group **g;
};
struct mlx5_macsec_tables {
struct mlx5_macsec_flow_table ft_crypto;
struct mlx5_flow_handle *crypto_miss_rule;
struct mlx5_flow_table *ft_check;
struct mlx5_flow_group *ft_check_group;
struct mlx5_fc *check_miss_rule_counter;
struct mlx5_flow_handle *check_miss_rule;
struct mlx5_fc *check_rule_counter;
u32 refcnt;
};
struct mlx5_fs_id {
u32 id;
refcount_t refcnt;
sci_t sci;
struct rhash_head hash;
};
struct mlx5_macsec_device {
struct list_head macsec_devices_list_entry;
void *macdev;
struct xarray tx_id_xa;
struct xarray rx_id_xa;
};
struct mlx5_macsec_tx {
struct mlx5_flow_handle *crypto_mke_rule;
struct mlx5_flow_handle *check_rule;
struct ida tx_halloc;
struct mlx5_macsec_tables tables;
struct mlx5_flow_table *ft_rdma_tx;
};
struct mlx5_roce_macsec_rx_rule {
u32 fs_id;
u16 gid_idx;
struct mlx5_flow_handle *op;
struct mlx5_flow_handle *ip;
struct list_head entry;
};
struct mlx5_macsec_rx_rule {
struct mlx5_flow_handle *rule[RX_NUM_OF_RULES_PER_SA];
struct mlx5_modify_hdr *meta_modhdr;
};
struct mlx5_macsec_miss {
struct mlx5_flow_group *g;
struct mlx5_flow_handle *rule;
};
struct mlx5_macsec_rx_roce {
/* Flow table/rules in NIC domain, to check if it's a RoCE packet */
struct mlx5_flow_group *g;
struct mlx5_flow_table *ft;
struct mlx5_flow_handle *rule;
struct mlx5_modify_hdr *copy_modify_hdr;
Annotation
- Immediate include surface: `net/macsec.h`, `linux/mlx5/qp.h`, `linux/if_vlan.h`, `linux/mlx5/fs_helpers.h`, `linux/mlx5/macsec.h`, `fs_core.h`, `lib/macsec_fs.h`, `mlx5_core.h`.
- Detected declarations: `struct mlx5_sectag_header`, `struct mlx5_roce_macsec_tx_rule`, `struct mlx5_macsec_tx_rule`, `struct mlx5_macsec_flow_table`, `struct mlx5_macsec_tables`, `struct mlx5_fs_id`, `struct mlx5_macsec_device`, `struct mlx5_macsec_tx`, `struct mlx5_roce_macsec_rx_rule`, `struct mlx5_macsec_rx_rule`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.