netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
	netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, davem@davemloft.net, kuba@kernel.org,
	edumazet@google.com, pabeni@redhat.com, fw@strlen.de,
	netfilter-devel@vger.kernel.org, lorenzo.bianconi@redhat.com,
	brouer@redhat.com, toke@redhat.com, memxor@gmail.com,
	nathan@kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] net: netfilter: move bpf_ct_set_nat_info kfunc in nf_nat_bpf.c
Date: Thu, 29 Sep 2022 21:20:42 +0200	[thread overview]
Message-ID: <YzXwCggIANDo9Gyu@salvia> (raw)
In-Reply-To: <6cf2c440-79a6-24ce-c9bb-1f1f92af4a0b@linux.dev>

On Thu, Sep 29, 2022 at 12:13:45PM -0700, Martin KaFai Lau wrote:
> On 9/25/22 6:26 AM, Lorenzo Bianconi wrote:
> > Remove circular dependency between nf_nat module and nf_conntrack one
> > moving bpf_ct_set_nat_info kfunc in nf_nat_bpf.c
> > 
> > Fixes: 0fabd2aa199f ("net: netfilter: add bpf_ct_set_nat_info kfunc helper")
> > Suggested-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> > Tested-by: Nathan Chancellor <nathan@kernel.org>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >   include/net/netfilter/nf_conntrack_bpf.h |  5 ++
> >   include/net/netfilter/nf_nat.h           | 14 +++++
> >   net/netfilter/Makefile                   |  6 ++
> >   net/netfilter/nf_conntrack_bpf.c         | 49 ---------------
> >   net/netfilter/nf_nat_bpf.c               | 79 ++++++++++++++++++++++++
> >   net/netfilter/nf_nat_core.c              |  2 +-
> >   6 files changed, 105 insertions(+), 50 deletions(-)
> >   create mode 100644 net/netfilter/nf_nat_bpf.c
> > 
> > diff --git a/include/net/netfilter/nf_conntrack_bpf.h b/include/net/netfilter/nf_conntrack_bpf.h
> > index c8b80add1142..1ce46e406062 100644
> > --- a/include/net/netfilter/nf_conntrack_bpf.h
> > +++ b/include/net/netfilter/nf_conntrack_bpf.h
> > @@ -4,6 +4,11 @@
> >   #define _NF_CONNTRACK_BPF_H
> >   #include <linux/kconfig.h>
> > +#include <net/netfilter/nf_conntrack.h>
> > +
> > +struct nf_conn___init {
> > +	struct nf_conn ct;
> > +};
> >   #if (IS_BUILTIN(CONFIG_NF_CONNTRACK) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) || \
> >       (IS_MODULE(CONFIG_NF_CONNTRACK) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
> > diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
> > index e9eb01e99d2f..cd084059a953 100644
> > --- a/include/net/netfilter/nf_nat.h
> > +++ b/include/net/netfilter/nf_nat.h
> > @@ -68,6 +68,20 @@ static inline bool nf_nat_oif_changed(unsigned int hooknum,
> >   #endif
> >   }
> > +#if (IS_BUILTIN(CONFIG_NF_NAT) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) || \
> > +    (IS_MODULE(CONFIG_NF_NAT) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
> > +
> > +extern int register_nf_nat_bpf(void);
> > +
> > +#else
> > +
> > +static inline int register_nf_nat_bpf(void)
> > +{
> > +	return 0;
> > +}
> > +
> > +#endif
> > +
> 
> This looks similar to the ones in nf_conntrack_bpf.h.  Does it belong there
> better?  No strong opinion here.
> 
> The change looks good to me.  Can someone from the netfilter team ack this
> piece also?

Could you move this into nf_conntrack_bpf.h ?

  reply	other threads:[~2022-09-29 19:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 13:26 [PATCH bpf-next] net: netfilter: move bpf_ct_set_nat_info kfunc in nf_nat_bpf.c Lorenzo Bianconi
2022-09-29  8:37 ` Yauheni Kaliuta
2022-09-29  9:27   ` Yauheni Kaliuta
2022-09-29  9:29 ` Yauheni Kaliuta
2022-09-29 19:13 ` Martin KaFai Lau
2022-09-29 19:20   ` Pablo Neira Ayuso [this message]
2022-09-29 21:16     ` Lorenzo Bianconi
2022-09-29 21:16   ` Lorenzo Bianconi

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=YzXwCggIANDo9Gyu@salvia \
    --to=pablo@netfilter.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=toke@redhat.com \
    /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).