Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_flow.h
Show All 28 Lines | |||||
* POSSIBILITY OF SUCH DAMAGE. | * POSSIBILITY OF SUCH DAMAGE. | ||||
*/ | */ | ||||
/*$FreeBSD$*/ | /*$FreeBSD$*/ | ||||
#ifndef _ICE_FLOW_H_ | #ifndef _ICE_FLOW_H_ | ||||
#define _ICE_FLOW_H_ | #define _ICE_FLOW_H_ | ||||
#include "ice_flex_type.h" | #include "ice_flex_type.h" | ||||
#define ICE_IPV4_MAKE_PREFIX_MASK(prefix) ((u32)(~0) << (32 - (prefix))) | #define ICE_IPV4_MAKE_PREFIX_MASK(prefix) ((u32)(~0) << (32 - (prefix))) | ||||
#define ICE_FLOW_PROF_ID_INVAL 0xfffffffffffffffful | #define ICE_FLOW_PROF_ID_INVAL 0xfffffffffffffffful | ||||
#define ICE_FLOW_PROF_ID_BYPASS 0 | #define ICE_FLOW_PROF_ID_BYPASS 0 | ||||
#define ICE_FLOW_PROF_ID_DEFAULT 1 | #define ICE_FLOW_PROF_ID_DEFAULT 1 | ||||
#define ICE_FLOW_ENTRY_HANDLE_INVAL 0 | #define ICE_FLOW_ENTRY_HANDLE_INVAL 0 | ||||
#define ICE_FLOW_VSI_INVAL 0xffff | #define ICE_FLOW_VSI_INVAL 0xffff | ||||
#define ICE_FLOW_FLD_OFF_INVAL 0xffff | #define ICE_FLOW_FLD_OFF_INVAL 0xffff | ||||
Show All 35 Lines | enum ice_flow_seg_hdr { | ||||
ICE_FLOW_SEG_HDR_IPV4 = 0x00000004, | ICE_FLOW_SEG_HDR_IPV4 = 0x00000004, | ||||
ICE_FLOW_SEG_HDR_IPV6 = 0x00000008, | ICE_FLOW_SEG_HDR_IPV6 = 0x00000008, | ||||
ICE_FLOW_SEG_HDR_ARP = 0x00000010, | ICE_FLOW_SEG_HDR_ARP = 0x00000010, | ||||
ICE_FLOW_SEG_HDR_ICMP = 0x00000020, | ICE_FLOW_SEG_HDR_ICMP = 0x00000020, | ||||
ICE_FLOW_SEG_HDR_TCP = 0x00000040, | ICE_FLOW_SEG_HDR_TCP = 0x00000040, | ||||
ICE_FLOW_SEG_HDR_UDP = 0x00000080, | ICE_FLOW_SEG_HDR_UDP = 0x00000080, | ||||
ICE_FLOW_SEG_HDR_SCTP = 0x00000100, | ICE_FLOW_SEG_HDR_SCTP = 0x00000100, | ||||
ICE_FLOW_SEG_HDR_GRE = 0x00000200, | ICE_FLOW_SEG_HDR_GRE = 0x00000200, | ||||
/* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and | |||||
* ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs | |||||
*/ | |||||
ICE_FLOW_SEG_HDR_IPV_OTHER = 0x20000000, | |||||
}; | }; | ||||
enum ice_flow_field { | enum ice_flow_field { | ||||
/* L2 */ | /* L2 */ | ||||
ICE_FLOW_FIELD_IDX_ETH_DA, | ICE_FLOW_FIELD_IDX_ETH_DA, | ||||
ICE_FLOW_FIELD_IDX_ETH_SA, | ICE_FLOW_FIELD_IDX_ETH_SA, | ||||
ICE_FLOW_FIELD_IDX_S_VLAN, | ICE_FLOW_FIELD_IDX_S_VLAN, | ||||
ICE_FLOW_FIELD_IDX_C_VLAN, | ICE_FLOW_FIELD_IDX_C_VLAN, | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | #define ICE_DEFAULT_RSS_HENA ( \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_FRAG_IPV6) | \ | BIT_ULL(ICE_AVF_FLOW_FIELD_FRAG_IPV6) | \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP_SYN_NO_ACK) | \ | BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP_SYN_NO_ACK) | \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV4_UDP) | \ | BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV4_UDP) | \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV4_UDP) | \ | BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV4_UDP) | \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_TCP_SYN_NO_ACK) | \ | BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_TCP_SYN_NO_ACK) | \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV6_UDP) | \ | BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV6_UDP) | \ | ||||
BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV6_UDP)) | BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV6_UDP)) | ||||
enum ice_rss_hash_func { | |||||
ICE_RSS_HASH_TOEPLITZ = 0, | |||||
ICE_RSS_HASH_TOEPLITZ_SYMMETRIC = 1, | |||||
ICE_RSS_HASH_XOR = 2, | |||||
ICE_RSS_HASH_JHASH = 3, | |||||
}; | |||||
struct ice_rss_hash_cfg { | |||||
u32 addl_hdrs; | |||||
u64 hash_flds; | |||||
enum ice_rss_hash_func hash_func; | |||||
}; | |||||
enum ice_flow_dir { | enum ice_flow_dir { | ||||
ICE_FLOW_DIR_UNDEFINED = 0, | ICE_FLOW_DIR_UNDEFINED = 0, | ||||
ICE_FLOW_TX = 0x01, | ICE_FLOW_TX = 0x01, | ||||
ICE_FLOW_RX = 0x02, | ICE_FLOW_RX = 0x02, | ||||
ICE_FLOW_TX_RX = ICE_FLOW_RX | ICE_FLOW_TX | ICE_FLOW_TX_RX = ICE_FLOW_RX | ICE_FLOW_TX | ||||
}; | }; | ||||
enum ice_flow_priority { | enum ice_flow_priority { | ||||
ICE_FLOW_PRIO_LOW, | ICE_FLOW_PRIO_LOW, | ||||
ICE_FLOW_PRIO_NORMAL, | ICE_FLOW_PRIO_NORMAL, | ||||
ICE_FLOW_PRIO_HIGH | ICE_FLOW_PRIO_HIGH | ||||
}; | }; | ||||
#define ICE_FLOW_SEG_MAX 2 | #define ICE_FLOW_SEG_MAX 2 | ||||
#define ICE_FLOW_SEG_RAW_FLD_MAX 2 | |||||
#define ICE_FLOW_PROFILE_MAX 1024 | #define ICE_FLOW_PROFILE_MAX 1024 | ||||
#define ICE_FLOW_SW_FIELD_VECTOR_MAX 48 | |||||
#define ICE_FLOW_ACL_FIELD_VECTOR_MAX 32 | #define ICE_FLOW_ACL_FIELD_VECTOR_MAX 32 | ||||
#define ICE_FLOW_FV_EXTRACT_SZ 2 | #define ICE_FLOW_FV_EXTRACT_SZ 2 | ||||
#define ICE_FLOW_SET_HDRS(seg, val) ((seg)->hdrs |= (u32)(val)) | #define ICE_FLOW_SET_HDRS(seg, val) ((seg)->hdrs |= (u32)(val)) | ||||
struct ice_flow_seg_xtrct { | struct ice_flow_seg_xtrct { | ||||
u8 prot_id; /* Protocol ID of extracted header field */ | u8 prot_id; /* Protocol ID of extracted header field */ | ||||
u16 off; /* Starting offset of the field in header in bytes */ | u16 off; /* Starting offset of the field in header in bytes */ | ||||
Show All 21 Lines | struct ice_flow_fld_info { | ||||
enum ice_flow_fld_match_type type; | enum ice_flow_fld_match_type type; | ||||
/* Location where to retrieve data from an input buffer */ | /* Location where to retrieve data from an input buffer */ | ||||
struct ice_flow_fld_loc src; | struct ice_flow_fld_loc src; | ||||
/* Location where to put the data into the final entry buffer */ | /* Location where to put the data into the final entry buffer */ | ||||
struct ice_flow_fld_loc entry; | struct ice_flow_fld_loc entry; | ||||
struct ice_flow_seg_xtrct xtrct; | struct ice_flow_seg_xtrct xtrct; | ||||
}; | }; | ||||
struct ice_flow_seg_fld_raw { | |||||
struct ice_flow_fld_info info; | |||||
u16 off; /* Offset from the start of the segment */ | |||||
}; | |||||
struct ice_flow_seg_info { | struct ice_flow_seg_info { | ||||
u32 hdrs; /* Bitmask indicating protocol headers present */ | u32 hdrs; /* Bitmask indicating protocol headers present */ | ||||
u64 match; /* Bitmask indicating header fields to be matched */ | u64 match; /* Bitmask indicating header fields to be matched */ | ||||
u64 range; /* Bitmask indicating header fields matched as ranges */ | u64 range; /* Bitmask indicating header fields matched as ranges */ | ||||
struct ice_flow_fld_info fields[ICE_FLOW_FIELD_IDX_MAX]; | struct ice_flow_fld_info fields[ICE_FLOW_FIELD_IDX_MAX]; | ||||
u8 raws_cnt; /* Number of raw fields to be matched */ | |||||
struct ice_flow_seg_fld_raw raws[ICE_FLOW_SEG_RAW_FLD_MAX]; | |||||
}; | }; | ||||
/* This structure describes a flow entry, and is tracked only in this file */ | |||||
struct ice_flow_entry { | |||||
struct LIST_ENTRY_TYPE l_entry; | |||||
u64 id; | |||||
struct ice_flow_prof *prof; | |||||
/* Action list */ | |||||
struct ice_flow_action *acts; | |||||
/* Flow entry's content */ | |||||
void *entry; | |||||
enum ice_flow_priority priority; | |||||
u16 vsi_handle; | |||||
u16 entry_sz; | |||||
u8 acts_cnt; | |||||
}; | |||||
#define ICE_FLOW_ENTRY_HNDL(e) ((u64)e) | #define ICE_FLOW_ENTRY_HNDL(e) ((u64)e) | ||||
#define ICE_FLOW_ENTRY_PTR(h) ((struct ice_flow_entry *)(h)) | |||||
struct ice_flow_prof { | struct ice_flow_prof { | ||||
struct LIST_ENTRY_TYPE l_entry; | struct LIST_ENTRY_TYPE l_entry; | ||||
u64 id; | u64 id; | ||||
enum ice_flow_dir dir; | enum ice_flow_dir dir; | ||||
u8 segs_cnt; | u8 segs_cnt; | ||||
u8 acts_cnt; | |||||
/* Keep track of flow entries associated with this flow profile */ | |||||
struct ice_lock entries_lock; | |||||
struct LIST_HEAD_TYPE entries; | |||||
struct ice_flow_seg_info segs[ICE_FLOW_SEG_MAX]; | struct ice_flow_seg_info segs[ICE_FLOW_SEG_MAX]; | ||||
/* software VSI handles referenced by this flow profile */ | /* software VSI handles referenced by this flow profile */ | ||||
ice_declare_bitmap(vsis, ICE_MAX_VSI); | ice_declare_bitmap(vsis, ICE_MAX_VSI); | ||||
union { | union { | ||||
/* struct sw_recipe */ | /* struct sw_recipe */ | ||||
/* struct fd */ | |||||
u32 data; | |||||
} cfg; | } cfg; | ||||
/* Default actions */ | |||||
struct ice_flow_action *acts; | |||||
}; | }; | ||||
struct ice_rss_cfg { | struct ice_rss_cfg { | ||||
struct LIST_ENTRY_TYPE l_entry; | struct LIST_ENTRY_TYPE l_entry; | ||||
/* bitmap of VSIs added to the RSS entry */ | /* bitmap of VSIs added to the RSS entry */ | ||||
ice_declare_bitmap(vsis, ICE_MAX_VSI); | ice_declare_bitmap(vsis, ICE_MAX_VSI); | ||||
u64 hashed_flds; | u64 hashed_flds; | ||||
u32 packet_hdr; | u32 packet_hdr; | ||||
Show All 28 Lines | union { | ||||
u32 dummy; | u32 dummy; | ||||
} data; | } data; | ||||
}; | }; | ||||
u64 | u64 | ||||
ice_flow_find_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, | ice_flow_find_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, | ||||
struct ice_flow_seg_info *segs, u8 segs_cnt); | struct ice_flow_seg_info *segs, u8 segs_cnt); | ||||
enum ice_status | enum ice_status | ||||
ice_flow_add_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, | |||||
u64 prof_id, struct ice_flow_seg_info *segs, u8 segs_cnt, | |||||
struct ice_flow_action *acts, u8 acts_cnt, | |||||
struct ice_flow_prof **prof); | |||||
enum ice_status | |||||
ice_flow_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id); | |||||
enum ice_status | |||||
ice_flow_assoc_vsig_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle, | ice_flow_assoc_vsig_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle, | ||||
u16 vsig); | u16 vsig); | ||||
enum ice_status | enum ice_status | ||||
ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id, | ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id, | ||||
u8 *hw_prof); | u8 *hw_prof); | ||||
u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64 entry_id); | |||||
enum ice_status | |||||
ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, | |||||
u64 entry_id, u16 vsi, enum ice_flow_priority prio, | |||||
void *data, struct ice_flow_action *acts, u8 acts_cnt, | |||||
u64 *entry_h); | |||||
enum ice_status ice_flow_rem_entry(struct ice_hw *hw, enum ice_block blk, | |||||
u64 entry_h); | |||||
void | void | ||||
ice_flow_set_fld(struct ice_flow_seg_info *seg, enum ice_flow_field fld, | |||||
u16 val_loc, u16 mask_loc, u16 last_loc, bool range); | |||||
void | |||||
ice_flow_set_fld_prefix(struct ice_flow_seg_info *seg, enum ice_flow_field fld, | ice_flow_set_fld_prefix(struct ice_flow_seg_info *seg, enum ice_flow_field fld, | ||||
u16 val_loc, u16 prefix_loc, u8 prefix_sz); | u16 val_loc, u16 prefix_loc, u8 prefix_sz); | ||||
void | |||||
ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len, | |||||
u16 val_loc, u16 mask_loc); | |||||
void ice_rem_vsi_rss_list(struct ice_hw *hw, u16 vsi_handle); | void ice_rem_vsi_rss_list(struct ice_hw *hw, u16 vsi_handle); | ||||
enum ice_status ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle); | enum ice_status ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle); | ||||
enum ice_status | enum ice_status | ||||
ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds); | ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds); | ||||
enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle); | enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle); | ||||
enum ice_status | enum ice_status | ||||
ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, | ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, | ||||
u32 addl_hdrs); | u32 addl_hdrs); | ||||
enum ice_status | enum ice_status | ||||
ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, | ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, | ||||
u32 addl_hdrs); | u32 addl_hdrs); | ||||
u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs); | u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs); | ||||
#endif /* _ICE_FLOW_H_ */ | #endif /* _ICE_FLOW_H_ */ |