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.
Fix this by removing of srtange hash comparison rule from the replacement checking. New behavior also matches the comment that describes replacement policy. This comment wasn't correct before. Testing shows stable work of exact match cache without misses with up to 3072 active flows and only 0.05% of EMC misses with 4096 flows. With higher number of flows there is no significant difference with current implementation. For the reference, number of EMC misses in current master is around 20% for the case with 2048 active flows. Testing performed with 100% EMC insert probability. Signed-off-by: Ilya Maximets <[email protected]> --- lib/dpif-netdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 47a9fa0..4a8dd80 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2054,8 +2054,7 @@ emc_insert(struct emc_cache *cache, const struct netdev_flow_key *key, * in the first entry where it can be */ if (!to_be_replaced || (emc_entry_alive(to_be_replaced) - && !emc_entry_alive(current_entry)) - || current_entry->key.hash < to_be_replaced->key.hash) { + && !emc_entry_alive(current_entry))) { to_be_replaced = current_entry; } } -- 2.7.4 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
