u16 entry_length; /* # of bytes formatted entry will require */
u8 es_cnt;
+ /* For ACL, the es[0] will have the data of ICE_RX_MDID_PKT_FLAGS_15_0
+ * This will give us the direction flags.
+ */
struct ice_fv_word es[ICE_MAX_FV_WORDS];
ice_declare_bitmap(ptypes, ICE_FLOW_PTYPE_MAX);
/**
* ice_flow_xtract_fld - Create an extraction sequence entry for the given field
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @params: information about the flow to be processed
* @seg: packet segment index of the field to be extracted
* @fld: ID of field to be extracted
/**
* ice_flow_xtract_raws - Create extract sequence entries for raw bytes
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @params: information about the flow to be processed
* @seg: index of packet segment whose raw fields are to be be extracted
*/
/**
* ice_flow_create_xtrct_seq - Create an extraction sequence for given segments
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @params: information about the flow to be processed
*
* This function iterates through all matched fields in the given segments, and
/**
* ice_flow_proc_segs - process all packet segments associated with a profile
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @params: information about the flow to be processed
*/
static enum ice_status
/**
* ice_flow_find_prof_conds - Find a profile matching headers and conditions
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @dir: flow direction
* @segs: array of one or more packet segments that describe the flow
/**
* ice_flow_find_prof - Look up a profile matching headers and matched fields
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @dir: flow direction
* @segs: array of one or more packet segments that describe the flow
/**
* ice_flow_find_prof_id - Look up a profile with given profile ID
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @prof_id: unique ID to identify this flow profile
*/
/**
* ice_flow_rem_entry_sync - Remove a flow entry
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @entry: flow entry to be removed
*/
static enum ice_status
/**
* ice_flow_add_prof_sync - Add a flow profile for packet segments and fields
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @dir: flow direction
* @prof_id: unique ID to identify this flow profile
* @vsi_handle: software VSI handle
*
* Assumption: the caller has acquired the lock to the profile list
- * and the software vsi handle has been validated
+ * and the software VSI handle has been validated
*/
static enum ice_status
ice_flow_assoc_prof(struct ice_hw *hw, enum ice_block blk,
* @vsi_handle: software VSI handle
*
* Assumption: the caller has acquired the lock to the profile list
- * and the software vsi handle has been validated
+ * and the software VSI handle has been validated
*/
static enum ice_status
ice_flow_disassoc_prof(struct ice_hw *hw, enum ice_block blk,
/**
* ice_flow_add_prof - Add a flow profile for packet segments and matched fields
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @dir: flow direction
* @prof_id: unique ID to identify this flow profile
/**
* ice_flow_rem_prof - Remove a flow profile and all entries associated with it
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: the block for which the flow profile is to be removed
* @prof_id: unique ID of the flow profile to be removed
*/
}
/**
- * ice_flow_get_hw_prof - return the hw profile for a specific profile id handle
- * @hw: pointer to the hw struct
+ * ice_flow_get_hw_prof - return the HW profile for a specific profile ID handle
+ * @hw: pointer to the HW struct
* @blk: classification stage
- * @prof_id: the profile id handle
- * @hw_prof_id: pointer to variable to receive the hw profile id
+ * @prof_id: the profile ID handle
+ * @hw_prof_id: pointer to variable to receive the HW profile ID
*/
enum ice_status
ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
/**
* ice_flow_find_entry - look for a flow entry using its unique ID
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @entry_id: unique ID to identify this flow entry
*
/**
* ice_flow_add_entry - Add a flow entry
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @blk: classification stage
* @prof_id: ID of the profile to add a new flow entry to
* @entry_id: unique ID to identify this flow entry
/**
* ice_flow_rem_entry - Remove a flow entry
- * @hw: pointer to the hw struct
+ * @hw: pointer to the HW struct
* @entry_h: handle to the flow entry to be removed
*/
enum ice_status ice_flow_rem_entry(struct ice_hw *hw, u64 entry_h)
return ICE_SUCCESS;
}
-/* Mapping of AVF hash bit fields to an L3-L4 hash combination.
- * As the ice_flow_avf_hdr_field represent individual bit shifts in a hash,
- * convert its values to their appropriate flow L3, L4 values.
- */
-#define ICE_FLOW_AVF_RSS_IPV4_MASKS \
- (BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_OTHER) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_FRAG_IPV4))
-#define ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS \
- (BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP_SYN_NO_ACK) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP))
-#define ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS \
- (BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV4_UDP) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV4_UDP) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_UDP))
-#define ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS \
- (ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS | ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS | \
- ICE_FLOW_AVF_RSS_IPV4_MASKS | BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP))
-
-#define ICE_FLOW_AVF_RSS_IPV6_MASKS \
- (BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_OTHER) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_FRAG_IPV6))
-#define ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS \
- (BIT_ULL(ICE_AVF_FLOW_FIELD_UNICAST_IPV6_UDP) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_MULTICAST_IPV6_UDP) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_UDP))
-#define ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS \
- (BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_TCP_SYN_NO_ACK) | \
- BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_TCP))
-#define ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS \
- (ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS | ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS | \
- ICE_FLOW_AVF_RSS_IPV6_MASKS | BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_SCTP))
-
-#define ICE_FLOW_MAX_CFG 10
-
-/**
- * ice_add_avf_rss_cfg - add an RSS configuration for AVF driver
- * @hw: pointer to the hardware structure
- * @vsi_handle: software VSI handle
- * @avf_hash: hash bit fields (ICE_AVF_FLOW_FIELD_*) to configure
- *
- * This function will take the hash bitmap provided by the AVF driver via a
- * message, convert it to ICE-compatible values, and configure RSS flow
- * profiles.
- */
-enum ice_status
-ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 avf_hash)
-{
- u64 added_cfg[ICE_FLOW_MAX_CFG], hash_flds;
- enum ice_status status = ICE_SUCCESS;
- u8 i, idx = 0;
-
- if (avf_hash == ICE_AVF_FLOW_FIELD_INVALID ||
- !ice_is_vsi_valid(hw, vsi_handle))
- return ICE_ERR_PARAM;
-
- /* Make sure no unsupported bits are specified */
- if (avf_hash & ~(ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS |
- ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS))
- return ICE_ERR_CFG;
-
- hash_flds = avf_hash;
-
- /* Always create an L3 RSS configuration for any L4 RSS configuration */
- if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS)
- hash_flds |= ICE_FLOW_AVF_RSS_IPV4_MASKS;
-
- if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS)
- hash_flds |= ICE_FLOW_AVF_RSS_IPV6_MASKS;
-
- /* Create the corresponding RSS configuration for each valid hash bit */
- while (hash_flds) {
- u64 rss_hash = ICE_HASH_INVALID;
-
- if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV4_MASKS) {
- if (hash_flds & ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS) {
- rss_hash = ICE_FLOW_HASH_IPV4 |
- ICE_FLOW_HASH_TCP_PORT;
- hash_flds &= ~ICE_FLOW_AVF_RSS_TCP_IPV4_MASKS;
- } else if (hash_flds &
- ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS) {
- rss_hash = ICE_FLOW_HASH_IPV4 |
- ICE_FLOW_HASH_UDP_PORT;
- hash_flds &= ~ICE_FLOW_AVF_RSS_UDP_IPV4_MASKS;
- } else if (hash_flds &
- BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP)) {
- rss_hash = ICE_FLOW_HASH_IPV4 |
- ICE_FLOW_HASH_SCTP_PORT;
- hash_flds &=
- ~BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP);
- } else if (hash_flds & ICE_FLOW_AVF_RSS_IPV4_MASKS) {
- rss_hash = ICE_FLOW_HASH_IPV4;
- hash_flds &= ~ICE_FLOW_AVF_RSS_IPV4_MASKS;
- }
- } else if (hash_flds & ICE_FLOW_AVF_RSS_ALL_IPV6_MASKS) {
- if (hash_flds & ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS) {
- rss_hash = ICE_FLOW_HASH_IPV6 |
- ICE_FLOW_HASH_TCP_PORT;
- hash_flds &= ~ICE_FLOW_AVF_RSS_TCP_IPV6_MASKS;
- } else if (hash_flds &
- ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS) {
- rss_hash = ICE_FLOW_HASH_IPV6 |
- ICE_FLOW_HASH_UDP_PORT;
- hash_flds &= ~ICE_FLOW_AVF_RSS_UDP_IPV6_MASKS;
- } else if (hash_flds &
- BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_SCTP)) {
- rss_hash = ICE_FLOW_HASH_IPV6 |
- ICE_FLOW_HASH_SCTP_PORT;
- hash_flds &=
- ~BIT_ULL(ICE_AVF_FLOW_FIELD_IPV6_SCTP);
- } else if (hash_flds & ICE_FLOW_AVF_RSS_IPV6_MASKS) {
- rss_hash = ICE_FLOW_HASH_IPV6;
- hash_flds &= ~ICE_FLOW_AVF_RSS_IPV6_MASKS;
- }
- }
-
- if (rss_hash == ICE_HASH_INVALID)
- return ICE_ERR_OUT_OF_RANGE;
-
- status = ice_add_rss_cfg(hw, vsi_handle, rss_hash,
- ICE_FLOW_SEG_HDR_NONE);
- if (status)
- break;
- added_cfg[idx++] = rss_hash;
- }
-
- /* If status is not success, we must remove all hash configurations
- * that were successfully added previously in this call for the vsi
- */
- if (status)
- for (i = 0; i < idx; i++)
- ice_rem_rss_cfg(hw, vsi_handle, added_cfg[i],
- ICE_FLOW_SEG_HDR_NONE);
-
- return status;
-}
-
/**
* ice_rem_all_rss_vsi_ctx - remove all RSS configurations from VSI context
* @hw: pointer to the hardware structure
}
/**
- * ice_rem_vsi_rss_cfg - remove RSS configurations associated with vsi
+ * ice_rem_vsi_rss_cfg - remove RSS configurations associated with VSI
* @hw: pointer to the hardware structure
* @vsi_handle: software VSI handle
*
* This function will iterate through all flow profiles and disassociate
- * the vsi from that profile. If the flow profile has no vsis it will
+ * the VSI from that profile. If the flow profile has no VSIs it will
* be removed.
*/
enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle)
goto exit;
/* Search for a flow profile that has matching headers, hash fields
- * and has the input vsi associated to it. If found, no further
+ * and has the input VSI associated to it. If found, no further
* operations required and exit.
*/
prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,
goto exit;
/* Check if a flow profile exists with the same protocol headers and
- * associated with the input vsi. If so disasscociate the vsi from
- * this profile. The vsi will be added to a new profile created with
+ * associated with the input VSI. If so disasscociate the VSI from
+ * this profile. The VSI will be added to a new profile created with
* the protocol header and new hash field configuration.
*/
prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,
else
goto exit;
- /* Remove profile if it has no vsis associated */
+ /* Remove profile if it has no VSIs associated */
if (!ice_is_any_bit_set(prof->vsis, ICE_MAX_VSI)) {
status = ice_flow_rem_prof_sync(hw, blk, prof);
if (status)
}
/* Search for a profile that has same match fields only. If this
- * exists then associate the vsi to this profile.
+ * exists then associate the VSI to this profile.
*/
prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,
vsi_handle,
*
* This function will lookup the flow profile based on the input
* hash field bitmap, iterate through the profile entry list of
- * that profile and find entry associated with input vsi to be
+ * that profile and find entry associated with input VSI to be
* removed. Calls are made to underlying flow apis which will in
* turn build or update buffers for RSS XLT1 section.
*/
}
/**
- * ice_replay_rss_cfg - remove RSS configurations associated with vsi
+ * ice_replay_rss_cfg - remove RSS configurations associated with VSI
* @hw: pointer to the hardware structure
* @vsi_handle: software VSI handle
*/
* @hdrs: protocol header type
*
* This function will return the match fields of the first instance of flow
- * profile having the given header types and containing input vsi
+ * profile having the given header types and containing input VSI
*/
u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs)
{
struct ice_rss_cfg *r, *rss_cfg = NULL;
- /* verify if the protocol header is non zero and vsi is valid */
+ /* verify if the protocol header is non zero and VSI is valid */
if (hdrs == ICE_FLOW_SEG_HDR_NONE || !ice_is_vsi_valid(hw, vsi_handle))
return ICE_HASH_INVALID;