Re: [PATCH 37/50] netfilter: nf_tables: atomic dump and reset for stateful objects

2016-12-10 Thread Pablo Neira Ayuso
On Fri, Dec 09, 2016 at 07:22:06AM -0800, Eric Dumazet wrote: > On Fri, 2016-12-09 at 06:24 -0800, Eric Dumazet wrote: > > > It looks that you want a seqcount, even on 64bit arches, > > so that CPU 2 can restart its loop, and more importantly you need > > to not accumulate the values you read,

Re: [PATCH 37/50] netfilter: nf_tables: atomic dump and reset for stateful objects

2016-12-09 Thread Eric Dumazet
On Fri, 2016-12-09 at 06:24 -0800, Eric Dumazet wrote: > It looks that you want a seqcount, even on 64bit arches, > so that CPU 2 can restart its loop, and more importantly you need > to not accumulate the values you read, because they might be old/invalid. Untested patch to give general idea. I

Re: [PATCH 37/50] netfilter: nf_tables: atomic dump and reset for stateful objects

2016-12-09 Thread Eric Dumazet
On Fri, 2016-12-09 at 11:24 +0100, Pablo Neira Ayuso wrote: > Hi Paul, Hi Pablo Given that bytes/packets counters are modified without cmpxchg64() : static inline void nft_counter_do_eval(struct nft_counter_percpu_priv *priv, struct nft_regs *regs,

Re: [PATCH 37/50] netfilter: nf_tables: atomic dump and reset for stateful objects

2016-12-09 Thread Pablo Neira Ayuso
Hi Paul, On Thu, Dec 08, 2016 at 07:40:14PM -0500, Paul Gortmaker wrote: > On Wed, Dec 7, 2016 at 4:52 PM, Pablo Neira Ayuso wrote: > > This patch adds a new NFT_MSG_GETOBJ_RESET command perform an atomic > > dump-and-reset of the stateful object. This also comes with add

Re: [PATCH 37/50] netfilter: nf_tables: atomic dump and reset for stateful objects

2016-12-08 Thread Paul Gortmaker
On Wed, Dec 7, 2016 at 4:52 PM, Pablo Neira Ayuso wrote: > This patch adds a new NFT_MSG_GETOBJ_RESET command perform an atomic > dump-and-reset of the stateful object. This also comes with add support > for atomic dump and reset for counter and quota objects. This triggered