netfilter: conntrack: simplify early_drop
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: conntrack: simplify early_drop
We don't need to acquire the bucket lock during early drop, we can use lockless traveral just like ____nf_conntrack_find.
The timer deletion serves as synchronization point, if another cpu attempts to evict same entry, only one will succeed with timer deletion.
Signed-off-by Florian Westphal <[email protected]>
--- include/net/netfilter/nf_conntrack.h | 1 + net/netfilter/nf_conntrack_core.c | 95 ++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 48 deletions(-)
include/net/netfilter/nf_conntrack.h +1 -0
@@ -301,6 +301,7 @@ void nf_ct_tmpl_free(struct nf_conn *tmpl);#define NF_CT_STAT_INC (net, count) __this_cpu_inc((net)->ct.stat->count)#define NF_CT_STAT_INC_ATOMIC (net, count) this_cpu_inc((net)->ct.stat->count) +#define NF_CT_STAT_ADD_ATOMIC (net, count, v) this_cpu_add((net)->ct.stat->count, (v))#define MODULE_ALIAS_NFCT_HELPER (helper) \ MODULE_ALIAS("nfct-helper-" helper)
net/netfilter/nf_conntrack_core.c +47 -48
114 lines not on this page · raw message
Signature · 1 line
2.7.3
Quoted 5 lines · Florian Westphal
We don't need to acquire the bucket lock during early drop, we can use lockless traveral just like
____nf_conntrack_find.The timer deletion serves as synchronization point, if another cpu attempts to evict same entry, only one will succeed with timer deletion.
Applied, thanks Florian.