From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Tony Zelenoff <antonz@parallels.com>
Cc: netfilter-devel@vger.kernel.org, Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH 2/3] net/netfilter: refactor notifier registration
Date: Fri, 24 Feb 2012 03:25:30 +0100 [thread overview]
Message-ID: <20120224022530.GA7423@1984> (raw)
In-Reply-To: <1329893281-508699-3-git-send-email-antonz@parallels.com>
On Wed, Feb 22, 2012 at 10:48:00AM +0400, Tony Zelenoff wrote:
> * ret variable initialization removed as useless
> * Similar code strings concatenated and functions code
> flow became more plain
>
> Signed-off-by: Tony Zelenoff <antonz@parallels.com>
> ---
> net/netfilter/nf_conntrack_ecache.c | 26 ++++++++++----------------
> 1 files changed, 10 insertions(+), 16 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c
> index aa15977..9b8e986 100644
> --- a/net/netfilter/nf_conntrack_ecache.c
> +++ b/net/netfilter/nf_conntrack_ecache.c
> @@ -81,21 +81,18 @@ EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events);
> int nf_conntrack_register_notifier(struct net *net,
> struct nf_ct_event_notifier *new)
> {
> - int ret = 0;
> + int ret;
> struct nf_ct_event_notifier *notify;
>
> mutex_lock(&nf_ct_ecache_mutex);
> notify = rcu_dereference_protected(net->ct.nf_conntrack_event_cb,
> lockdep_is_held(&nf_ct_ecache_mutex));
> - if (notify != NULL) {
> + if (likely(!notify)) {
> + rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new);
> + ret = 0;
I agree with Eric here.
1) Code readability is worst after this change.
2) More important, event notifier registration is not in the hot path,
so this likely is not worth to have.
Sorry, I won't take this patch.
next prev parent reply other threads:[~2012-02-24 2:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 6:47 [PATCH 0/3] net/netfilter: minor refactoring of conntrack ecache Tony Zelenoff
2012-02-22 6:47 ` [PATCH 1/3] net/netfilter: whitespace removed Tony Zelenoff
2012-02-24 2:30 ` Pablo Neira Ayuso
2012-02-22 6:48 ` [PATCH 2/3] net/netfilter: refactor notifier registration Tony Zelenoff
2012-02-22 7:54 ` Eric Dumazet
2012-02-22 8:18 ` Tony Zelenoff
2012-02-24 2:25 ` Pablo Neira Ayuso [this message]
2012-02-22 6:48 ` [PATCH 3/3] net/netfilter: refactor nf_ct_deliver_cached_events Tony Zelenoff
2012-02-24 2:36 ` 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=20120224022530.GA7423@1984 \
--to=pablo@netfilter.org \
--cc=antonz@parallels.com \
--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).