From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 77916558D for ; Thu, 12 Jan 2017 16:39:59 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP; 12 Jan 2017 07:39:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,219,1477983600"; d="scan'208";a="52235256" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by orsmga005.jf.intel.com with ESMTP; 12 Jan 2017 07:39:57 -0800 To: Wei Zhao , dev@dpdk.org References: <1484210439-61746-1-git-send-email-wei.zhao1@intel.com> <1484212665-1635-1-git-send-email-wei.zhao1@intel.com> <1484212665-1635-13-git-send-email-wei.zhao1@intel.com> Cc: Wenzhuo Lu From: Ferruh Yigit Message-ID: <02e66699-8e2d-5b1e-485f-82d38dc201d0@intel.com> Date: Thu, 12 Jan 2017 15:39:56 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1484212665-1635-13-git-send-email-wei.zhao1@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v5 12/18] net/ixgbe: parse ethertype filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 15:39:59 -0000 On 1/12/2017 9:17 AM, Wei Zhao wrote: > check if the rule is a ethertype rule, and get the ethertype info. > > Signed-off-by: Wei Zhao > Signed-off-by: Wenzhuo Lu > --- > drivers/net/ixgbe/ixgbe_flow.c | 278 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 278 insertions(+) > > diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c > index ac9f663..2f97129 100644 > --- a/drivers/net/ixgbe/ixgbe_flow.c > +++ b/drivers/net/ixgbe/ixgbe_flow.c > @@ -90,6 +90,18 @@ ixgbe_parse_ntuple_filter(const struct rte_flow_attr *attr, > struct rte_eth_ntuple_filter *filter, > struct rte_flow_error *error); > static int > +cons_parse_ethertype_filter(const struct rte_flow_attr *attr, Although this is static function, you may prefer to keep ixgbe_ namespace in the function. > + const struct rte_flow_item *pattern, > + const struct rte_flow_action *actions, > + struct rte_eth_ethertype_filter *filter, > + struct rte_flow_error *error); > +static int > +ixgbe_parse_ethertype_filter(const struct rte_flow_attr *attr, > + const struct rte_flow_item pattern[], > + const struct rte_flow_action actions[], > + struct rte_eth_ethertype_filter *filter, > + struct rte_flow_error *error); > +static int > ixgbe_flow_validate(__rte_unused struct rte_eth_dev *dev, > const struct rte_flow_attr *attr, > const struct rte_flow_item pattern[], > @@ -480,6 +492,265 @@ ixgbe_parse_ntuple_filter(const struct rte_flow_attr *attr, > } > > /** > + * Parse the rule to see if it is a ethertype rule. > + * And get the ethertype filter info BTW. > + * pattern: > + * The first not void item can be ETH. > + * The next not void item must be END. This documents item.type, can you please also document expected/valid item->spec, item->last and item->mask values. Same for all parse functions. I am aware this is lots of comment when you think all parse functions, but I believe this can be very useful in the future. And it is very unlikely that it will be done later, if it has not been done now. Thanks, ferruh > + * action: > + * The first not void action should be QUEUE. > + * The next not void action should be END. > + */ > +static int > +cons_parse_ethertype_filter(const struct rte_flow_attr *attr, > + const struct rte_flow_item *pattern, > + const struct rte_flow_action *actions, > + struct rte_eth_ethertype_filter *filter, > + struct rte_flow_error *error) <...>