Re: [PATCH bpf-next] net: netfilter: move bpf_ct_set_nat_info kfunc in nf_nat_bpf.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxx>
> > Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
> > ---
> >   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.

I have no strong opinion too. I will move it in nf_conntrack_bpf.h as
requested by Pablo.

Regards,
Lorenzo

> 
> The change looks good to me.  Can someone from the netfilter team ack this
> piece also?
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux