DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jianbo Liu <jianbo.liu@arm.com>
To: dev@dpdk.org, cristian.dumitrescu@intel.com
Cc: Jianbo Liu <jianbo.liu@arm.com>
Subject: [dpdk-dev] [PATCH] examples/ip_pipeline: avoid the failure of creating hash table
Date: Fri, 27 Oct 2017 10:55:19 +0800	[thread overview]
Message-ID: <1509072919-17348-1-git-send-email-jianbo.liu@arm.com> (raw)

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@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(-)

diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
index 9846777..929d81c 100644
--- a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c
@@ -499,7 +499,7 @@ static void *pipeline_fc_init(struct pipeline_params *params,
 			.key_mask = (p_fc->key_mask_present) ?
 				p_fc->key_mask : NULL,
 			.n_keys = p_fc->n_flows,
-			.n_buckets = p_fc->n_flows / 4,
+			.n_buckets = rte_align32pow2(p_fc->n_flows / 4),
 			.f_hash = hash_func[(p_fc->key_size / 8) - 1],
 			.seed = 0,
 		};
diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.c b/examples/ip_pipeline/pipeline/pipeline_routing_be.c
index 7aaf467..0414f24 100644
--- a/examples/ip_pipeline/pipeline/pipeline_routing_be.c
+++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.c
@@ -1355,7 +1355,8 @@ struct arp_table_entry {
 			.key_offset = p_rt->params.arp_key_offset,
 			.key_mask = NULL,
 			.n_keys = p_rt->params.n_arp_entries,
-			.n_buckets = p_rt->params.n_arp_entries / 4,
+			.n_buckets =
+				rte_align32pow2(p_rt->params.n_arp_entries / 4),
 			.f_hash = hash_default_key8,
 			.seed = 0,
 		};
-- 
1.9.1

             reply	other threads:[~2017-10-27  2:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27  2:55 Jianbo Liu [this message]
2017-10-27 10:01 ` Dumitrescu, Cristian
2017-10-30  3:33   ` Jianbo Liu
2017-11-01 13:39     ` Dumitrescu, Cristian
2017-11-07  7:47   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509072919-17348-1-git-send-email-jianbo.liu@arm.com \
    --to=jianbo.liu@arm.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).