From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v3 3/4] net/mlx5: add rte_flow rule creation Date: Mon, 26 Dec 2016 13:20:34 +0100 Message-ID: <20161226122034.GK27385@autoinstall.dev.6wind.com> References: <1f1d914a-143b-94cd-9ade-f09e84c05df3@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Adrien Mazarguil To: Ferruh Yigit Return-path: Received: from mail-wj0-f181.google.com (mail-wj0-f181.google.com [209.85.210.181]) by dpdk.org (Postfix) with ESMTP id 89B153DC for ; Mon, 26 Dec 2016 13:20:43 +0100 (CET) Received: by mail-wj0-f181.google.com with SMTP id sd9so113818457wjb.1 for ; Mon, 26 Dec 2016 04:20:43 -0800 (PST) Content-Disposition: inline In-Reply-To: <1f1d914a-143b-94cd-9ade-f09e84c05df3@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Dec 23, 2016 at 12:21:10PM +0000, Ferruh Yigit wrote: > 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; > > + } > > <...> Hi Ferruh, I will send (very soon) a v4 to handle this situation. Regards, -- Nélio Laranjeiro 6WIND