From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id BF1562C8 for ; Fri, 23 Dec 2016 14:24:28 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id a197so199398049wmd.0 for ; Fri, 23 Dec 2016 05:24:28 -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=9RTmoilnYBH+VS1YYa34Dh6P7VxRZdAlD+heC5aV+lc=; b=XjIoRkAqqTjNy9goN9kuNe4gqlp76Y7kfiGdq/lyo58URNNArmU8GmH6lHEfHFMzu8 D2Sin5vV/CY9WKCF75iRME8kZKOOxXXICXALZDpFdNHW792OcI2/CHa6Z77lup1joCa0 C52E4AO3RPMuCb8UfroCS0AdIyP2UznWwFJhAbMkRHxBbhl5PFOa7HTgMC2FxR7bjSHL SAp6ZnVZL52+yhzzBOX5UG9Ravk5aYYDPVQKDTqN8ed0sFziHF+hufoYTrMuoLDWIF54 uebTu+jN8EDnnshgiQP2mbb/fNh+mmFw6lS8LZ/np5e9p/5iWfimP/vnqF+vh45WFEVM PhuA== 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=9RTmoilnYBH+VS1YYa34Dh6P7VxRZdAlD+heC5aV+lc=; b=E6c6WV6gGVBzWbrgOffRDHSu6YhIfrbR7QkTWitD6mkZF0G3tfMgAyAeGS/0ZtgCzc X0xf/U2otDgG9r2HtI6qqzjnqOCCQcvK1szmSzLhrVTTUMnRGoleqIO5+kqpz0tmuEmB EFdTHYcSSD8/E6EPG3iA4YqBlwgLWivf0TCppr7AtL2HT6P1nzDE4ZrGK7YBdnds9MAu dqoBgmmaXZfjKFN+E4VL8RI/IsutZfLtIAuCUlmcxspTB++NLqLFNeliADLbgDPUKcd/ KNOqueskU9B6TF+cX9ZXNYl0CMdLRwFN8vdjGoKgr4w04Qt3svd39a2rK+Su8K/1XqV/ jOQw== X-Gm-Message-State: AIkVDXLwFhv10J0KYR1chsVlBUIKEbBDRnmyXjLnYbWMfUQuXrTabmvvDgdIBeoBqWt/ig+Z X-Received: by 10.28.230.194 with SMTP id e63mr6576954wmi.25.1482499468378; Fri, 23 Dec 2016 05:24:28 -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 w18sm37168278wme.9.2016.12.23.05.24.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Dec 2016 05:24:27 -0800 (PST) Date: Fri, 23 Dec 2016 14:24:19 +0100 From: Adrien Mazarguil To: Ferruh Yigit Cc: Nelio Laranjeiro , dev@dpdk.org Message-ID: <20161223132419.GM10340@6wind.com> References: <21927e17-26fc-6c45-8953-3215fe47ce85@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21927e17-26fc-6c45-8953-3215fe47ce85@intel.com> Subject: Re: [dpdk-dev] [PATCH v3 2/4] net/mlx5: add software support for rte_flow 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 13:24:28 -0000 On Fri, Dec 23, 2016 at 12:19:30PM +0000, Ferruh Yigit wrote: > On 12/21/2016 3:19 PM, Nelio Laranjeiro wrote: > > Introduce initial software validation for rte_flow rules. > > > > Signed-off-by: Nelio Laranjeiro > > --- > > drivers/net/mlx5/mlx5.h | 2 + > > drivers/net/mlx5/mlx5_flow.c | 202 ++++++++++++++++++++++++++++++++++------ > > drivers/net/mlx5/mlx5_trigger.c | 2 + > > 3 files changed, 177 insertions(+), 29 deletions(-) > > <...> > > > + for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) { > > + if (items->type == RTE_FLOW_ITEM_TYPE_VOID) { > > + continue; > > + } else if (items->type == RTE_FLOW_ITEM_TYPE_ETH) { > > + if (ilast) > > + goto exit_item_not_supported; > > + ilast = items; > > + } else if ((items->type == RTE_FLOW_ITEM_TYPE_IPV4) || > > + (items->type == RTE_FLOW_ITEM_TYPE_IPV6)) { > > + if (!ilast) > > + goto exit_item_not_supported; > > + else if (ilast->type != RTE_FLOW_ITEM_TYPE_ETH) > > + goto exit_item_not_supported; > > + ilast = items; > > + } else if ((items->type == RTE_FLOW_ITEM_TYPE_UDP) || > > + (items->type == RTE_FLOW_ITEM_TYPE_TCP)) { > > + if (!ilast) > > + goto exit_item_not_supported; > > + else if ((ilast->type != RTE_FLOW_ITEM_TYPE_IPV4) && > > + (ilast->type != RTE_FLOW_ITEM_TYPE_IPV6)) > > + goto exit_item_not_supported; > > + ilast = items; > > + } else { > > + goto exit_item_not_supported; > > + } > > + } > > I was thinking rte_flow_validate() is validating rule against hardware / > PMD, but here the API input validation is also done. > In patch 3/4 API input validation continues with validating each item > one by one. > > Shouldn't each PMD needs to do this kind of input validation? > Why not move generic input validation to rte_flow API? > And if it is valid, call PMD specific one. I think we'll add one eventually, but such a generic function would be called by PMDs not by applications. PMDs must have the ability to optimize validate() and create() however they want. In the meantime in my opinion it's better to let PMDs implement their own to determine what can be shared later without cluttering rte_flow from the start. -- Adrien Mazarguil 6WIND