drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en_tc.h- Extension
.h- Size
- 13672 bytes
- Lines
- 409
- 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
net/pkt_cls.hen.heswitch.hen/tc_ct.hen/tc_tun.hen/tc/int_port.hen/tc/meter.hen_rep.h
Detected Declarations
struct mlx5e_tc_update_privstruct mlx5_nic_flow_attrstruct mlx5_flow_attrstruct mlx5_rx_tun_attrstruct tunnel_match_keystruct tunnel_match_enc_optsstruct mlx5e_encap_entrystruct mlx5e_neigh_hash_entrystruct mlx5e_tc_attr_to_reg_mappingenum mlx5e_tc_attr_to_regfunction mlx5e_tc_attr_flags_skipfunction mlx5e_tc_nic_initfunction mlx5e_tc_nic_cleanupfunction mlx5e_tc_ht_cleanupfunction mlx5e_tc_nic_initfunction mlx5e_tc_nic_cleanupfunction mlx5e_setup_tc_block_cbfunction mlx5e_cqe_regb_chainfunction mlx5e_tc_table_freefunction mlx5e_tc_update_skb_nic
Annotated Snippet
struct mlx5e_tc_update_priv {
struct net_device *fwd_dev;
bool skb_done;
bool forward_tx;
};
struct mlx5_nic_flow_attr {
u32 flow_tag;
u32 hairpin_tirn;
struct mlx5_flow_table *hairpin_ft;
};
struct mlx5_flow_attr {
u32 action;
unsigned long tc_act_cookies[TCA_ACT_MAX_PRIO];
struct mlx5_fc *counter;
struct mlx5_modify_hdr *modify_hdr;
struct mlx5e_mod_hdr_handle *mh; /* attached mod header instance */
struct mlx5e_mod_hdr_handle *slow_mh; /* attached mod header instance for slow path */
struct mlx5_ct_attr ct_attr;
struct mlx5e_sample_attr sample_attr;
struct mlx5e_meter_attr meter_attr;
struct mlx5e_tc_flow_parse_attr *parse_attr;
u32 chain;
u16 prio;
u16 tc_act_cookies_count;
u32 dest_chain;
struct mlx5_flow_table *ft;
struct mlx5_flow_table *dest_ft;
struct mlx5_flow_table *extra_split_ft;
u8 inner_match_level;
u8 outer_match_level;
u8 tun_ip_version;
int tunnel_id; /* mapped tunnel id */
u32 flags;
u32 exe_aso_type;
struct list_head list;
struct mlx5e_post_act_handle *post_act_handle;
struct mlx5_flow_attr *branch_true;
struct mlx5_flow_attr *branch_false;
struct mlx5_flow_attr *jumping_attr;
struct mlx5_flow_handle *act_id_restore_rule;
/* keep this union last */
union {
DECLARE_FLEX_ARRAY(struct mlx5_esw_flow_attr, esw_attr);
DECLARE_FLEX_ARRAY(struct mlx5_nic_flow_attr, nic_attr);
};
};
enum {
MLX5_ATTR_FLAG_VLAN_HANDLED = BIT(0),
MLX5_ATTR_FLAG_SLOW_PATH = BIT(1),
MLX5_ATTR_FLAG_NO_IN_PORT = BIT(2),
MLX5_ATTR_FLAG_SRC_REWRITE = BIT(3),
MLX5_ATTR_FLAG_SAMPLE = BIT(4),
MLX5_ATTR_FLAG_ACCEPT = BIT(5),
MLX5_ATTR_FLAG_CT = BIT(6),
MLX5_ATTR_FLAG_TERMINATING = BIT(7),
MLX5_ATTR_FLAG_MTU = BIT(8),
};
/* Returns true if any of the flags that require skipping further TC/NF processing are set. */
static inline bool
mlx5e_tc_attr_flags_skip(u32 attr_flags)
{
return attr_flags & (MLX5_ATTR_FLAG_SLOW_PATH | MLX5_ATTR_FLAG_ACCEPT);
}
struct mlx5_rx_tun_attr {
u16 decap_vport;
union {
__be32 v4;
struct in6_addr v6;
} src_ip; /* Valid if decap_vport is not zero */
union {
__be32 v4;
struct in6_addr v6;
} dst_ip; /* Valid if decap_vport is not zero */
};
#define MLX5E_TC_TABLE_CHAIN_TAG_BITS 16
#define MLX5E_TC_TABLE_CHAIN_TAG_MASK GENMASK(MLX5E_TC_TABLE_CHAIN_TAG_BITS - 1, 0)
#define MLX5E_TC_MAX_INT_PORT_NUM (32)
#if IS_ENABLED(CONFIG_MLX5_CLS_ACT)
struct tunnel_match_key {
struct flow_dissector_key_control enc_control;
struct flow_dissector_key_keyid enc_key_id;
Annotation
- Immediate include surface: `net/pkt_cls.h`, `en.h`, `eswitch.h`, `en/tc_ct.h`, `en/tc_tun.h`, `en/tc/int_port.h`, `en/tc/meter.h`, `en_rep.h`.
- Detected declarations: `struct mlx5e_tc_update_priv`, `struct mlx5_nic_flow_attr`, `struct mlx5_flow_attr`, `struct mlx5_rx_tun_attr`, `struct tunnel_match_key`, `struct tunnel_match_enc_opts`, `struct mlx5e_encap_entry`, `struct mlx5e_neigh_hash_entry`, `struct mlx5e_tc_attr_to_reg_mapping`, `enum mlx5e_tc_attr_to_reg`.
- 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.