drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c- Extension
.c- Size
- 33077 bytes
- Lines
- 1109
- 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.
- 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
dr_types.h
Detected Declarations
function dr_mask_is_smac_setfunction dr_mask_is_dmac_setfunction dr_mask_is_l3_base_setfunction dr_mask_is_tcp_udp_base_setfunction dr_mask_is_ipv4_setfunction dr_mask_is_ipv4_5_tuple_setfunction dr_mask_is_eth_l2_tnl_setfunction dr_mask_is_ttl_setfunction dr_mask_is_ipv4_ihl_setfunction dr_mask_is_tnl_gre_setfunction dr_mask_is_vxlan_gpe_setfunction dr_matcher_supp_vxlan_gpefunction dr_mask_is_tnl_vxlan_gpefunction dr_mask_is_tnl_geneve_setfunction dr_mask_is_tnl_geneve_tlv_optfunction dr_matcher_supp_flex_parser_okfunction dr_mask_is_tnl_geneve_tlv_opt_exist_setfunction dr_matcher_supp_tnl_genevefunction dr_mask_is_tnl_genevefunction dr_mask_is_tnl_gtpu_setfunction dr_matcher_supp_tnl_gtpufunction dr_mask_is_tnl_gtpufunction dr_matcher_supp_tnl_gtpu_dw_0function dr_mask_is_tnl_gtpu_dw_0function dr_matcher_supp_tnl_gtpu_teidfunction dr_mask_is_tnl_gtpu_teidfunction dr_matcher_supp_tnl_gtpu_dw_2function dr_mask_is_tnl_gtpu_dw_2function dr_matcher_supp_tnl_gtpu_first_extfunction dr_mask_is_tnl_gtpu_first_extfunction dr_mask_is_tnl_gtpu_flex_parser_0function dr_mask_is_tnl_gtpu_flex_parser_1function dr_mask_is_tnl_gtpu_anyfunction dr_matcher_supp_icmp_v4function dr_matcher_supp_icmp_v6function dr_mask_is_icmpv6_setfunction dr_mask_is_icmpfunction dr_mask_is_wqe_metadata_setfunction dr_mask_is_reg_c_0_3_setfunction dr_mask_is_reg_c_4_7_setfunction dr_mask_is_gvmi_or_qpn_setfunction dr_mask_is_flex_parser_id_0_3_setfunction dr_mask_is_flex_parser_0_3_setfunction dr_mask_is_flex_parser_id_4_7_setfunction dr_mask_is_flex_parser_4_7_setfunction dr_matcher_supp_tnl_mpls_over_grefunction dr_mask_is_tnl_mpls_over_grefunction dr_matcher_supp_tnl_mpls_over_udp
Annotated Snippet
dr_mask_is_dmac_set(&mask.outer)) {
mlx5dr_ste_build_eth_l2_src_dst(ste_ctx, &sb[idx++],
&mask, inner, rx);
}
if (dr_mask_is_smac_set(&mask.outer))
mlx5dr_ste_build_eth_l2_src(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (DR_MASK_IS_L2_DST(mask.outer, mask.misc, outer))
mlx5dr_ste_build_eth_l2_dst(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (outer_ipv == DR_RULE_IPV6) {
if (DR_MASK_IS_DST_IP_SET(&mask.outer))
mlx5dr_ste_build_eth_l3_ipv6_dst(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (DR_MASK_IS_SRC_IP_SET(&mask.outer))
mlx5dr_ste_build_eth_l3_ipv6_src(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (DR_MASK_IS_ETH_L4_SET(mask.outer, mask.misc, outer))
mlx5dr_ste_build_eth_ipv6_l3_l4(ste_ctx, &sb[idx++],
&mask, inner, rx);
} else {
if (dr_mask_is_ipv4_5_tuple_set(&mask.outer))
mlx5dr_ste_build_eth_l3_ipv4_5_tuple(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (dr_mask_is_ttl_set(&mask.outer) ||
dr_mask_is_ipv4_ihl_set(&mask.outer))
mlx5dr_ste_build_eth_l3_ipv4_misc(ste_ctx, &sb[idx++],
&mask, inner, rx);
}
if (dr_mask_is_tnl_vxlan_gpe(&mask, dmn))
mlx5dr_ste_build_tnl_vxlan_gpe(ste_ctx, &sb[idx++],
&mask, inner, rx);
else if (dr_mask_is_tnl_geneve(&mask, dmn)) {
mlx5dr_ste_build_tnl_geneve(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (dr_mask_is_tnl_geneve_tlv_opt(&mask.misc3))
mlx5dr_ste_build_tnl_geneve_tlv_opt(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
if (dr_mask_is_tnl_geneve_tlv_opt_exist_set(&mask.misc, dmn))
mlx5dr_ste_build_tnl_geneve_tlv_opt_exist(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
} else if (dr_mask_is_tnl_gtpu_any(&mask, dmn)) {
if (dr_mask_is_tnl_gtpu_flex_parser_0(&mask, dmn))
mlx5dr_ste_build_tnl_gtpu_flex_parser_0(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
if (dr_mask_is_tnl_gtpu_flex_parser_1(&mask, dmn))
mlx5dr_ste_build_tnl_gtpu_flex_parser_1(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
if (dr_mask_is_tnl_gtpu(&mask, dmn))
mlx5dr_ste_build_tnl_gtpu(ste_ctx, &sb[idx++],
&mask, inner, rx);
} else if (dr_mask_is_tnl_header_0_1_set(&mask.misc5)) {
mlx5dr_ste_build_tnl_header_0_1(ste_ctx, &sb[idx++],
&mask, inner, rx);
}
if (DR_MASK_IS_ETH_L4_MISC_SET(mask.misc3, outer))
mlx5dr_ste_build_eth_l4_misc(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (DR_MASK_IS_FIRST_MPLS_SET(mask.misc2, outer))
mlx5dr_ste_build_mpls(ste_ctx, &sb[idx++],
&mask, inner, rx);
if (dr_mask_is_tnl_mpls_over_gre(&mask, dmn))
mlx5dr_ste_build_tnl_mpls_over_gre(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
else if (dr_mask_is_tnl_mpls_over_udp(&mask, dmn))
mlx5dr_ste_build_tnl_mpls_over_udp(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
if (dr_mask_is_icmp(&mask, dmn))
mlx5dr_ste_build_icmp(ste_ctx, &sb[idx++],
&mask, &dmn->info.caps,
inner, rx);
Annotation
- Immediate include surface: `dr_types.h`.
- Detected declarations: `function dr_mask_is_smac_set`, `function dr_mask_is_dmac_set`, `function dr_mask_is_l3_base_set`, `function dr_mask_is_tcp_udp_base_set`, `function dr_mask_is_ipv4_set`, `function dr_mask_is_ipv4_5_tuple_set`, `function dr_mask_is_eth_l2_tnl_set`, `function dr_mask_is_ttl_set`, `function dr_mask_is_ipv4_ihl_set`, `function dr_mask_is_tnl_gre_set`.
- 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.