aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_hash
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-06-01 09:09:08 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-06-01 09:12:07 +0200
commit1bd9b61222f3a81ffe770fc00b70ded6e760c42b (patch)
tree0bf7d996cf0664796687c1be6d22958fcf6a8096 /lib/librte_hash
parentbb4e158029645f37809fcf81a3acddd6fa11f88a (diff)
New upstream version 18.05
Change-Id: Icd4170ddc4f63aeae5d0559490e5195b5349f9c2 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_hash')
-rw-r--r--lib/librte_hash/rte_cuckoo_hash.c6
-rw-r--r--lib/librte_hash/rte_hash.h2
-rw-r--r--lib/librte_hash/rte_hash_crc.h11
3 files changed, 10 insertions, 9 deletions
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 9b1387b5..a07543a2 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -552,7 +552,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
* Return index where key is stored,
* subtracting the first dummy index
*/
- return prim_bkt->key_idx[i] - 1;
+ ret = prim_bkt->key_idx[i] - 1;
+ goto failure;
}
}
}
@@ -572,7 +573,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key,
* Return index where key is stored,
* subtracting the first dummy index
*/
- return sec_bkt->key_idx[i] - 1;
+ ret = sec_bkt->key_idx[i] - 1;
+ goto failure;
}
}
}
diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h
index 3beaca71..f71ca9fb 100644
--- a/lib/librte_hash/rte_hash.h
+++ b/lib/librte_hash/rte_hash.h
@@ -328,7 +328,7 @@ rte_hash_lookup(const struct rte_hash *h, const void *key);
* @param key
* Key to find.
* @param sig
- * Hash value to remove from the hash table.
+ * Precomputed hash value for 'key'.
* @return
* - -EINVAL if the parameters are invalid.
* - -ENOENT if the key is not found.
diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h
index 479f84b1..cf28031b 100644
--- a/lib/librte_hash/rte_hash_crc.h
+++ b/lib/librte_hash/rte_hash_crc.h
@@ -338,14 +338,13 @@ crc32c_1word(uint32_t data, uint32_t init_val)
static inline uint32_t
crc32c_2words(uint64_t data, uint32_t init_val)
{
+ uint32_t crc, term1, term2;
union {
uint64_t u64;
uint32_t u32[2];
} d;
d.u64 = data;
- uint32_t crc, term1, term2;
-
crc = init_val;
crc ^= d.u32[0];
@@ -399,9 +398,9 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val)
} d;
d.u64 = data;
- init_val = crc32c_sse42_u32(d.u32[0], init_val);
- init_val = crc32c_sse42_u32(d.u32[1], init_val);
- return init_val;
+ init_val = crc32c_sse42_u32(d.u32[0], (uint32_t)init_val);
+ init_val = crc32c_sse42_u32(d.u32[1], (uint32_t)init_val);
+ return (uint32_t)init_val;
}
#endif
@@ -413,7 +412,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)
"crc32q %[data], %[init_val];"
: [init_val] "+r" (init_val)
: [data] "rm" (data));
- return init_val;
+ return (uint32_t)init_val;
}
#endif