[dpdk-dev] [RFC 08/12] hash: add support for s390x architecture

Dharmik Thakkar Dharmik.Thakkar at arm.com
Mon Apr 15 22:43:54 CEST 2019


Hi,
Please find the inline comment.

> On Apr 9, 2019, at 2:06 PM, Vivian Kong <vivkong at gmail.com> wrote:
> 
> 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)(1) << 56)?
> +			((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