drivers/net/ethernet/intel/ice/ice_tc_lib.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_tc_lib.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_tc_lib.c- Extension
.c- Size
- 65667 bytes
- Lines
- 2350
- 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.
- 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
ice.hice_tc_lib.hice_fltr.hice_lib.hice_protocol_type.h
Detected Declarations
function ice_tc_count_lkupsfunction ice_proto_type_from_macfunction ice_proto_type_from_etypefunction ice_proto_type_from_ipv4function ice_proto_type_from_ipv6function ice_proto_type_from_l4_portfunction ice_proto_type_from_tunnelfunction ice_sw_type_from_tunnelfunction ice_check_supported_vlan_tpidfunction ice_tc_fill_tunnel_outerfunction ice_tc_fill_rulesfunction ice_tc_tun_get_typefunction ice_is_tunnel_supportedfunction ice_tc_is_dev_uplinkfunction ice_tc_setup_actionfunction ice_tc_is_dev_uplinkfunction ice_is_port_repr_netdevfunction ice_tc_setup_drop_actionfunction ice_eswitch_tc_parse_actionfunction ice_is_fltr_lldpfunction ice_is_fltr_pf_tx_lldpfunction ice_is_fltr_vf_tx_lldpfunction ice_find_pf_tx_lldp_fltrfunction ice_any_vf_lldp_tx_enafunction ice_pass_vf_tx_lldpfunction ice_drop_vf_tx_lldpfunction ice_handle_add_pf_lldp_drop_rulefunction hlist_for_each_entryfunction ice_handle_del_pf_lldp_drop_rulefunction ice_eswitch_add_tc_fltrfunction ice_locate_vsi_using_queuefunction ice_locate_rx_ring_using_queuefunction ice_tc_forward_actionfunction ice_add_tc_flower_adv_fltrfunction ice_tc_set_pppoefunction ice_tc_set_ipv4function ice_tc_set_ipv6function ipv6_addr_loopbackfunction ipv6_addr_anyfunction ice_tc_set_tos_ttlfunction ice_tc_set_portfunction ice_get_tunnel_devicefunction flow_action_for_eachfunction ice_parse_gtp_typefunction ice_parse_tunnel_attrfunction ice_parse_cls_flowerfunction BIT_ULLfunction ice_add_switch_fltr
Annotated Snippet
switch (fltr->tunnel_type) {
case TNL_VXLAN:
case TNL_GENEVE:
tenant_id = be32_to_cpu(fltr->tenant_id) << 8;
list[i].h_u.tnl_hdr.vni = cpu_to_be32(tenant_id);
memcpy(&list[i].m_u.tnl_hdr.vni, "\xff\xff\xff\x00", 4);
i++;
break;
case TNL_GRETAP:
list[i].h_u.nvgre_hdr.tni_flow = fltr->tenant_id;
memcpy(&list[i].m_u.nvgre_hdr.tni_flow,
"\xff\xff\xff\xff", 4);
i++;
break;
case TNL_GTPC:
case TNL_GTPU:
list[i].h_u.gtp_hdr.teid = fltr->tenant_id;
memcpy(&list[i].m_u.gtp_hdr.teid,
"\xff\xff\xff\xff", 4);
i++;
break;
default:
break;
}
}
if (flags & ICE_TC_FLWR_FIELD_ENC_DST_MAC) {
list[i].type = ice_proto_type_from_mac(false);
ether_addr_copy(list[i].h_u.eth_hdr.dst_addr,
hdr->l2_key.dst_mac);
ether_addr_copy(list[i].m_u.eth_hdr.dst_addr,
hdr->l2_mask.dst_mac);
i++;
}
if (flags & ICE_TC_FLWR_FIELD_GTP_OPTS) {
list[i].type = ice_proto_type_from_tunnel(fltr->tunnel_type);
if (fltr->gtp_pdu_info_masks.pdu_type) {
list[i].h_u.gtp_hdr.pdu_type =
fltr->gtp_pdu_info_keys.pdu_type << 4;
memcpy(&list[i].m_u.gtp_hdr.pdu_type, "\xf0", 1);
}
if (fltr->gtp_pdu_info_masks.qfi) {
list[i].h_u.gtp_hdr.qfi = fltr->gtp_pdu_info_keys.qfi;
memcpy(&list[i].m_u.gtp_hdr.qfi, "\x3f", 1);
}
i++;
}
if (flags & ICE_TC_FLWR_FIELD_PFCP_OPTS) {
struct ice_pfcp_hdr *hdr_h, *hdr_m;
hdr_h = &list[i].h_u.pfcp_hdr;
hdr_m = &list[i].m_u.pfcp_hdr;
list[i].type = ICE_PFCP;
hdr_h->flags = fltr->pfcp_meta_keys.type;
hdr_m->flags = fltr->pfcp_meta_masks.type & 0x01;
hdr_h->seid = fltr->pfcp_meta_keys.seid;
hdr_m->seid = fltr->pfcp_meta_masks.seid;
i++;
}
if (flags & (ICE_TC_FLWR_FIELD_ENC_SRC_IPV4 |
ICE_TC_FLWR_FIELD_ENC_DEST_IPV4)) {
list[i].type = ice_proto_type_from_ipv4(false);
if (flags & ICE_TC_FLWR_FIELD_ENC_SRC_IPV4) {
list[i].h_u.ipv4_hdr.src_addr = hdr->l3_key.src_ipv4;
list[i].m_u.ipv4_hdr.src_addr = hdr->l3_mask.src_ipv4;
}
if (flags & ICE_TC_FLWR_FIELD_ENC_DEST_IPV4) {
list[i].h_u.ipv4_hdr.dst_addr = hdr->l3_key.dst_ipv4;
list[i].m_u.ipv4_hdr.dst_addr = hdr->l3_mask.dst_ipv4;
}
i++;
}
if (flags & (ICE_TC_FLWR_FIELD_ENC_SRC_IPV6 |
ICE_TC_FLWR_FIELD_ENC_DEST_IPV6)) {
list[i].type = ice_proto_type_from_ipv6(false);
if (flags & ICE_TC_FLWR_FIELD_ENC_SRC_IPV6) {
memcpy(&list[i].h_u.ipv6_hdr.src_addr,
&hdr->l3_key.src_ipv6_addr,
Annotation
- Immediate include surface: `ice.h`, `ice_tc_lib.h`, `ice_fltr.h`, `ice_lib.h`, `ice_protocol_type.h`.
- Detected declarations: `function ice_tc_count_lkups`, `function ice_proto_type_from_mac`, `function ice_proto_type_from_etype`, `function ice_proto_type_from_ipv4`, `function ice_proto_type_from_ipv6`, `function ice_proto_type_from_l4_port`, `function ice_proto_type_from_tunnel`, `function ice_sw_type_from_tunnel`, `function ice_check_supported_vlan_tpid`, `function ice_tc_fill_tunnel_outer`.
- 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.