On Tue, Apr 17, 2012 at 07:22:49PM -0700, Ethan Jackson wrote:
> > -    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.

mac2 and vlan are both 16 bits, so this doesn't overlap any bits.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to