[dpdk-dev] [PATCH v2 12/17] net/i40e: destroy ethertype filter

Wu, Jingjing jingjing.wu at intel.com
Wed Dec 28 04:30:11 CET 2016


> 
>  const struct rte_flow_ops i40e_flow_ops = {
>  	.validate = i40e_flow_validate,
> @@ -1492,11 +1495,16 @@ i40e_flow_destroy(__rte_unused struct
> rte_eth_dev *dev,
>  		  struct rte_flow *flow,
>  		  struct rte_flow_error *error)
>  {
> +	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
>  	struct i40e_flow *pmd_flow = (struct i40e_flow *)flow;
>  	enum rte_filter_type filter_type = pmd_flow->filter_type;
>  	int ret;
> 
>  	switch (filter_type) {
> +	case RTE_ETH_FILTER_ETHERTYPE:
> +		ret = i40e_dev_destroy_ethertype_filter(pf,
> +				(struct i40e_ethertype_filter *)pmd_flow->rule);
> +		break;
>  	default:
>  		PMD_DRV_LOG(WARNING, "Filter type (%d) not supported",
>  			    filter_type);
> @@ -1504,10 +1512,49 @@ i40e_flow_destroy(__rte_unused struct
> rte_eth_dev *dev,
>  		break;
>  	}
> 
> -	if (ret)
> +	if (!ret) {
> +		TAILQ_REMOVE(&pf->flow_list, pmd_flow, node);
> +		free(pmd_flow);
Should it be freed inside the function? Is the API definition like that?


More information about the dev mailing list