]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: refactor flower walk to iterate over idr
authorVlad Buslov <vladbu@mellanox.com>
Mon, 9 Jul 2018 10:29:11 +0000 (13:29 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Jul 2018 01:24:27 +0000 (18:24 -0700)
commit1b01bde0f5c06672f920550b2c191c3a919512c5
treed93f015b6615afe81d4834c5ff052d2e3b00a001
parent908f4dec3acca09cce980413a43adad2d65bd773
net: sched: refactor flower walk to iterate over idr

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 <jiri@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reported-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/cls_api.c
net/sched/cls_flower.c