[dpdk-dev] [PATCH v2 07/17] net/i40e: add flow validate function
Xing, Beilei
beilei.xing at intel.com
Wed Dec 28 08:44:02 CET 2016
> -----Original Message-----
> From: Wu, Jingjing
> Sent: Wednesday, December 28, 2016 10:52 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 07/17] net/i40e: add flow validate function
>
>
> >
> > +union i40e_filter_t {
> > + struct rte_eth_ethertype_filter ethertype_filter;
> > + struct rte_eth_fdir_filter fdir_filter;
> > + struct rte_eth_tunnel_filter_conf tunnel_filter; } cons_filter;
> > +
> > +typedef int (*parse_filter_t)(struct rte_eth_dev *dev,
> > + const struct rte_flow_attr *attr,
> > + const struct rte_flow_item pattern[],
> > + const struct rte_flow_action actions[],
> > + struct rte_flow_error *error,
> > + union i40e_filter_t *filter);
> You can use void* instead of define union i40e_filter_t.
I tried the void * before, but I should determine the filter type when creating a flow. If using void*, I can get the filter info but I don't know which filer type it belongs to.
>
> > +struct i40e_valid_pattern {
> > + enum rte_flow_item_type *items;
> What the item points to? Add few comments
It's the pattern without VOID items. I'll add comments in next version.
> > +
> > + ret = parse_filter(dev, attr, items, actions, error, &cons_filter);
>
> Will you use cons_filter later? If not, it looks like we don't need the argument
> at all.
Yes, it's used to create flow. We us parse_filter to get the filter info. When creating a flow, flow_validate will be involved first to get filter info, then set filter according to the filter info.
> > +
> > + rte_free(items);
> > +
> > + return ret;
> > +}
> > --
> > 2.5.5
More information about the dev
mailing list