From: Arnd Bergmann <arnd@arndb.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, eric.dumazet@gmail.com,
netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net-next] netfilter: nft_counter: rework atomic dump and reset
Date: Sun, 11 Dec 2016 16:13:49 +0100 [thread overview]
Message-ID: <2354668.BqtCyL9KZm@wuerfel> (raw)
In-Reply-To: <1481453040-2675-1-git-send-email-pablo@netfilter.org>
On Sunday, December 11, 2016 11:43:59 AM CET Pablo Neira Ayuso wrote:
> Dump and reset doesn't work unless cmpxchg64() is used both from packet
> and control plane paths. This approach is going to be slow though.
> Instead, use a percpu seqcount to fetch counters consistently, then
> subtract bytes and packets in case a reset was requested.
>
> The cpu that running over the reset code is guaranteed to own this stats
> exclusively, we have to turn counters into signed 64bit though so stats
> update on reset don't get wrong on underflow.
>
> This patch is based on original sketch from Eric Dumazet.
>
> Fixes: 43da04a593d8 ("netfilter: nf_tables: atomic dump and reset for stateful objects")
> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
>
Looks great, I had a similar idea that I was going to suggest the
other day, but yours is better anyway.
Arnd
next prev parent reply other threads:[~2016-12-11 15:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-11 10:43 [PATCH net-next] netfilter: nft_counter: rework atomic dump and reset Pablo Neira Ayuso
2016-12-11 15:02 ` David Miller
2016-12-11 15:13 ` Arnd Bergmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-12-10 14:05 Pablo Neira Ayuso
2016-12-10 14:16 ` Pablo Neira Ayuso
2016-12-10 14:25 ` Pablo Neira Ayuso
2016-12-10 15:40 ` Eric Dumazet
2016-12-11 10:41 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2354668.BqtCyL9KZm@wuerfel \
--to=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.