From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jianbo Liu Subject: Re: [PATCH] examples/ip_pipeline: avoid the failure of creating hash table Date: Mon, 30 Oct 2017 11:33:18 +0800 Message-ID: <20171030033316.GA26390@arm.com> References: <1509072919-17348-1-git-send-email-jianbo.liu@arm.com> <3EB4FA525960D640B5BDFFD6A3D891267BADB0A0@IRSMSX108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Dumitrescu, Cristian" Return-path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10069.outbound.protection.outlook.com [40.107.1.69]) by dpdk.org (Postfix) with ESMTP id 68D5F152A for ; Mon, 30 Oct 2017 04:34:24 +0100 (CET) Content-Disposition: inline In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891267BADB0A0@IRSMSX108.ger.corp.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" The 10/27/2017 10:01, Dumitrescu, Cristian wrote: > > > > -----Original Message----- > > From: Jianbo Liu [mailto:jianbo.liu@arm.com] > > Sent: Friday, October 27, 2017 3:55 AM > > To: dev@dpdk.org; Dumitrescu, Cristian > > Cc: Jianbo Liu > > Subject: [PATCH] examples/ip_pipeline: avoid the failure of creating ha= sh > > table > > > > Hash table function will check if the input bucket size is power of 2, > > so the parameter should be rounded up before sending to the creating > > function. > > > > Signed-off-by: Jianbo Liu > > --- > > examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c | 2 +- > > examples/ip_pipeline/pipeline/pipeline_routing_be.c | 3 ++= - > > 2 files changed, 3 insertions(+), 2 deletions(-) > > > > Existing code is simply letting the library detect the misconfiguration a= nd gracefully fail. It avoids duplicating library checks in the app. > > Your proposal tries to prevent library from failing by silently tweaking = some user configuration params. Easier to debug in some cases. Yes. but is it must for the parameters to be power of 2? I saw the config exmple in examples/ip_pipeline/config/network_layers.cfg: .... 178 port_local_dest =3D 4 ; SINK2 (Drop) 179 n_arp_entries =3D 1000 180 ip_hdr_offset =3D 270 If not, it's the programmer to correct it before sending to the library. Thanks! Jianbo > > For this case, I am OK with your proposal, although not really required, = so: > > Acked-by: Cristian Dumitrescu > IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.