aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_hash
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-07-24 16:52:29 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2018-07-24 16:53:31 +0100
commit43192222b329b3c984687235b0081c7fbfe484ba (patch)
tree8e74c04b227d5386d40bbd987ddf132b43ddb313 /lib/librte_hash
parent18af4227fa5eee002b1a79207935620f6112803e (diff)
New upstream version 16.11.7upstream/16.11.7
Change-Id: I1dbe85956ca329c829b0066d16b3f902c237fbd3 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_hash')
-rw-r--r--lib/librte_hash/rte_hash.h2
-rw-r--r--lib/librte_hash/rte_hash_crc.h11
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h
index 622c1800..f29de81a 100644
--- a/lib/librte_hash/rte_hash.h
+++ b/lib/librte_hash/rte_hash.h
@@ -357,7 +357,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 63e74aa4..2aec6c5f 100644
--- a/lib/librte_hash/rte_hash_crc.h
+++ b/lib/librte_hash/rte_hash_crc.h
@@ -366,14 +366,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];
@@ -427,9 +426,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
@@ -441,7 +440,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