LGTM Acked-by: Antonio Fischetti <antonio.fische...@intel.com>
> -----Original Message----- > From: Ilya Maximets [mailto:i.maxim...@samsung.com] > Sent: Friday, August 4, 2017 3:17 PM > To: ovs-dev@openvswitch.org > Cc: Heetae Ahn <heetae82....@samsung.com>; Darrell Ball <db...@vmware.com>; > Wang, Yipeng1 <yipeng1.w...@intel.com>; Kevin Traynor <ktray...@redhat.com>; > Loftus, Ciara <ciara.lof...@intel.com>; Fischetti, Antonio > <antonio.fische...@intel.com>; Ilya Maximets <i.maxim...@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.maxim...@samsung.com> > --- _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev