drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h- Extension
.h- Size
- 13203 bytes
- Lines
- 434
- 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/refcount.hlinux/mlx5/fs.hlinux/rhashtable.hlinux/llist.hsteering/sws/fs_dr.hsteering/hws/fs_hws.h
Detected Declarations
struct mlx5_flow_definerstruct mlx5_modify_hdrstruct mlx5_pkt_reformatstruct mlx5_flow_steeringstruct fs_nodestruct mlx5_flow_rulestruct mlx5_flow_handlestruct mlx5_flow_tablestruct mlx5_ft_underlay_qpstruct fs_fte_actionstruct fs_fte_dupstruct fs_ftestruct fs_priostruct mlx5_flow_namespacestruct mlx5_flow_group_maskstruct mlx5_flow_groupstruct mlx5_flow_root_namespacestruct mlx5_fc_cachestruct mlx5_fcstruct mlx5_fc_bulkenum mlx5_flow_resource_ownerenum fs_node_typeenum fs_flow_table_op_modenum fs_fte_statusenum mlx5_flow_steering_modeenum mlx5_flow_steering_capabiltyenum mlx5_fc_type
Annotated Snippet
struct mlx5_flow_definer {
enum mlx5_flow_namespace_type ns_type;
u32 id;
};
enum mlx5_flow_resource_owner {
MLX5_FLOW_RESOURCE_OWNER_FW,
MLX5_FLOW_RESOURCE_OWNER_SW,
MLX5_FLOW_RESOURCE_OWNER_HWS,
};
struct mlx5_modify_hdr {
enum mlx5_flow_namespace_type ns_type;
enum mlx5_flow_resource_owner owner;
union {
struct mlx5_fs_dr_action fs_dr_action;
struct mlx5_fs_hws_action fs_hws_action;
u32 id;
};
};
struct mlx5_pkt_reformat {
enum mlx5_flow_namespace_type ns_type;
int reformat_type; /* from mlx5_ifc */
enum mlx5_flow_resource_owner owner;
union {
struct mlx5_fs_dr_action fs_dr_action;
struct mlx5_fs_hws_action fs_hws_action;
u32 id;
};
};
/* FS_TYPE_PRIO_CHAINS is a PRIO that will have namespaces only,
* and those are in parallel to one another when going over them to connect
* a new flow table. Meaning the last flow table in a TYPE_PRIO prio in one
* parallel namespace will not automatically connect to the first flow table
* found in any prio in any next namespace, but skip the entire containing
* TYPE_PRIO_CHAINS prio.
*
* This is used to implement tc chains, each chain of prios is a different
* namespace inside a containing TYPE_PRIO_CHAINS prio.
*/
enum fs_node_type {
FS_TYPE_NAMESPACE,
FS_TYPE_PRIO,
FS_TYPE_PRIO_CHAINS,
FS_TYPE_FLOW_TABLE,
FS_TYPE_FLOW_GROUP,
FS_TYPE_FLOW_ENTRY,
FS_TYPE_FLOW_DEST
};
enum fs_flow_table_op_mod {
FS_FT_OP_MOD_NORMAL,
FS_FT_OP_MOD_LAG_DEMUX,
};
enum fs_fte_status {
FS_FTE_STATUS_EXISTING = 1UL << 0,
};
enum mlx5_flow_steering_mode {
MLX5_FLOW_STEERING_MODE_DMFS,
MLX5_FLOW_STEERING_MODE_SMFS,
MLX5_FLOW_STEERING_MODE_HMFS,
};
enum mlx5_flow_steering_capabilty {
MLX5_FLOW_STEERING_CAP_VLAN_PUSH_ON_RX = 1UL << 0,
MLX5_FLOW_STEERING_CAP_VLAN_POP_ON_TX = 1UL << 1,
MLX5_FLOW_STEERING_CAP_MATCH_RANGES = 1UL << 2,
MLX5_FLOW_STEERING_CAP_DUPLICATE_MATCH = 1UL << 3,
};
struct mlx5_flow_steering {
struct mlx5_core_dev *dev;
enum mlx5_flow_steering_mode mode;
struct kmem_cache *fgs_cache;
struct kmem_cache *ftes_cache;
struct mlx5_flow_root_namespace *root_ns;
struct mlx5_flow_root_namespace *fdb_root_ns;
struct mlx5_flow_namespace **fdb_sub_ns;
struct xarray esw_egress_root_ns;
struct xarray esw_ingress_root_ns;
struct mlx5_flow_root_namespace *sniffer_tx_root_ns;
struct mlx5_flow_root_namespace *sniffer_rx_root_ns;
struct mlx5_flow_root_namespace *rdma_rx_root_ns;
struct mlx5_flow_root_namespace *rdma_tx_root_ns;
struct mlx5_flow_root_namespace *egress_root_ns;
Annotation
- Immediate include surface: `linux/refcount.h`, `linux/mlx5/fs.h`, `linux/rhashtable.h`, `linux/llist.h`, `steering/sws/fs_dr.h`, `steering/hws/fs_hws.h`.
- Detected declarations: `struct mlx5_flow_definer`, `struct mlx5_modify_hdr`, `struct mlx5_pkt_reformat`, `struct mlx5_flow_steering`, `struct fs_node`, `struct mlx5_flow_rule`, `struct mlx5_flow_handle`, `struct mlx5_flow_table`, `struct mlx5_ft_underlay_qp`, `struct fs_fte_action`.
- 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.