From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7C9222BB9 for ; Fri, 23 Dec 2016 13:21:14 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 23 Dec 2016 04:21:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,393,1477983600"; d="scan'208";a="1075594295" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by orsmga001.jf.intel.com with ESMTP; 23 Dec 2016 04:21:11 -0800 To: Nelio Laranjeiro , dev@dpdk.org References: Cc: Adrien Mazarguil From: Ferruh Yigit Message-ID: <1f1d914a-143b-94cd-9ade-f09e84c05df3@intel.com> Date: Fri, 23 Dec 2016 12:21:10 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 3/4] net/mlx5: add rte_flow rule creation 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: Fri, 23 Dec 2016 12:21:14 -0000 On 12/21/2016 3:19 PM, Nelio Laranjeiro wrote: > Convert Ethernet, IPv4, IPv6, TCP, UDP layers into ibv_flow and create > those rules when after validation (i.e. NIC supports the rule). > > VLAN is still not supported in this commit. > > Signed-off-by: Nelio Laranjeiro <...> > +static struct rte_flow * > +priv_flow_create(struct priv *priv, > + const struct rte_flow_attr *attr, > + const struct rte_flow_item items[], > + const struct rte_flow_action actions[], > + struct rte_flow_error *error) > +{ > + struct rte_flow *rte_flow = NULL; Unnecessary assignment. <...> > + action = (struct action) { > + .queue = -1, > + .drop = 0, > + }; > + for (; actions->type != RTE_FLOW_ACTION_TYPE_END; ++actions) { > + if (actions->type == RTE_FLOW_ACTION_TYPE_VOID) { > + continue; > + } else if (actions->type == RTE_FLOW_ACTION_TYPE_QUEUE) { > + action.queue = ((const struct rte_flow_action_queue *) > + actions->conf)->index; > + } else if (actions->type == RTE_FLOW_ACTION_TYPE_DROP) { > + action.drop = 1; > + } else { > + rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_ACTION, > + actions, "unsupported action"); > + goto exit; > + } > + } > + if (action.queue >= 0) { > + queue = action.queue; > + } else if (action.drop) { > + queue = MLX5_FLOW_DROP_QUEUE; > + } else { Not really so important, but as a note, ACTION_TYPE_VOID hits here. It pass from validation, but gives error in creation. > + rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_ACTION, > + actions, > + "no possible action found"); > + goto exit; > + } <...>