From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xing, Beilei" Subject: Re: [PATCH v2 07/17] net/i40e: add flow validate function Date: Wed, 28 Dec 2016 07:44:02 +0000 Message-ID: <94479800C636CB44BD422CB454846E013158C07D@SHSMSX101.ccr.corp.intel.com> References: <1480679625-4157-1-git-send-email-beilei.xing@intel.com> <1482819984-14120-1-git-send-email-beilei.xing@intel.com> <1482819984-14120-8-git-send-email-beilei.xing@intel.com> <9BB6961774997848B5B42BEC655768F810CC00A6@SHSMSX103.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Wu, Jingjing" , "Zhang, Helin" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 13566376C for ; Wed, 28 Dec 2016 08:44:05 +0100 (CET) In-Reply-To: <9BB6961774997848B5B42BEC655768F810CC00A6@SHSMSX103.ccr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Wu, Jingjing > Sent: Wednesday, December 28, 2016 10:52 AM > To: Xing, Beilei ; Zhang, Helin > > Cc: dev@dpdk.org > Subject: RE: [PATCH v2 07/17] net/i40e: add flow validate function >=20 >=20 > > > > +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 crea= ting a flow. If using void*, I can get the filter info but I don't know wh= ich filer type it belongs to. >=20 > > +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 =3D parse_filter(dev, attr, items, actions, error, &cons_filter); >=20 > Will you use cons_filter later? If not, it looks like we don't need the a= rgument > at all. Yes, it's used to create flow. We us parse_filter to get the filter info. W= hen creating a flow, flow_validate will be involved first to get filter inf= o, then set filter according to the filter info. > > + > > + rte_free(items); > > + > > + return ret; > > +} > > -- > > 2.5.5