> -----Original Message-----
> From: Ilya Maximets [mailto:[email protected]]
> Sent: Friday, July 12, 2019 3:43 PM
> To: Stokes, Ian <[email protected]>; Van Haaren, Harry
> <[email protected]>; [email protected]
> Cc: [email protected]
> Subject: Re: [PATCH v10 4/5] dpif-netdev: refactor generic implementation
<snip>
> >> +
> >> + /* Hash the now linearized blocks of packet metadata */
> >> + ULLONG_FOR_EACH_1(i, keys_map) {
> >> + uint32_t hash = 0;
> >> + uint32_t i_off = i * bit_count_total;
> >> + for (int h = 0; h < bit_count_total; h++) {
> >> + hash = hash_add64(hash, blocks_scratch[i_off + h]);
> >> + }
> >> + hashes[i] = hash_finish(hash, bit_count_total * 8);
> >
> > Can we replace magic 8 above.
>
> Another question.
> Can we use:
>
> ULLONG_FOR_EACH_1 (i, keys_map) {
> hashes[i] = hash_words64_inline(&blocks_scratch[i * bit_count_total],
> bit_count_total, 0);
> }
> ?
> There should be same effect.
Yep we can.
I did investigate hash_bytes() but this becomes a function call (unless inlined
by LTO)
and the code the is less performant than the above loop due to handling non 8
byte blocks.
But I missed hash_words64_inline() - learning every day :)
Cheers
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev