[dpdk-dev] [PATCH] examples/ip_pipeline: avoid the failure of creating hash table

Jianbo Liu jianbo.liu at arm.com
Mon Oct 30 04:33:18 CET 2017


The 10/27/2017 10:01, Dumitrescu, Cristian wrote:
>
>
> > -----Original Message-----
> > From: Jianbo Liu [mailto:jianbo.liu at arm.com]
> > Sent: Friday, October 27, 2017 3:55 AM
> > To: dev at dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu at intel.com>
> > Cc: Jianbo Liu <jianbo.liu at arm.com>
> > Subject: [PATCH] examples/ip_pipeline: avoid the failure of creating hash
> > 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 <jianbo.liu at arm.com>
> > ---
> >  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 and 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 = 4 ; SINK2 (Drop)
179 n_arp_entries = 1000
180 ip_hdr_offset = 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 <cristian.dumitrescu at intel.com>
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please 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.


More information about the dev mailing list