netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Valentina Giusti <valentina.giusti@oss.bmw-carit.de>
Cc: valentina.giusti@bmw-carit.de, netfilter-devel@vger.kernel.org,
	Patrick McHardy <kaber@trash.net>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 0/4] [RFC] nfnetlink_acct: Traffic-based and periodic notifications
Date: Thu, 5 Sep 2013 17:52:07 +0200	[thread overview]
Message-ID: <20130905155207.GA3947@localhost> (raw)
In-Reply-To: <52289C20.5080104@oss.bmw-carit.de>

On Thu, Sep 05, 2013 at 04:58:40PM +0200, Valentina Giusti wrote:
> Hi,
> 
> On 09/05/2013 10:27 AM, Pablo Neira Ayuso wrote:
> >On Thu, Sep 05, 2013 at 09:58:52AM +0200, Valentina Giusti wrote:
> >[...]
> >>As I mentioned, there are
> >>
> >>"applications (e.g. connman) which currently need to keep polling
> >>accounting objects via nfnl_acct_get() in order to get updated
> >>statistics. This is far from ideal in scenarios with large amounts
> >>of accounting objects and diverse, unpredictable network traffic."
> >
> >You get around 100 accounting objects with one single recv syscall on
> >x86_64 when polling from userspace. If you're noticing performance
> >issues with this approach, please report them more precisely.
> 
> It's actually rather a conceptual matter here.
> Requesting notifications from userspace via nfnl_acct_get() implies
> that for each and every one of them, userspace has to make a new
> query. Is polling for stats  better than receiving notifications
> from the kernel?

The question is that you're proposing to move the complexity from user
to kernel-space to resolve this problem, which results in more kernel
LOC for a very specific task. I think we can make it in a more generic
way.

My suggestion is to extend the iptables nfacct match to match if the
bytes/packets have passed some user-define threshold, then use the
NFLOG target to report such situation.

The hypothetical iptables command line would look like:

-m nfacct --nfacct-name test --above-bytes 1000 --match-once \
        -j NFLOG --nflog-prefix "test"

You can add a new nfacct match revision to implement this new feature.

Regards.

      reply	other threads:[~2013-09-05 15:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 12:05 [PATCH 0/4] [RFC] nfnetlink_acct: Traffic-based and periodic notifications valentina.giusti
2013-09-04 12:05 ` [PATCH 1/4] " valentina.giusti
2013-09-04 12:05 ` [PATCH 2/4] libnetfilter-acct: Introduce support for notifications valentina.giusti
2013-09-04 12:44   ` Pablo Neira Ayuso
2013-09-05  8:04     ` Valentina Giusti
2013-09-04 12:05 ` [PATCH 3/4] nfacct: Add 'notify' commands " valentina.giusti
2013-09-04 12:05 ` [PATCH 4/4] nfacct: Add man page section for the 'notify' commands valentina.giusti
2013-09-04 12:39 ` [PATCH 0/4] [RFC] nfnetlink_acct: Traffic-based and periodic notifications Pablo Neira Ayuso
2013-09-05  7:58   ` Valentina Giusti
2013-09-05  8:27     ` Pablo Neira Ayuso
2013-09-05 14:58       ` Valentina Giusti
2013-09-05 15:52         ` Pablo Neira Ayuso [this message]

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=20130905155207.GA3947@localhost \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=valentina.giusti@bmw-carit.de \
    --cc=valentina.giusti@oss.bmw-carit.de \
    /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).