On Tue, Jul 10, 2018 at 08:02:10PM +0300, Vlad Buslov wrote: > > On Tue 10 Jul 2018 at 13:55, Simon Horman <simon.hor...@netronome.com> wrote: > > On Mon, Jul 09, 2018 at 01:29:11PM +0300, Vlad Buslov wrote: > >> Extend struct tcf_walker with additional 'cookie' field. It is intended to > >> be used by classifier walk implementations to continue iteration directly > >> from particular filter, instead of iterating 'skip' number of times. > >> > >> Change flower walk implementation to save filter handle in 'cookie'. Each > >> time flower walk is called, it looks up filter with saved handle directly > >> with idr, instead of iterating over filter linked list 'skip' number of > >> times. This change improves complexity of dumping flower classifier from > >> quadratic to linearithmic. (assuming idr lookup has logarithmic complexity) > >> > >> Reviewed-by: Jiri Pirko <j...@mellanox.com> > >> Signed-off-by: Vlad Buslov <vla...@mellanox.com> > > > > Reported-by: Simon Horman <simon.hor...@netronome.com> > > > > Thanks, I'm very pleased to see this change. I would appreciate it if > > we could have a little time to test its impact on performance > > thoroughly. > > For me it reduced time needed to dump 5m flows to ~50 seconds. Not a > very thorough benchmark, but performance improvement was so dramatic > that I decided to not investigate further.
Thanks, we have also now measured a similar improvement in performance. > > One question: will this work as expected (i.e. be at least backwards > > compatible) with existing user-space code? > > I considered that and didn't find any reason why it would break > compatibility. Basically with current flower flows are dumped in > arbitrary order, and with this change dump(accidentally) outputs flows > in sorted ascending order. User space shouldn't expect any ordering in > dumped flows anyway, right? Agreed. I don't think we need to be worried about changes in the order of dumped flows. Reviewed-by: Simon Horman <simon.hor...@netronome.com>