Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_flow.h
/* SPDX-License-Identifier: BSD-3-Clause */ | /* SPDX-License-Identifier: BSD-3-Clause */ | ||||
/* Copyright (c) 2020, Intel Corporation | /* Copyright (c) 2021, Intel Corporation | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions are met: | * modification, are permitted provided that the following conditions are met: | ||||
* | * | ||||
* 1. Redistributions of source code must retain the above copyright notice, | * 1. Redistributions of source code must retain the above copyright notice, | ||||
* this list of conditions and the following disclaimer. | * this list of conditions and the following disclaimer. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 169 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 { | enum ice_rss_cfg_hdr_type { | ||||
ICE_RSS_HASH_TOEPLITZ = 0, | ICE_RSS_OUTER_HEADERS, /* take outer headers as inputset. */ | ||||
ICE_RSS_HASH_TOEPLITZ_SYMMETRIC = 1, | ICE_RSS_INNER_HEADERS, /* take inner headers as inputset. */ | ||||
ICE_RSS_HASH_XOR = 2, | /* take inner headers as inputset for packet with outer ipv4. */ | ||||
ICE_RSS_HASH_JHASH = 3, | ICE_RSS_INNER_HEADERS_W_OUTER_IPV4, | ||||
/* take inner headers as inputset for packet with outer ipv6. */ | |||||
ICE_RSS_INNER_HEADERS_W_OUTER_IPV6, | |||||
/* take outer headers first then inner headers as inputset */ | |||||
ICE_RSS_ANY_HEADERS | |||||
}; | }; | ||||
struct ice_rss_hash_cfg { | struct ice_rss_hash_cfg { | ||||
u32 addl_hdrs; | u32 addl_hdrs; /* protocol header fields */ | ||||
u64 hash_flds; | u64 hash_flds; /* hash bit field (ICE_FLOW_HASH_*) to configure */ | ||||
enum ice_rss_hash_func hash_func; | enum ice_rss_cfg_hdr_type hdr_type; /* to specify inner or outer */ | ||||
bool symm; /* symmetric or asymmetric hash */ | |||||
}; | }; | ||||
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_SINGLE 1 | |||||
#define ICE_FLOW_SEG_MAX 2 | #define ICE_FLOW_SEG_MAX 2 | ||||
#define ICE_FLOW_PROFILE_MAX 1024 | #define ICE_FLOW_PROFILE_MAX 1024 | ||||
#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 { | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | struct ice_flow_prof { | ||||
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 */ | ||||
bool symm; /* Symmetric Hash for RSS */ | |||||
} cfg; | } cfg; | ||||
}; | }; | ||||
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; | struct ice_rss_hash_cfg hash; | ||||
u32 packet_hdr; | |||||
}; | }; | ||||
enum ice_flow_action_type { | enum ice_flow_action_type { | ||||
ICE_FLOW_ACT_NOP, | ICE_FLOW_ACT_NOP, | ||||
ICE_FLOW_ACT_ALLOW, | ICE_FLOW_ACT_ALLOW, | ||||
ICE_FLOW_ACT_DROP, | ICE_FLOW_ACT_DROP, | ||||
ICE_FLOW_ACT_CNTR_PKT, | ICE_FLOW_ACT_CNTR_PKT, | ||||
ICE_FLOW_ACT_FWD_VSI, | ICE_FLOW_ACT_FWD_VSI, | ||||
Show All 34 Lines | |||||
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_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, | ||||
u32 addl_hdrs); | const struct ice_rss_hash_cfg *cfg); | ||||
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, | ||||
u32 addl_hdrs); | const struct ice_rss_hash_cfg *cfg); | ||||
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_ */ |