Date: Tue, 23 Dec 2008 13:25:42 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: Marko Zec <zec@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 155159 for review Message-ID: <20081223132508.M97918@maildrop.int.zabbadoz.net> In-Reply-To: <200812231349.07820.zec@freebsd.org> References: <200812230943.mBN9hbEZ048678@repoman.freebsd.org> <20081223115423.W97918@maildrop.int.zabbadoz.net> <200812231349.07820.zec@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 23 Dec 2008, Marko Zec wrote: Hey, > 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@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() Yes, that sounds good. > 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:) -- Bjoern A. Zeeb The greatest risk is not taking one.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081223132508.M97918>