On Fri, Dec 13, 2013 at 02:37:56PM -0800, Jarno Rajahalme wrote: > We allow zero 'values' in a miniflow for it to have the same map > as the corresponding minimask. Minimasks themselves never have > zero data values, though. Document this and optimize the code > accordingly. > > Signed-off-by: Jarno Rajahalme <[email protected]>
Indentation looks odd to me--did you use tabs instead of spaces? Acked-by: Ben Pfaff <[email protected]> Here is an alternate concept for minimatch_hash_range() that might be easier to understand. I did not compile it or test it. uint32_t minimatch_hash_range(const struct minimatch *match, uint8_t start, uint8_t end, uint32_t *basis) { const uint32_t *p, *q; uint32_t hash = *basis; int n, i; n = count_1bits(miniflow_get_map_in_range(&match->mask.masks, start, end, &p)); q = p + (match->flow.values - match->mask.masks.values); for (i = 0; i < n; i++) { hash = mhash_add(hash, p[i] & q[i]); } *basis = hash; /* Allow continuation from the unfinished value. */ return mhash_finish(hash, n * 4); } _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
