DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: pablo.de.lara.guarch@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 1/3] enic: use appropriate key length in hash table
Date: Fri,  4 Sep 2015 15:56:38 +0200	[thread overview]
Message-ID: <1441375000-11716-2-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1441375000-11716-1-git-send-email-thomas.monjalon@6wind.com>

From: Pablo de Lara <pablo.de.lara.guarch@intel.com>

RTE_HASH_KEY_LENGTH_MAX was deprecated, and the hash table
actually is hosting bigger keys than that size, so key length
has been increased to properly allocate all keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sujith Sankar <ssujith@cisco.com>
---
 drivers/net/enic/enic_clsf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index 9c2abfb..656b25b 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -214,7 +214,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)
 		enic->fdir.stats.add++;
 	}
 
-	pos = rte_hash_add_key(enic->fdir.hash, (void *)key);
+	pos = rte_hash_add_key(enic->fdir.hash, params);
 	enic->fdir.nodes[pos] = key;
 	return 0;
 }
@@ -244,7 +244,7 @@ int enic_clsf_init(struct enic *enic)
 	struct rte_hash_parameters hash_params = {
 		.name = "enicpmd_clsf_hash",
 		.entries = ENICPMD_CLSF_HASH_ENTRIES,
-		.key_len = RTE_HASH_KEY_LENGTH_MAX,
+		.key_len = sizeof(struct rte_eth_fdir_filter),
 		.hash_func = DEFAULT_HASH_FUNC,
 		.hash_func_init_val = 0,
 		.socket_id = SOCKET_0,
-- 
2.5.1

  reply	other threads:[~2015-09-04 13:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04  9:05 [dpdk-dev] [PATCH 0/3] clean deprecated code in hash library Pablo de Lara
2015-09-04  9:05 ` [dpdk-dev] [PATCH 1/3] hash: use max key length as internal macro instead of deprecated one Pablo de Lara
2015-09-04  9:05 ` [dpdk-dev] [PATCH 2/3] enic: use appropriate key length in hash table Pablo de Lara
2015-09-04 10:15   ` Sujith Sankar (ssujith)
2015-09-04  9:05 ` [dpdk-dev] [PATCH 3/3] hash: remove deprecated functions and macros Pablo de Lara
2015-09-04 13:56 ` [dpdk-dev] [PATCH v2 0/3] clean deprecated code in hash library Thomas Monjalon
2015-09-04 13:56   ` Thomas Monjalon [this message]
2015-09-04 13:56   ` [dpdk-dev] [PATCH v2 2/3] hash: remove deprecated function and macros Thomas Monjalon
2015-09-04 13:56   ` [dpdk-dev] [PATCH v2 3/3] version: 2.2.0-rc0 Thomas Monjalon
2015-09-07 13:28   ` [dpdk-dev] [PATCH v2 0/3] clean deprecated code in hash library Thomas Monjalon

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=1441375000-11716-2-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    /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).