[ovs-dev] [PATCH v3 2/2] dpif-netdev: Fix emc replacement policy.

Fischetti, Antonio antonio.fischetti at intel.com
Fri Aug 4 15:08:52 UTC 2017


LGTM

Acked-by: Antonio Fischetti <antonio.fischetti at intel.com>

> -----Original Message-----
> From: Ilya Maximets [mailto:i.maximets at samsung.com]
> Sent: Friday, August 4, 2017 3:17 PM
> To: ovs-dev at openvswitch.org
> Cc: Heetae Ahn <heetae82.ahn at samsung.com>; Darrell Ball <dball at vmware.com>;
> Wang, Yipeng1 <yipeng1.wang at intel.com>; Kevin Traynor <ktraynor at redhat.com>;
> Loftus, Ciara <ciara.loftus at intel.com>; Fischetti, Antonio
> <antonio.fischetti at intel.com>; Ilya Maximets <i.maximets at samsung.com>
> Subject: [PATCH v3 2/2] dpif-netdev: Fix emc replacement policy.
> 
> Current EMC replacement policy allows to replace active EMC entry
> even if there are dead (empty) entries available. This leads to
> EMC trashing even on few hundreds of flows. In some cases PMD
> threads starts to execute classifier lookups even in tests with
> 50 - 100 active flows.
> 
> Looks like the hash comparison rule was introduced to randomly
> choose one of alive entries to replace. But it doesn't work as
> needed and also hashes has nothing common with randomness.
> 
> Lets fix the replacement policy by removing hash checking and
> using the random value passed from 'emc_probabilistic_insert()'
> only while considering replace of the alive entry.
> This should give us nearly fair way to choose the entry to replace.
> 
> We are avoiding calculation of the new random value by reusing
> bits of already generated random for probabilistic EMC insertion.
> Bits higher than 'EM_FLOW_INSERT_INV_PROB_SHIFT' are used because
> lower bits are less than 'min' and not fully random.
> 
> Not replacing of alive entries while dead ones exists allows to
> significantly decrease EMC trashing.
> 
> Testing shows stable work of exact match cache without misses
> with up to 3072 - 6144 active flows (depends on traffic pattern).
> 
> Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
> ---


More information about the dev mailing list