]> git.proxmox.com Git - mirror_ovs.git/commit
conntrack: Periodically delete expired connections.
authorDaniele Di Proietto <diproiettod@vmware.com>
Mon, 16 May 2016 19:59:23 +0000 (12:59 -0700)
committerDaniele Di Proietto <diproiettod@vmware.com>
Thu, 28 Jul 2016 01:51:51 +0000 (18:51 -0700)
commite6ef6cc6349b1619c74a30444874066c2bf567ff
tree58a5ce5e81abad1ed68eeb4627967e13a76d72f8
parenta489b16854b590004e3234573721fd0f676b3295
conntrack: Periodically delete expired connections.

This commit adds a thread that periodically removes expired connections.

The expiration time of a connection can be expressed by:

expiration = now + timeout

For each possible 'timeout' value (there aren't many) we keep a list.
When the expiration is updated, we move the connection to the back of the
corresponding 'timeout' list. This ways, the list is always ordered by
'expiration'.

When the cleanup thread iterates through the lists for expired
connections, it can stop at the first non expired connection.

Suggested-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
lib/conntrack-other.c
lib/conntrack-private.h
lib/conntrack-tcp.c
lib/conntrack.c
lib/conntrack.h