[dpdk-dev] [PATCH v9 4/4] net/ice: enable protocol agnostic flow offloading in FDIR
    Ferruh Yigit 
    ferruh.yigit at intel.com
       
    Tue Nov  2 17:22:35 CET 2021
    
    
  
On 11/2/2021 5:39 AM, Junfeng Guo wrote:
> @@ -1733,6 +1862,101 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
>   			    &input_set_i : &input_set_o;
>   
>   		switch (item_type) {
> +		case RTE_FLOW_ITEM_TYPE_RAW:
> +			raw_spec = item->spec;
> +			raw_mask = item->mask;
> +
> +			if (item_num != 1)
> +				break;
> +
> +			/* convert raw spec & mask from byte string to int */
> +			unsigned char *tmp_spec =
> +				(uint8_t *)(uintptr_t)raw_spec->pattern;
> +			unsigned char *tmp_mask =
> +				(uint8_t *)(uintptr_t)raw_mask->pattern;
> +			uint16_t udp_port = 0;
> +			uint16_t tmp_val = 0;
> +			uint8_t pkt_len = 0;
> +			uint8_t tmp = 0;
> +			int i, j;
Hi Junfeng, Qi, Jingjing, Beilei,
This is causing build error with icc.
Mainly the problem is switch case doesn't provide a scope, in C they
are just like labels. So these variables are valid for all switch statement
and compiler complains that some cases are not initializing these variables.
Can you please either:
1- move these variables above switch
2- Create a scope after 'case' with '{}'
2 can be done as:
case RTE_FLOW_ITEM_TYPE_RAW: {
	<...>
	break;
}
    
    
More information about the dev
mailing list