Re: [PATCH RESEND] [XFRM]: Speed up xfrm_policy and xfrm_state walking

2008-02-12 Thread David Miller
From: Timo_Teräs <[EMAIL PROTECTED]> Date: Fri, 01 Feb 2008 16:58:04 +0200 > @@ -1780,6 +1786,7 @@ static int check_reqid(struct xfrm_policy *xp, int dir, > int count, void *ptr) > > static u32 gen_reqid(void) > { > + struct xfrm_policy_walk walk; > u32 start; > static u32 req

[PATCH RESEND] [XFRM]: Speed up xfrm_policy and xfrm_state walking

2008-02-01 Thread Timo Teräs
Change xfrm_policy and xfrm_state walking algorithm from O(n^2) to O(n). This is achieved adding the entries to one more list which is used solely for walking the entries. This also fixes some races where the dump can have duplicate or missing entries when the SPD/SADB is modified during an ongoin