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

Xing, Beilei beilei.xing at intel.com
Wed Dec 28 08:29:09 CET 2016



> -----Original Message-----
> From: Wu, Jingjing
> Sent: Wednesday, December 28, 2016 11:30 AM
> To: Xing, Beilei <beilei.xing at intel.com>; Zhang, Helin
> <helin.zhang at intel.com>
> Cc: dev at dpdk.org
> Subject: RE: [PATCH v2 12/17] net/i40e: destroy ethertype filter
> 
> >
> >  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?

Yes, since API or rte won't free the flow allocated by PMD. Please refer to the attached mail.


More information about the dev mailing list