[dpdk-dev] [PATCH 02/49] net/ice/base: update standard extr seq to include DIR flag

Maxime Coquelin maxime.coquelin at redhat.com
Tue Jun 4 19:06:17 CEST 2019



On 6/4/19 7:42 AM, Leyi Rong wrote:
> Once upon a time, the ice_flow_create_xtrct_seq() function in ice_flow.c
> extracted only protocol fields explicitly specified by the caller of the
> ice_flow_add_prof() function via its struct ice_flow_seg_info instances.
> However, to support different ingress and egress flow profiles with the
> same matching criteria, it would be necessary to also match on the packet
> Direction metadata. The primary reason was because there could not be more
> than one HW profile with the same CDID, PTG, and VSIG. The Direction
> metadata was not a parameter used to select HW profile IDs.
> 
> Thus, for ACL, the direction flag would need to be added to the extraction
> sequence. This information will be use later as one criteria for ACL
> scenario entry matching.
> 
> Signed-off-by: Chinh T Cao <chinh.t.cao at intel.com>
> Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr at intel.com>
> Signed-off-by: Leyi Rong <leyi.rong at intel.com>
> ---
>   drivers/net/ice/base/ice_flow.c | 43 +++++++++++++++++++++++++++++++++
>   1 file changed, 43 insertions(+)
> 
> diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
> index be819e0e9..f1bf5b5e7 100644
> --- a/drivers/net/ice/base/ice_flow.c
> +++ b/drivers/net/ice/base/ice_flow.c
> @@ -495,6 +495,42 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)
>   	return ICE_SUCCESS;
>   }
>   
> +/**
> + * ice_flow_xtract_pkt_flags - Create an extr sequence entry for packet flags
> + * @hw: pointer to the HW struct
> + * @params: information about the flow to be processed
> + * @flags: The value of pkt_flags[x:x] in RX/TX MDID metadata.
> + *
> + * This function will allocate an extraction sequence entries for a DWORD size
> + * chunk of the packet flags.
> + */
> +static enum ice_status
> +ice_flow_xtract_pkt_flags(struct ice_hw *hw,
> +			  struct ice_flow_prof_params *params,
> +			  enum ice_flex_mdid_pkt_flags flags)
> +{
> +	u8 fv_words = hw->blk[params->blk].es.fvw;
> +	u8 idx;
> +
> +	/* Make sure the number of extraction sequence entries required does not
> +	 * exceed the block's capacity.
> +	 */
> +	if (params->es_cnt >= fv_words)
> +		return ICE_ERR_MAX_LIMIT;
> +
> +	/* some blocks require a reversed field vector layout */
> +	if (hw->blk[params->blk].es.reverse)
> +		idx = fv_words - params->es_cnt - 1;
> +	else
> +		idx = params->es_cnt;
> +
> +	params->es[idx].prot_id = ICE_PROT_META_ID;
> +	params->es[idx].off = flags;
> +	params->es_cnt++;
> +
> +	return ICE_SUCCESS;
> +}
> +
>   /**
>    * ice_flow_xtract_fld - Create an extraction sequence entry for the given field
>    * @hw: pointer to the HW struct
> @@ -744,6 +780,13 @@ ice_flow_create_xtrct_seq(struct ice_hw *hw,
>   	enum ice_status status = ICE_SUCCESS;
>   	u8 i;
>   
> +	/* For ACL, we also need to extract the direction bit (Rx,Tx) data from
> +	 * packet flags
> +	 */
> +	if (params->blk == ICE_BLK_ACL)
> +		ice_flow_xtract_pkt_flags(hw, params,
> +					  ICE_RX_MDID_PKT_FLAGS_15_0);

Shouldn't you propagate the error (ICE_ERR_MAX_LIMIT)?

> +
>   	for (i = 0; i < params->prof->segs_cnt; i++) {
>   		u64 match = params->prof->segs[i].match;
>   		u16 j;
> 


More information about the dev mailing list