drivers/net/ethernet/sfc/tc.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/tc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/tc.h- Extension
.h- Size
- 11757 bytes
- Lines
- 360
- 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/flow_offload.hlinux/rhashtable.hnet_driver.htc_counters.h
Detected Declarations
struct efx_tc_mac_pedit_actionstruct efx_tc_encap_actionstruct efx_tc_action_setstruct efx_tc_match_fieldsstruct efx_tc_encap_matchstruct efx_tc_recirc_idstruct efx_tc_matchstruct efx_tc_action_set_liststruct efx_tc_lhs_actionstruct efx_tc_flow_rulestruct efx_tc_lhs_rulestruct efx_tc_table_field_fmtstruct efx_tc_table_descstruct efx_tc_table_ctstruct efx_tc_statestruct efx_repenum efx_tc_em_pseudo_typeenum efx_tc_rule_priosfunction efx_ipv6_addr_all_onesfunction efx_tc_match_is_encap
Annotated Snippet
struct efx_tc_mac_pedit_action {
u8 h_addr[ETH_ALEN];
struct rhash_head linkage;
refcount_t ref;
u32 fw_id; /* index of this entry in firmware MAC address table */
};
static inline bool efx_ipv6_addr_all_ones(struct in6_addr *addr)
{
return !memchr_inv(addr, 0xff, sizeof(*addr));
}
struct efx_tc_encap_action; /* see tc_encap_actions.h */
/**
* struct efx_tc_action_set - collection of tc action fields
*
* @vlan_push: the number of vlan headers to push
* @vlan_pop: the number of vlan headers to pop
* @decap: used to indicate a tunnel header decapsulation should take place
* @do_nat: perform NAT/NPT with values returned by conntrack match
* @do_ttl_dec: used to indicate IP TTL / Hop Limit should be decremented
* @deliver: used to indicate a deliver action should take place
* @vlan_tci: tci fields for vlan push actions
* @vlan_proto: ethernet types for vlan push actions
* @count: counter mapping
* @encap_md: encap entry in tc_encap_ht table
* @encap_user: linked list of encap users (encap_md->users)
* @user: owning action-set-list. Only populated if @encap_md is; used by efx_tc_update_encap() fallback handling
* @count_user: linked list of counter users (counter->users)
* @dest_mport: destination mport
* @src_mac: source mac entry in tc_mac_ht table
* @dst_mac: destination mac entry in tc_mac_ht table
* @fw_id: index of this entry in firmware actions table
* @list: linked list of tc actions
*
*/
struct efx_tc_action_set {
u16 vlan_push:2;
u16 vlan_pop:2;
u16 decap:1;
u16 do_nat:1;
u16 do_ttl_dec:1;
u16 deliver:1;
__be16 vlan_tci[2];
__be16 vlan_proto[2];
struct efx_tc_counter_index *count;
struct efx_tc_encap_action *encap_md;
struct list_head encap_user;
struct efx_tc_action_set_list *user;
struct list_head count_user;
u32 dest_mport;
struct efx_tc_mac_pedit_action *src_mac;
struct efx_tc_mac_pedit_action *dst_mac;
u32 fw_id;
struct list_head list;
};
struct efx_tc_match_fields {
/* L1 */
u32 ingress_port;
u8 recirc_id; /* mapped from (u32) TC chain_index to smaller space */
/* L2 (inner when encap) */
__be16 eth_proto;
__be16 vlan_tci[2], vlan_proto[2];
u8 eth_saddr[ETH_ALEN], eth_daddr[ETH_ALEN];
/* L3 (when IP) */
u8 ip_proto, ip_tos, ip_ttl;
__be32 src_ip, dst_ip;
#ifdef CONFIG_IPV6
struct in6_addr src_ip6, dst_ip6;
#endif
bool ip_frag, ip_firstfrag;
/* L4 */
__be16 l4_sport, l4_dport; /* Ports (UDP, TCP) */
__be16 tcp_flags;
bool tcp_syn_fin_rst; /* true if ANY of SYN/FIN/RST are set */
/* Encap. The following are *outer* fields. Note that there are no
* outer eth (L2) fields; this is because TC doesn't have them.
*/
__be32 enc_src_ip, enc_dst_ip;
struct in6_addr enc_src_ip6, enc_dst_ip6;
u8 enc_ip_tos, enc_ip_ttl;
__be16 enc_sport, enc_dport;
__be32 enc_keyid; /* e.g. VNI, VSID */
/* Conntrack. */
u16 ct_state_trk:1, ct_state_est:1;
u32 ct_mark;
u16 ct_zone;
};
Annotation
- Immediate include surface: `net/flow_offload.h`, `linux/rhashtable.h`, `net_driver.h`, `tc_counters.h`.
- Detected declarations: `struct efx_tc_mac_pedit_action`, `struct efx_tc_encap_action`, `struct efx_tc_action_set`, `struct efx_tc_match_fields`, `struct efx_tc_encap_match`, `struct efx_tc_recirc_id`, `struct efx_tc_match`, `struct efx_tc_action_set_list`, `struct efx_tc_lhs_action`, `struct efx_tc_flow_rule`.
- 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.