summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2018-07-09 13:29:11 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-14 04:24:27 +0300
commit01683a1469995cc7aaf833d6f8b3f1c1d2fc3b92 (patch)
treed93f015b6615afe81d4834c5ff052d2e3b00a001 /include/net
parentc921c2077b32081617789a645120148bc8b60c98 (diff)
downloadlinux-01683a1469995cc7aaf833d6f8b3f1c1d2fc3b92.tar.xz
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>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/pkt_cls.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2081e4219f81..e4252a176eec 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -13,6 +13,7 @@ struct tcf_walker {
int stop;
int skip;
int count;
+ unsigned long cookie;
int (*fn)(struct tcf_proto *, void *node, struct tcf_walker *);
};