PERFORCE change 155159 for review
Marko Zec
zec at freebsd.org
Tue Dec 23 05:06:34 PST 2008
On Tuesday 23 December 2008 13:05:26 Bjoern A. Zeeb wrote:
> On Tue, 23 Dec 2008, Marko Zec wrote:
> > http://perforce.freebsd.org/chv.cgi?CH=155159
> >
> > Change 155159 by zec at zec_tca51 on 2008/12/23 09:42:41
> >
> > Misintegration - unbreak options VIMAGE_GLOBALS build.
> >
> > Affected files ...
> >
> > .. //depot/projects/vimage/src/sys/net/if.c#60 edit
> >
> > Differences ...
> >
> > ==== //depot/projects/vimage/src/sys/net/if.c#60 (text+ko) ====
> >
> > @@ -402,10 +402,6 @@
> > {
> > INIT_VNET_NET(curvnet);
> >
> > -#ifndef VIMAGE
> > - vnet_mod_register(&vnet_net_modinfo);
> > -#endif
> > -
> > V_if_index = 0;
> > V_ifindex_table = NULL;
> > V_if_indexlim = 8;
>
> This is sounds wrong as well.
>
> In case of VIMAGE vnet_mod_register is called in if_init().
> Then vnet_net_iattach will be called as well from
> vnet_mod_constructor() and thus we are going to call
> vnet_mod_register() twice resulting in a panic. See p4 describe -du
> 154705 .
>
> So the proper check would be.. ?
>
> #if !defined(VIMAGE_GLOBALS) && !defined(VIMAGE)
Yes, or to perhaps a in a slightly simpler form, I think the correct way
of calling the initializer fn and / or registering the vnet module
should be
#ifdef VIMAGE_GLOBALS
vnet_inet_iattach(NULL)
#else
vnet_mod_register(&vnet_net_modinfo);
#endif
in this case in if_init(), definitely not in vnet_net_iattach()
Good point, I think I should revisit all the vnet module registrations
in the vimage branch now, as well as possibly put in some #ifdefs
inside vnet_mod_register()...
Thanks,
Marko
> Three tries, must be right now;-)
More information about the p4-projects
mailing list