Skip to content

Commit

Permalink
xfrm: policy: add inexact policy search tree infrastructure
Browse files Browse the repository at this point in the history
At this time inexact policies are all searched in-order until the first
match is found.  After removal of the flow cache, this resolution has
to be performed for every packetm resulting in major slowdown when
number of inexact policies is high.

This adds infrastructure to later sort inexact policies into a tree.
This only introduces a single class: any:any.

Next patch will add a search tree to pre-sort policies that
have a fixed daddr/prefixlen, so in this patch the any:any class
will still be used for all policies.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
Florian Westphal authored and klassert committed Nov 9, 2018
1 parent b5fe22e commit 6be3b0d
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 54 deletions.
1 change: 1 addition & 0 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ struct xfrm_policy {
/* This lock only affects elements except for entry. */
rwlock_t lock;
refcount_t refcnt;
u32 pos;
struct timer_list timer;

atomic_t genid;
Expand Down
Loading

0 comments on commit 6be3b0d

Please sign in to comment.