Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39690
b: refs/heads/master
c: 918049f
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Oct 16, 2006
1 parent 5db5d37 commit 5d17e07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4663afe2c848e2abc8791202beecf40684f13eb4
refs/heads/master: 918049f0135854a1583f9b3b88f44dbf2b027329
17 changes: 13 additions & 4 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,14 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
return x;
}

static void xfrm_hash_grow_check(int have_hash_collision)
{
if (have_hash_collision &&
(xfrm_state_hmask + 1) < xfrm_state_hashmax &&
xfrm_state_num > xfrm_state_hmask)
schedule_work(&xfrm_hash_work);
}

static void __xfrm_state_insert(struct xfrm_state *x)
{
unsigned int h;
Expand Down Expand Up @@ -642,10 +650,7 @@ static void __xfrm_state_insert(struct xfrm_state *x)

xfrm_state_num++;

if (x->bydst.next != NULL &&
(xfrm_state_hmask + 1) < xfrm_state_hashmax &&
xfrm_state_num > xfrm_state_hmask)
schedule_work(&xfrm_hash_work);
xfrm_hash_grow_check(x->bydst.next != NULL);
}

/* xfrm_state_lock is held */
Expand Down Expand Up @@ -753,6 +758,10 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re
h = xfrm_src_hash(daddr, saddr, family);
hlist_add_head(&x->bysrc, xfrm_state_bysrc+h);
wake_up(&km_waitq);

xfrm_state_num++;

xfrm_hash_grow_check(x->bydst.next != NULL);
}

return x;
Expand Down

0 comments on commit 5d17e07

Please sign in to comment.