On Mon, Jun 21, 2021 at 02:15:10PM +0530, Surya Rudra via dev wrote:
> 2. Select groups with 2 equally weighted buckets
> The minimum lookup table size is set to 16 slots (4 bit hash)
> even in this scenario where two slots would suffice (1 bit hash).
> This implies an unnecessary 8-fold increase of needed
> recirculation megaflow entries in the datapath. In select group
> use cases where the number of megaflows is already high(i.e.10-100K)
> an additional factor 8 can push the OVS megaflow cache over the edge.
This does sound like a problem, but on the other hand, the reason we
round up to 16 is to reduce the inaccuracy entailed by having to round
up to a power of 2.
Here's another idea: if the number of slots was already a power of 2,
then don't round up to 16, like this:
/* We need at least 'min_slots' slots to accurately implement the
* weighting, but we can only implement total weights that are a power of
* 2. If rounding up to a power of 2 changes the weighting, then make sure
* we have at least 16 hash buckets so that we aren't too inaccurate. */
uint64_t min_slots = DIV_ROUND_UP(total_weight, min_weight);
uint64_t min_slots2 = ROUND_UP_POW2(min_slots);
uint64_t n_hash = (min_slots == min_slots2 ? min_slots2
: MAX(16, min_slots2));
What do you think?
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev