All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Giuseppe Scrivano <gscrivan@redhat.com>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [RFC PATCH] netfilter: call synchronize_net only once from nf_register_net_hooks
Date: Wed, 22 Nov 2017 15:54:22 +0100	[thread overview]
Message-ID: <20171122145422.GJ24866@breakpoint.cc> (raw)
In-Reply-To: <8737569yi7.fsf@redhat.com>

Giuseppe Scrivano <gscrivan@redhat.com> wrote:
> > However, I suggest you try to go with call_rcu to get rid of all of the
> > synchronize_net() calls. I don't even see why its still needed for
> > nfqueue case provided we invoke the nfqueue drop handler first.
> >
> > PoC example, untested:
> 
> thanks, the patch seems to work for me, at least the problem I was
> seeing before is now fixed.
> 
> Is there any reason for defining "struct nf_hook_entries_rcu_head"?

Yes, idea is to only place elements we need in packet path at the
beginning of structure.

> I've used this fixup patch and it works as well.  As someone new to the
> code, I find it a bit easier to follow:
> 
> 
> diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
> index c08fd706d9c7..663046776def 100644
> --- a/include/linux/netfilter.h
> +++ b/include/linux/netfilter.h
> @@ -77,12 +77,8 @@ struct nf_hook_entry {
>  	void				*priv;
>  };
>  
> -struct nf_hook_entries_rcu_head {
> -	struct rcu_head head;
> -	void            *allocation;
> -};
> -
>  struct nf_hook_entries {
> +	struct rcu_head                 head;

Right, this works too.
I wanted to keep the rcu head out of the fastpath part
as we only need it during destruction.

      reply	other threads:[~2017-11-22 14:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 10:40 [RFC PATCH] netfilter: call synchronize_net only once from nf_register_net_hooks Giuseppe Scrivano
2017-11-22 10:41 ` Florian Westphal
2017-11-22 11:06 ` Florian Westphal
2017-11-22 11:10   ` Florian Westphal
2017-11-22 11:25   ` Giuseppe Scrivano
2017-11-22 11:56     ` Florian Westphal
2017-11-22 14:30       ` Giuseppe Scrivano
2017-11-22 14:54         ` Florian Westphal [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=20171122145422.GJ24866@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=gscrivan@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.