From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 179902C01 for ; Wed, 4 Jan 2017 19:42:30 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id a197so414911542wmd.0 for ; Wed, 04 Jan 2017 10:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=k1w30J5NENvWMFhfCNmP8yl/OjtvK3G/5xesdxgncAg=; b=rmKjneMWzFKEb5WpP6Wdsno3kLYHoZN0PfwI3DBHhKQ/jnpNAscqKX7hZZqvwZAp4j us6VHQed8u0Ok8rSvV/xPcuRbqs24/44T/SBsxlLZ0VJjEAi4+urhPy3Vv4GPLpiEB+a +hNVgxdOY49/IR2TWlSJSLbhFQVl0GMjYox3T06RM1kwloGwvivm8kKAdZp7sSYoTz7W /N08XuWMEmWA8etNz9vuRSbQW9OC20WH2tO94GleZDOJ7NaN3JfzdAR+C9RGnQl0k7bD eh+tOvuJlbRBqxQHHxOt9NVXcar89Bm5sScz334dKuzLdRlklMr1ITRUfeMEN1x0PKyA KSOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=k1w30J5NENvWMFhfCNmP8yl/OjtvK3G/5xesdxgncAg=; b=AdgVbDVDdmeF8XVq6vY3rcKMGNKw6Luh+GsuYY1YWKgrReBbNFVWlQDRX53DyIk4bp g9P+s6zXyWgKcaDrw8RI35OGYmJeowkbfOymcLbZG54OfnVEYrc+MWVTZzdUiYVXtxR1 L+Ki0ct8HdDTSuvjtXRjST+5V4g/80l3hRGo6ltXvtw6XVh0XeP2ioU7sK6E8s3RT7Qy Ry2gVqF00BoTM6e2DCpDBAIqnkILhSEiQt2lkzGPMShZRZu4sTrErXipAX+kHnEjjNIA C0hol37zrqBonNAMqIc8bnz/1v2j9EGWZ00g/abOsDjL6ikeZQwoz1yvfo+XSViuWrRh 0H8A== X-Gm-Message-State: AIkVDXL1L/Kjawl5JVIaOdD9PI8rPAjOS1v4PO7hdjMgT2WqABj5nSq4LFFe45oAHepEFt8y X-Received: by 10.28.11.208 with SMTP id 199mr61555897wml.97.1483555349833; Wed, 04 Jan 2017 10:42:29 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id d8sm96190788wmi.21.2017.01.04.10.42.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2017 10:42:28 -0800 (PST) Date: Wed, 4 Jan 2017 19:42:22 +0100 From: Adrien Mazarguil To: Ferruh Yigit Cc: Nelio Laranjeiro , dev@dpdk.org Message-ID: <20170104184222.GI12822@6wind.com> References: <025e66266f9baba7515ad4ba54a4a6addc9e2345.1483022600.git.nelio.laranjeiro@6wind.com> <2973bbd2-8db3-f9e4-da9a-359e399527b3@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2973bbd2-8db3-f9e4-da9a-359e399527b3@intel.com> Subject: Re: [dpdk-dev] [PATCH v5 2/6] net/mlx5: support basic flow items and actions 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: Wed, 04 Jan 2017 18:42:30 -0000 Hi Ferruh, On Wed, Jan 04, 2017 at 05:49:46PM +0000, Ferruh Yigit wrote: > Hi Nelio, > > A quick question. I'll reply since it's related to the API. > On 12/29/2016 3:15 PM, Nelio Laranjeiro wrote: > > Introduce initial software for rte_flow rules. > > > > VLAN, VXLAN are still not supported. > > > > Signed-off-by: Nelio Laranjeiro > > Acked-by: Adrien Mazarguil > > <...> > > > +static int > > +priv_flow_validate(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 mlx5_flow *flow) > > +{ > > + const struct mlx5_flow_items *cur_item = mlx5_flow_items; > > <...> > > > + for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) { > <...> > > + } > > + for (; actions->type != RTE_FLOW_ACTION_TYPE_END; ++actions) { > <...> > > + } > > Is it guarantied in somewhere that items or actions terminated with > TYPE_END? Yes, since it's now the only way to terminate items/actions lists [1][2]. There used to be a "max" value in the original draft but it seemed redundant and proved annoying to use, and was therefore dropped. END items/actions behave like a NUL terminator for C strings. They are likewise defined with value 0 for convenience. > And these fields are direct inputs from user. > Is there a way to verify user provided values are with TYPE_END terminated? No, applications must check for its presence (they normally add it themselves) before feeding these lists to PMDs. I think that's safe enough. Note the testpmd flow command does not allow entering a flow rule without "end" tokens in both lists, there is no way around this restriction. [1] http://dpdk.org/doc/guides/prog_guide/rte_flow.html#matching-pattern [2] http://dpdk.org/doc/guides/prog_guide/rte_flow.html#actions -- Adrien Mazarguil 6WIND