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.

Dependency Surface

Detected Declarations

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

Implementation Notes