[ovs-dev] [optimize 19/26] mac-learning: Speed up mac_table_hash().
Ethan Jackson
ethan at nicira.com
Tue Apr 17 19:22:49 PDT 2012
> - return hash_bytes(mac, ETH_ADDR_LEN, vlan ^ ml->secret);
> + unsigned int mac1 = get_unaligned_u32((uint32_t *) mac);
> + unsigned int mac2 = get_unaligned_u16((uint16_t *) (mac + 4));
> + return hash_3words(mac1, mac2 | (vlan << 16), ml->secret);
Would we get better hash distribution if we did something like:
hash_3words(mac1, mac2, ml->secret ^ vlan)? OR ing seems a bit
strange to me, but I may not fully understand the algorithm.
Ethan
> }
>
> static struct mac_entry *
> --
> 1.7.9
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list