netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 4/5] conntrack: ecache: move event cache to conntrack extension infrastructure
Date: Fri, 27 Mar 2009 12:37:32 +0100	[thread overview]
Message-ID: <49CCBA7C.2090609@netfilter.org> (raw)
In-Reply-To: <49CCA1DA.7060902@trash.net>

Patrick McHardy wrote:
> Pablo Neira Ayuso wrote:
>> This patch reworks the event caching infrastructure to use the
>> conntrack extension infrastructure. As a result, you can enable and
>> disable event delivery via /proc/sys/net/netfilter/nf_conntrack_events
>> in runtime opposed to compilation time. The main drawback is that
>> we consume more memory per conntrack if event delivery is enabled.
> 
>>  static inline void
>>  nf_conntrack_event_cache(enum ip_conntrack_events event, struct
>> nf_conn *ct)
>>  {
>> -    struct net *net = nf_ct_net(ct);
>> -    struct nf_conntrack_ecache *ecache;
>> -
>> -    local_bh_disable();
>> -    ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id());
>> -    if (ct != ecache->ct)
>> -        __nf_ct_event_cache_init(ct);
>> -    ecache->events |= event;
>> -    local_bh_enable();
>> +    spin_lock_bh(&nf_conntrack_lock);
>> +    __nf_conntrack_event_cache(event, ct);
>> +    spin_unlock_bh(&nf_conntrack_lock);
> 
> This defeats all the work we've been doing to make conntrack lockless.
> This needs to be done differenty.
> 
> Generally, I'd say a better approach is to get rid of the notifier
> chain (unnecessary overhead for the single user we have), replace it
> by a function pointer for event delivery and use that as an indication
> that events should be tracked.

I have a fuzzy morning. I get the idea of replacing the notifier chain
by a function pointer but I don't get the idea of the indication.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

  reply	other threads:[~2009-03-27 11:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27  9:38 [PATCH 0/5] improve ctnetlink event reliability Pablo Neira Ayuso
2009-03-27  9:39 ` [PATCH 1/5] netfilter: conntrack: remove events flags from userspace exposed file Pablo Neira Ayuso
2009-03-27  9:39 ` [PATCH 2/5] netfilter: conntrack: use nf_ct_kill() to destroy conntracks Pablo Neira Ayuso
2009-03-27  9:39 ` [PATCH 3/5] netfilter: conntrack: don't report events on module removal Pablo Neira Ayuso
2009-03-27  9:40 ` [PATCH 4/5] conntrack: ecache: move event cache to conntrack extension infrastructure Pablo Neira Ayuso
2009-03-27  9:52   ` Patrick McHardy
2009-03-27 11:37     ` Pablo Neira Ayuso [this message]
2009-03-27 11:41       ` Patrick McHardy
2009-03-27 11:57         ` Pablo Neira Ayuso
2009-03-27 11:58           ` Patrick McHardy
2009-03-27  9:40 ` [PATCH 5/5] ctnetlink: optional reliable event delivery Pablo Neira Ayuso
2009-03-27 10:12   ` Patrick McHardy
2009-03-27 12:32     ` Pablo Neira Ayuso
2009-03-27 12:51       ` Patrick McHardy
2009-03-30 11:22         ` 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=49CCBA7C.2090609@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --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).