]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
[NETFILTER]: nf_conntrack: early_drop improvement
authorPatrick McHardy <kaber@trash.net>
Sun, 8 Jul 2007 05:37:38 +0000 (22:37 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 11 Jul 2007 05:18:15 +0000 (22:18 -0700)
commit7ae7730fd6d98be1afe8ad9ea77813de607ec970
treecb0cebe96de34a5d6116e4f76377e6ef4ca43547
parentec59a1110aee6846adada8979915cacae64042ce
[NETFILTER]: nf_conntrack: early_drop improvement

When the maximum number of conntrack entries is reached and a new
one needs to be allocated, conntrack tries to drop an unassured
connection from the same hash bucket the new conntrack would hash
to. Since with a properly sized hash the average number of entries
per bucket is 1, the chances of actually finding one are not very
good. This patch makes it walk the hash until a minimum number of
8 entries are checked.

Based on patch by Vasily Averin <vvs@sw.ru>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nf_conntrack_core.c