Problems with IGMPv3 and VIMAGE

Julian Elischer julian at elischer.org
Tue Dec 16 11:37:02 PST 2008


Bruce Simpson wrote:
> Julian Elischer wrote:
>> virtualisation of netisr at teh moment is still in flux a bit.
>> the netisr thread (that's all it really is) becomes associated with
>> a particular vimage as required. (but hey... read the code.. :-)
>>
>> http://perforce.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/vimage/src/sys/net/netisr.c 
>>
>>
>>
>>>
>>> Is there a way of virtualizing mutexes? IGMPv3 currently has a global 
>>> output queue serviced by the netisr, as that is able to take all the 
>>> required locks in the right order to get to ip_output(), and this 
>>> queue is covered by a mutex.
>>
>> mutexes embedded in structures that are virtualises are virtualised..
>> for example if you have a mutex on teh reassembly queue in one stack 
>> that owuld b e a differnt mutex than one on another stack so they 
>> could never collide.
>> it's a per instance decision on the part of the porter.
> 
> OK, so I have to move "struct ifqueue igmpoq" into "struct vnet_inet" ?

not necessarily.

atomicity of virtualization is on kernel module boundaries.

By this I mean that if it's separately loadable, it is probably 
separate enough to have it's own virtualisation structure containing 
al it's own 'global' variables, including its mutex.

When you register your module with the vimage framework a new instance 
of your structure should be allocated by the constructor method you 
registered for it.


> 
> Do I have to explicitly mtx_init() this mutex from within my pr_init 
> routine, i.e. igmp_init() ?
> 

yes, as a new one would be created every time we make a new virtual 
machine (with its own IGMP3 instance).
Don't forget to make a destructor function as well that tears down teh 
IGMP3 stack when the VM is removed.

> Up until now the code has been using the MTX_SYSINIT() macro.

I don't THINK that will work but I could be wrong.. Marko has done
some pretty remarkable things.

> 
>>
>> Have you looked at the Vimage porter guide?
>>
>> http://perforce.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/vimage/porting_to_vimage.txt 
>>
> 
> Yes, but it didn't answer all my questions, so I am bugging everyone :-)

when you understand something new, please send me an update to the doc 
that explains it so I can make the doc better.

> 
> thanks again
> BMS



More information about the freebsd-virtualization mailing list