summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-12-14 14:45:20 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2011-12-18 01:19:19 +0100
commitb3e0bfa71b1db9d7a9fbea6965867784fd00ca3c (patch)
tree2b8463810415b36edcb0e96b17f7a86047c1bfd5 /include/net
parent76ad94fc5df865e34e09406614f29951a046394a (diff)
downloadlinux-b3e0bfa71b1db9d7a9fbea6965867784fd00ca3c.tar.gz
linux-b3e0bfa71b1db9d7a9fbea6965867784fd00ca3c.tar.bz2
linux-b3e0bfa71b1db9d7a9fbea6965867784fd00ca3c.zip
netfilter: nf_conntrack: use atomic64 for accounting counters
We can use atomic64_t infrastructure to avoid taking a spinlock in fast path, and remove inaccuracies while reading values in ctnetlink_dump_counters() and connbytes_mt() on 32bit arches. Suggested by Pablo. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_conntrack_acct.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h
index 4e9c63a20db2..463ae8e16696 100644
--- a/include/net/netfilter/nf_conntrack_acct.h
+++ b/include/net/netfilter/nf_conntrack_acct.h
@@ -15,8 +15,8 @@
#include <net/netfilter/nf_conntrack_extend.h>
struct nf_conn_counter {
- u_int64_t packets;
- u_int64_t bytes;
+ atomic64_t packets;
+ atomic64_t bytes;
};
static inline