[dpdk-dev] hash: rename unused field to "reserved"

Message ID 1436804751-23156-1-git-send-email-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Bruce Richardson July 13, 2015, 4:25 p.m. UTC
  The cuckoo hash has a fixed number of entries per bucket, so the
configuration parameter for this is unused. We change this field in the
parameters struct to "reserved" to indicate that there is now no such
parameter value, while at the same time keeping ABI consistency.

Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")

Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_hash/rte_hash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson July 13, 2015, 4:28 p.m. UTC | #1
On Mon, Jul 13, 2015 at 05:25:51PM +0100, Bruce Richardson wrote:
> The cuckoo hash has a fixed number of entries per bucket, so the
> configuration parameter for this is unused. We change this field in the
> parameters struct to "reserved" to indicate that there is now no such
> parameter value, while at the same time keeping ABI consistency.
> 
> Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")
> 
> Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Self-NAK. 

Missed some extra code dependencies using this field. V2 to follow.
  

Patch

diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h
index 68109d5..1cddc07 100644
--- a/lib/librte_hash/rte_hash.h
+++ b/lib/librte_hash/rte_hash.h
@@ -75,7 +75,7 @@  typedef uint32_t (*rte_hash_function)(const void *key, uint32_t key_len,
 struct rte_hash_parameters {
 	const char *name;		/**< Name of the hash. */
 	uint32_t entries;		/**< Total hash table entries. */
-	uint32_t bucket_entries;        /**< Bucket entries. */
+	uint32_t reserved;		/**< Unused field. Should be set to 0 */
 	uint32_t key_len;		/**< Length of hash key. */
 	rte_hash_function hash_func;	/**< Primary Hash function used to calculate hash. */
 	uint32_t hash_func_init_val;	/**< Init value used by hash_func. */