[dpdk-dev] [RFC 08/12] hash: add support for s390x architecture
Vivian Kong
vivkong at gmail.com
Tue Apr 9 21:06:26 CEST 2019
Add big endian support for s390x architecture.
Signed-off-by: Vivian Kong <vivkong at ca.ibm.com>
---
lib/librte_hash/rte_fbk_hash.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/librte_hash/rte_fbk_hash.h b/lib/librte_hash/rte_fbk_hash.h
index c4d6976d2..5e49950a7 100644
--- a/lib/librte_hash/rte_fbk_hash.h
+++ b/lib/librte_hash/rte_fbk_hash.h
@@ -125,9 +125,16 @@ rte_fbk_hash_add_key_with_bucket(struct rte_fbk_hash_table *ht,
* corrupted due to race conditions, but it's still possible to
* overwrite entries that have just been made valid.
*/
+ #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
const uint64_t new_entry = ((uint64_t)(key) << 32) |
((uint64_t)(value) << 16) |
1; /* 1 = is_entry bit. */
+ #else
+ const uint64_t new_entry =
+ ((uint64_t)(1) << 48) | /* 1 = is_entry bit. */
+ ((uint64_t)(value) << 32) |
+ (uint64_t)(key);
+ #endif
uint32_t i;
for (i = 0; i < ht->entries_per_bucket; i++) {
--
2.17.1
More information about the dev
mailing list