[libvirt] Replace AF_LOCAL with AF_PACKET

Ben Gray ben.r.gray at gmail.com
Fri Jul 31 14:10:24 UTC 2015


     I've a question on whether it's 'safe' to change the socket type 
used in virNetxxx calls from AF_PACKET to AF_LOCAL ?

     The reason I ask is that we're using libvirt-lxc with a couple of 
bridge interfaces, and we've found that the socket close call on 
AF_PACKET type sockets takes between 40ms and 60ms. For our container 
config there is roughly 12 close calls on AF_PACKET sockets, delaying 
the start-up of the LXC container by around 450ms.

     So a simple fix to speed up our container start-up is to just 
switch from AF_PACKET to AF_LOCAL sockets.  Hence my question on whether 
we can safely do this, or is there some reason why AF_PACKET was chosen ?

Thanks in advance,

FWIW - I believe that AF_PACKET sockets take so long to close is because 
the kernel packet driver calls synchronize_net() when closing.

More information about the libvir-list mailing list