drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.h- Extension
.h- Size
- 1892 bytes
- Lines
- 58
- 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/hashtable.hlinux/mlx5/fs.h
Detected Declarations
struct mlx5e_mod_hdr_handlestruct mlx5e_tc_mod_hdr_actsfunction mlx5e_mod_hdr_max_actions
Annotated Snippet
struct mlx5e_tc_mod_hdr_acts {
int num_actions;
int max_actions;
bool is_static;
void *actions;
};
#define DECLARE_MOD_HDR_ACTS_ACTIONS(name, len) \
u8 name[len][MLX5_MH_ACT_SZ] = {}
#define DECLARE_MOD_HDR_ACTS(name, acts_arr) \
struct mlx5e_tc_mod_hdr_acts name = { \
.max_actions = ARRAY_SIZE(acts_arr), \
.is_static = true, \
.actions = acts_arr, \
}
char *mlx5e_mod_hdr_alloc(struct mlx5_core_dev *mdev, int namespace,
struct mlx5e_tc_mod_hdr_acts *mod_hdr_acts);
void mlx5e_mod_hdr_dealloc(struct mlx5e_tc_mod_hdr_acts *mod_hdr_acts);
char *mlx5e_mod_hdr_get_item(struct mlx5e_tc_mod_hdr_acts *mod_hdr_acts, int pos);
struct mlx5e_mod_hdr_handle *
mlx5e_mod_hdr_attach(struct mlx5_core_dev *mdev,
struct mod_hdr_tbl *tbl,
enum mlx5_flow_namespace_type namespace,
struct mlx5e_tc_mod_hdr_acts *mod_hdr_acts);
void mlx5e_mod_hdr_detach(struct mlx5_core_dev *mdev,
struct mod_hdr_tbl *tbl,
struct mlx5e_mod_hdr_handle *mh);
struct mlx5_modify_hdr *mlx5e_mod_hdr_get(struct mlx5e_mod_hdr_handle *mh);
void mlx5e_mod_hdr_tbl_init(struct mod_hdr_tbl *tbl);
void mlx5e_mod_hdr_tbl_destroy(struct mod_hdr_tbl *tbl);
static inline int mlx5e_mod_hdr_max_actions(struct mlx5_core_dev *mdev, int namespace)
{
if (namespace == MLX5_FLOW_NAMESPACE_FDB) /* FDB offloading */
return MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, max_modify_header_actions);
else /* namespace is MLX5_FLOW_NAMESPACE_KERNEL - NIC offloading */
return MLX5_CAP_FLOWTABLE_NIC_RX(mdev, max_modify_header_actions);
}
#endif /* __MLX5E_EN_MOD_HDR_H__ */
Annotation
- Immediate include surface: `linux/hashtable.h`, `linux/mlx5/fs.h`.
- Detected declarations: `struct mlx5e_mod_hdr_handle`, `struct mlx5e_tc_mod_hdr_acts`, `function mlx5e_mod_hdr_max_actions`.
- 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.