> From: Stephen Hemminger [mailto:[email protected]]
> Sent: Thursday, 21 August 2025 22.35
> 
> Make comparison of power of 2 sizes compatible across platforms.
> Keep the special case code for 16 bytes for x86 and arm64 but
> also add simple xor for others.
> 
> Need to make rte_hash_k32_cmp_eq() exposed because ip_frag
> code poaches it.

One more argument why these architecture optimized compare functions should be 
exposed as generic EAL functions, like rte_mov16() etc. for rte_memcpy(), 
instead of hiding them away in the hash library.

It could be rte_memeq16(const void *, const void *) etc. in /lib/eal/include, 
with architecture optimized variants, and a generic variant.

And a wrapper calling them in the hash library, such as:

static inline int
rte_hash_k16_cmp_eq(const void *key1, const void *key2, size_t key_len 
__rte_unused)
{
        return !rte_memeq16(key1, key2);
}

> 
> Signed-off-by: Stephen Hemminger <[email protected]>
> ---

With our without suggested feature creep...

Acked-by: Morten Brørup <[email protected]>

Reply via email to