drivers/net/ethernet/netronome/nfp/flower/conntrack.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/flower/conntrack.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/netronome/nfp/flower/conntrack.h
Extension
.h
Size
9400 bytes
Lines
290
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 nfp_fl_ct_zone_entry {
	u16 zone;
	struct rhash_head hash_node;

	struct nfp_flower_priv *priv;
	struct nf_flowtable *nft;

	struct list_head pre_ct_list;
	unsigned int pre_ct_count;

	struct list_head post_ct_list;
	unsigned int post_ct_count;

	struct rhashtable tc_merge_tb;
	unsigned int tc_merge_count;

	struct list_head nft_flows_list;
	unsigned int nft_flows_count;

	struct rhashtable nft_merge_tb;
	unsigned int nft_merge_count;
};

enum ct_entry_type {
	CT_TYPE_PRE_CT,
	CT_TYPE_NFT,
	CT_TYPE_POST_CT,
	_CT_TYPE_MAX,
};

#define NFP_MAX_RECIRC_CT_ZONES 4
#define NFP_MAX_ENTRY_RULES  (NFP_MAX_RECIRC_CT_ZONES * 2 + 1)

enum nfp_nfp_layer_name {
	FLOW_PAY_META_TCI =    0,
	FLOW_PAY_INPORT,
	FLOW_PAY_EXT_META,
	FLOW_PAY_MAC_MPLS,
	FLOW_PAY_L4,
	FLOW_PAY_IPV4,
	FLOW_PAY_IPV6,
	FLOW_PAY_CT,
	FLOW_PAY_GRE,
	FLOW_PAY_QINQ,
	FLOW_PAY_UDP_TUN,
	FLOW_PAY_GENEVE_OPT,

	_FLOW_PAY_LAYERS_MAX
};

/* NFP flow entry flags. */
#define NFP_FL_ACTION_DO_NAT		BIT(0)
#define NFP_FL_ACTION_DO_MANGLE		BIT(1)

/**
 * struct nfp_fl_ct_flow_entry - Flow entry containing conntrack flow information
 * @cookie:	Flow cookie, same as original TC flow, used as key
 * @list_node:	Used by the list
 * @chain_index:	Chain index of the original flow
 * @goto_chain_index:	goto chain index of the flow
 * @netdev:	netdev structure.
 * @zt:		Reference to the zone table this belongs to
 * @children:	List of tc_merge flows this flow forms part of
 * @rule:	Reference to the original TC flow rule
 * @stats:	Used to cache stats for updating
 * @prev_m_entries:	Array of all previous nft_tc_merge entries
 * @num_prev_m_entries:	The number of all previous nft_tc_merge entries
 * @tun_offset: Used to indicate tunnel action offset in action list
 * @flags:	Used to indicate flow flag like NAT which used by merge.
 * @type:	Type of ct-entry from enum ct_entry_type
 */
struct nfp_fl_ct_flow_entry {
	unsigned long cookie;
	struct list_head list_node;
	u32 chain_index;
	u32 goto_chain_index;
	struct net_device *netdev;
	struct nfp_fl_ct_zone_entry *zt;
	struct list_head children;
	struct flow_rule *rule;
	struct flow_stats stats;
	struct nfp_fl_nft_tc_merge *prev_m_entries[NFP_MAX_RECIRC_CT_ZONES - 1];
	u8 num_prev_m_entries;
	u8 tun_offset;		// Set to NFP_FL_CT_NO_TUN if no tun
	u8 flags;
	u8 type;
};

/**
 * struct nfp_fl_ct_tc_merge - Merge of two flows from tc

Annotation

Implementation Notes