netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v2 -next 1/2] netfilter: iptables: separate counters from iptables rules
Date: Fri, 29 May 2015 12:05:16 +0200	[thread overview]
Message-ID: <20150529100516.GI23992@breakpoint.cc> (raw)
In-Reply-To: <1432850096.7456.38.camel@edumazet-glaptop2.roam.corp.google.com>

Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > How?  What address?  You mean relative offset to counter start?
> 
> No, the address itself. This is what I coded years ago.
> > when rule x matches, I need to increment the corresponding counter
> > for that rule.
> 
> Right. You have in the rule itself the storage for xt_counter. Thats 16
> bytes. You only need 8 bytes (on 64bit arch) to store the percpu
> address.

> Instead of leaving nothing in it, place the percpu address of the
> corresponding counter. access to it is in the cache line needed to
> analyze the entry anyway. Its free.

I'm dense.  So, what you're saying is that I should

alloc_percpu(sizeof(struct xt_counters));

for each rule and store the resulting address in ipt_entry?
Then it would be possible to get the correct location for current cpu
when counter has to be incremented.

Thanks Eric.

  reply	other threads:[~2015-05-29 10:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 20:51 [PATCH v2 -next 1/2] netfilter: iptables: separate counters from iptables rules Florian Westphal
2015-05-28 20:51 ` [PATCH v2 -next 2/2] netfilter: store rules per NUMA node instead of per cpu Florian Westphal
2015-05-28 21:38   ` Eric Dumazet
2015-05-28 21:52     ` Florian Westphal
2015-05-28 22:04       ` Eric Dumazet
2015-05-29  9:41         ` Florian Westphal
2015-05-28 21:33 ` [PATCH v2 -next 1/2] netfilter: iptables: separate counters from iptables rules Eric Dumazet
2015-05-28 21:45   ` Florian Westphal
2015-05-28 21:54     ` Eric Dumazet
2015-05-29 10:05       ` Florian Westphal [this message]
2015-05-29 10:32         ` Eric Dumazet
2015-05-29 11:32 ` Patrick Schaaf
2015-06-05 12:28   ` Florian Westphal

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=20150529100516.GI23992@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=eric.dumazet@gmail.com \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).