drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c- Extension
.c- Size
- 114288 bytes
- Lines
- 4307
- 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
linux/mutex.hlinux/mlx5/driver.hlinux/mlx5/vport.hlinux/mlx5/eswitch.hnet/devlink.hmlx5_core.hfs_core.hfs_cmd.hfs_ft_pool.hdiag/fs_tracepoint.hdevlink.h
Detected Declarations
struct node_capsstruct match_liststruct mlx5_vport_acl_root_nsenum fs_i_lock_classfunction Copyrightfunction tree_init_nodefunction tree_add_nodefunction tree_get_nodefunction nested_down_read_ref_nodefunction nested_down_write_ref_nodefunction down_write_ref_nodefunction up_read_ref_nodefunction up_write_ref_nodefunction tree_put_nodefunction tree_remove_nodefunction fs_for_each_priofunction is_fwd_next_actionfunction is_fwd_dest_typefunction check_valid_specfunction del_sw_nsfunction del_sw_priofunction del_hw_flow_tablefunction del_sw_flow_tablefunction modify_ftefunction del_sw_hw_dup_rulefunction del_sw_hw_rulefunction switch_to_pending_act_destsfunction del_hw_ftefunction del_sw_ftefunction del_hw_flow_groupfunction del_sw_flow_groupfunction insert_ftefunction dealloc_flow_groupfunction alloc_flow_tablefunction list_for_each_advance_continuefunction connect_fts_in_priofunction fs_for_each_ftfunction connect_prev_ftsfunction update_root_ft_createfunction list_for_each_entryfunction rule_is_pendingfunction list_for_each_entryfunction _mlx5_modify_rule_destinationfunction mlx5_modify_rule_destinationfunction connect_fwd_rulesfunction connect_flow_tablefunction list_add_flow_tablefunction fs_for_each_ft
Annotated Snippet
struct node_caps {
size_t arr_sz;
long *caps;
};
static struct init_tree_node {
enum fs_node_type type;
struct init_tree_node *children;
int ar_size;
struct node_caps caps;
int min_ft_level;
int num_leaf_prios;
int prio;
int num_levels;
enum mlx5_flow_table_miss_action def_miss_action;
} root_fs = {
.type = FS_TYPE_NAMESPACE,
.ar_size = 8,
.children = (struct init_tree_node[]){
ADD_PRIO(0, BY_PASS_MIN_LEVEL, 0, FS_CHAINING_CAPS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(MLX5_BY_PASS_NUM_PRIOS,
BY_PASS_PRIO_NUM_LEVELS))),
ADD_PRIO(0, KERNEL_RX_MACSEC_MIN_LEVEL, 0, FS_CHAINING_CAPS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(KERNEL_RX_MACSEC_NUM_PRIOS,
KERNEL_RX_MACSEC_NUM_LEVELS))),
ADD_PRIO(0, LAG_MIN_LEVEL, 0, FS_CHAINING_CAPS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(LAG_NUM_PRIOS,
LAG_PRIO_NUM_LEVELS))),
ADD_PRIO(0, OFFLOADS_MIN_LEVEL, 0, FS_CHAINING_CAPS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(OFFLOADS_NUM_PRIOS,
OFFLOADS_MAX_FT))),
ADD_PRIO(0, ETHTOOL_MIN_LEVEL, 0, FS_CHAINING_CAPS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(ETHTOOL_NUM_PRIOS,
ETHTOOL_PRIO_NUM_LEVELS))),
ADD_PRIO(0, KERNEL_MIN_LEVEL, 0, {},
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(KERNEL_NIC_TC_NUM_PRIOS,
KERNEL_NIC_TC_NUM_LEVELS),
ADD_MULTIPLE_PRIO(KERNEL_NIC_PROMISC_NUM_PRIOS,
KERNEL_NIC_PROMISC_NUM_LEVELS),
ADD_MULTIPLE_PRIO(KERNEL_NIC_NUM_PRIOS,
KERNEL_NIC_PRIO_NUM_LEVELS))),
ADD_PRIO(0, BY_PASS_MIN_LEVEL, 0, FS_CHAINING_CAPS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(LEFTOVERS_NUM_PRIOS,
LEFTOVERS_NUM_LEVELS))),
ADD_PRIO(0, ANCHOR_MIN_LEVEL, 0, {},
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(ANCHOR_NUM_PRIOS,
ANCHOR_NUM_LEVELS))),
}
};
static struct init_tree_node egress_root_fs = {
.type = FS_TYPE_NAMESPACE,
.ar_size = 3,
.children = (struct init_tree_node[]) {
ADD_PRIO(0, MLX5_BY_PASS_NUM_PRIOS, 0,
FS_CHAINING_CAPS_EGRESS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(MLX5_BY_PASS_NUM_PRIOS,
BY_PASS_PRIO_NUM_LEVELS))),
ADD_PRIO(0, KERNEL_TX_IPSEC_MIN_LEVEL, 0,
FS_CHAINING_CAPS_EGRESS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(KERNEL_TX_IPSEC_NUM_PRIOS,
KERNEL_TX_IPSEC_NUM_LEVELS))),
ADD_PRIO(0, KERNEL_TX_MACSEC_MIN_LEVEL, 0,
FS_CHAINING_CAPS_EGRESS,
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
ADD_MULTIPLE_PRIO(KERNEL_TX_MACSEC_NUM_PRIOS,
KERNEL_TX_MACSEC_NUM_LEVELS))),
}
};
enum {
RDMA_RX_IPSEC_PRIO,
RDMA_RX_MACSEC_PRIO,
RDMA_RX_COUNTERS_PRIO,
RDMA_RX_BYPASS_PRIO,
RDMA_RX_KERNEL_PRIO,
};
#define RDMA_RX_IPSEC_NUM_PRIOS 1
#define RDMA_RX_IPSEC_NUM_LEVELS 4
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/mlx5/driver.h`, `linux/mlx5/vport.h`, `linux/mlx5/eswitch.h`, `net/devlink.h`, `mlx5_core.h`, `fs_core.h`, `fs_cmd.h`.
- Detected declarations: `struct node_caps`, `struct match_list`, `struct mlx5_vport_acl_root_ns`, `enum fs_i_lock_class`, `function Copyright`, `function tree_init_node`, `function tree_add_node`, `function tree_get_node`, `function nested_down_read_ref_node`, `function nested_down_write_ref_node`.
- 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.