Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1352817

Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers

From Michal Kubecek <mkubecek@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers
Date 2016-03-08 11:10 +0100
Message-ID <ramKv-7SB-27@gated-at.bofh.it> (permalink)
References <r8VCG-5oY-19@gated-at.bofh.it> <r8VMl-5IQ-5@gated-at.bofh.it> <radHc-1Il-3@gated-at.bofh.it> <radHc-1Il-1@gated-at.bofh.it> <rajWh-63B-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 08, 2016 at 08:05:44AM +0100, Michal Kubecek wrote:
> On Mon, Mar 07, 2016 at 04:28:26PM -0800, Cong Wang wrote:
> > On Mon, Mar 7, 2016 at 4:26 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > > On Fri, Mar 4, 2016 at 2:59 AM, Michal Kubecek <mkubecek@suse.cz> wrote:
> > >>  static void ipv6_route_seq_setup_walk(struct ipv6_route_iter *iter)
> > >>  {
> > >> +#ifdef CONFIG_NET_NS
> > >> +       struct net *net = iter->p.net;
> > >> +#else
> > >> +       struct net *net = &init_net;
> > >> +#endif
> > >> +
> > >
> > > You should pass the struct net pointer to ipv6_route_seq_setup_walk()
> > > instead of reading it by yourself.
> 
> I considered this. While it probably wouldn't bring any extra overhead
> as the function is going to be inlined anyway, it didn't look really
> nice. I gues I'll use read_pnet() as David suggested; I just didn't
> realize the reason it's a macro in !CONFIG_NET_NS case is to allow
> passing a pointer to non-existent struct member.

Well, not anymore, actually, since commit 0c5c9fb55106 ("net: Introduce
possible_net_t"). Unfortunately seq_file_net does not use possible_net_t
and fixing that could potentially affect too much code to just throw it
in now without sufficient testing.

I was also wrong about ipv6_route_seq_setup_walk() being inlined as
there are two callers. On the other hand, the only difference is two
register mov instructions (one in caller, one in callee) vs. one read
from memory so it's not clear if there is an actual overhead.

So I'll pass net as second argument after all and submit the
seq_net_private conversion to possible_net_t later, most likely after
net-next opens again for 4.7.

                                                        Michal Kubecek

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/3] ipv6: per netns FIB6 walkers and garbage collector Michal Kubecek <mkubecek@suse.cz> - 2016-03-04 12:00 +0100
  [PATCH net-next 3/3] ipv6: per netns FIB garbage collection Michal Kubecek <mkubecek@suse.cz> - 2016-03-04 12:00 +0100
  [PATCH net-next 2/3] ipv6: per netns fib6 walkers Michal Kubecek <mkubecek@suse.cz> - 2016-03-04 12:10 +0100
    Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers David Miller <davem@davemloft.net> - 2016-03-07 20:50 +0100
    Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers Cong Wang <xiyou.wangcong@gmail.com> - 2016-03-08 01:30 +0100
      Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers Michal Kubecek <mkubecek@suse.cz> - 2016-03-08 08:10 +0100
        Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers Michal Kubecek <mkubecek@suse.cz> - 2016-03-08 11:10 +0100
    Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers Cong Wang <xiyou.wangcong@gmail.com> - 2016-03-08 01:30 +0100

csiph-web