drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.h- Extension
.h- Size
- 1810 bytes
- Lines
- 67
- 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
eswitch.h
Detected Declarations
struct mlx5_flow_attrstruct mlx5e_tc_psamplestruct mlx5e_post_actstruct mlx5e_sample_attrfunction mlx5e_tc_sample_offloadfunction mlx5e_tc_sample_unoffloadfunction mlx5e_tc_sample_cleanup
Annotated Snippet
struct mlx5e_sample_attr {
u32 group_num;
u32 rate;
u32 trunc_size;
u32 restore_obj_id;
u32 sampler_id;
struct mlx5e_sample_flow *sample_flow;
};
#if IS_ENABLED(CONFIG_MLX5_TC_SAMPLE)
void mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_obj);
struct mlx5_flow_handle *
mlx5e_tc_sample_offload(struct mlx5e_tc_psample *sample_priv,
struct mlx5_flow_spec *spec,
struct mlx5_flow_attr *attr);
void
mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *sample_priv,
struct mlx5_flow_handle *rule,
struct mlx5_flow_attr *attr);
struct mlx5e_tc_psample *
mlx5e_tc_sample_init(struct mlx5_eswitch *esw, struct mlx5e_post_act *post_act);
void
mlx5e_tc_sample_cleanup(struct mlx5e_tc_psample *tc_psample);
#else /* CONFIG_MLX5_TC_SAMPLE */
static inline struct mlx5_flow_handle *
mlx5e_tc_sample_offload(struct mlx5e_tc_psample *tc_psample,
struct mlx5_flow_spec *spec,
struct mlx5_flow_attr *attr)
{ return ERR_PTR(-EOPNOTSUPP); }
static inline void
mlx5e_tc_sample_unoffload(struct mlx5e_tc_psample *tc_psample,
struct mlx5_flow_handle *rule,
struct mlx5_flow_attr *attr) {}
static inline struct mlx5e_tc_psample *
mlx5e_tc_sample_init(struct mlx5_eswitch *esw, struct mlx5e_post_act *post_act)
{ return ERR_PTR(-EOPNOTSUPP); }
static inline void
mlx5e_tc_sample_cleanup(struct mlx5e_tc_psample *tc_psample) {}
static inline void
mlx5e_tc_sample_skb(struct sk_buff *skb, struct mlx5_mapped_obj *mapped_obj) {}
#endif /* CONFIG_MLX5_TC_SAMPLE */
#endif /* __MLX5_EN_TC_SAMPLE_H__ */
Annotation
- Immediate include surface: `eswitch.h`.
- Detected declarations: `struct mlx5_flow_attr`, `struct mlx5e_tc_psample`, `struct mlx5e_post_act`, `struct mlx5e_sample_attr`, `function mlx5e_tc_sample_offload`, `function mlx5e_tc_sample_unoffload`, `function mlx5e_tc_sample_cleanup`.
- 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.