Hi,

> -----Original Message-----
> From: Zhao1, Wei
> Sent: Monday, June 5, 2017 2:01 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Subject: RE: [PATCH v2 10/11] net/e1000: destroy consistent filter
> 
> Hi, wenzhuo
> 
> > -----Original Message-----
> > From: Lu, Wenzhuo
> > Sent: Monday, June 5, 2017 1:42 PM
> > To: Zhao1, Wei <wei.zh...@intel.com>; dev@dpdk.org
> > Subject: RE: [PATCH v2 10/11] net/e1000: destroy consistent filter
> >
> > Hi Wei,
> >
> > > -----Original Message-----
> > > From: Zhao1, Wei
> > > Sent: Friday, June 2, 2017 2:37 PM
> > > To: dev@dpdk.org
> > > Cc: Lu, Wenzhuo; Zhao1, Wei
> > > Subject: [PATCH v2 10/11] net/e1000: destroy consistent filter
> > >
> > > This patch adds a function to destroy the flow fliter.
> > >
> > > Signed-off-by: Wei Zhao <wei.zh...@intel.com>
> > > ---
> > >  drivers/net/e1000/igb_flow.c | 100
> > > ++++++++++++++++++++++++++++++++++++++++++-
> > >  1 file changed, 99 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/e1000/igb_flow.c
> > > b/drivers/net/e1000/igb_flow.c index fac76bf..bced291 100644
> > > --- a/drivers/net/e1000/igb_flow.c
> > > +++ b/drivers/net/e1000/igb_flow.c
> > > @@ -1464,10 +1464,108 @@ igb_flow_validate(__rte_unused struct
> > > rte_eth_dev *dev,
> > >   return ret;
> > >  }
> > >
> > > +/* Destroy a flow rule on igb. */
> > > +static int
> > > +igb_flow_destroy(struct rte_eth_dev *dev,
> > > +         struct rte_flow *flow,
> > > +         struct rte_flow_error *error)
> > > +{
> > > + int ret;
> > > + struct rte_flow *pmd_flow = flow;
> > > + enum rte_filter_type filter_type = pmd_flow->filter_type;
> > > + struct rte_eth_ntuple_filter ntuple_filter;
> > > + struct rte_eth_ethertype_filter ethertype_filter;
> > > + struct rte_eth_syn_filter syn_filter;
> > > + struct rte_eth_flex_filter flex_filter;
> > > + struct igb_ntuple_filter_ele *ntuple_filter_ptr;
> > > + struct igb_ethertype_filter_ele *ethertype_filter_ptr;
> > > + struct igb_eth_syn_filter_ele *syn_filter_ptr;
> > > + struct igb_flex_filter_ele *flex_filter_ptr;
> > > + struct igb_flow_mem *igb_flow_mem_ptr;
> > > +
> > > + switch (filter_type) {
> > > + case RTE_ETH_FILTER_NTUPLE:
> > > +         ntuple_filter_ptr = (struct igb_ntuple_filter_ele *)
> > > +                                 pmd_flow->rule;
> > > +         (void)rte_memcpy(&ntuple_filter,
> > > +                 &ntuple_filter_ptr->filter_info,
> > > +                 sizeof(struct rte_eth_ntuple_filter));
> > > +         ret = igb_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
> > Is a copy necessary? Could "ntuple_filter_ptr->filter_info" be used
> > directly for deleting?
> > The same below.
> 
> Maybe this is ok?
> 
>       ntuple_filter_ptr = (struct igb_ntuple_filter_ele *)
>                               pmd_flow->rule;
>       ret = igb_add_del_ntuple_filter(dev, &ntuple_filter_ptr->filter_info,
> FALSE);
Yes, I prefer this one. I've had a quick look at igb_add_del_ntuple_filter, at 
least for deleting, ntuple_filter is only an input argument.

> 
> 
> >
> > > +         if (!ret) {
> > > +                 TAILQ_REMOVE(&igb_filter_ntuple_list,
> > > +                 ntuple_filter_ptr, entries);
> > > +                 rte_free(ntuple_filter_ptr);
> > > +         }
> > > +         break;

Reply via email to