diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-14 14:45:20 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-12-18 01:19:19 +0100 |
commit | b3e0bfa71b1db9d7a9fbea6965867784fd00ca3c (patch) | |
tree | 2b8463810415b36edcb0e96b17f7a86047c1bfd5 /net/netfilter/nf_conntrack_acct.c | |
parent | 76ad94fc5df865e34e09406614f29951a046394a (diff) | |
download | op-kernel-dev-b3e0bfa71b1db9d7a9fbea6965867784fd00ca3c.zip op-kernel-dev-b3e0bfa71b1db9d7a9fbea6965867784fd00ca3c.tar.gz |
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 'net/netfilter/nf_conntrack_acct.c')
-rw-r--r-- | net/netfilter/nf_conntrack_acct.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c index 369df3f..9332906 100644 --- a/net/netfilter/nf_conntrack_acct.c +++ b/net/netfilter/nf_conntrack_acct.c @@ -46,8 +46,8 @@ seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir) return 0; return seq_printf(s, "packets=%llu bytes=%llu ", - (unsigned long long)acct[dir].packets, - (unsigned long long)acct[dir].bytes); + (unsigned long long)atomic64_read(&acct[dir].packets), + (unsigned long long)atomic64_read(&acct[dir].bytes)); }; EXPORT_SYMBOL_GPL(seq_print_acct); |