FOREACH_VNET...

Julian Elischer julian at elischer.org
Sun Sep 7 06:33:43 UTC 2008


Julian Elischer wrote:

oops.. with correct indenting and some slight renaming..


> 
> static void
> if_slowtimo(void *arg)
> {
>         struct ifnet *ifp;
>         VNET_ITERATOR_DECL(vnet_iter, saved_vnet);
> 
>         IFNET_RLOCK();
>         VNET_FOREACH(vnet_iter, saved_vnet) {
>                 VNET_SWITCHTO(vnet_iter);
>                 TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
>                         if (ifp->if_timer == 0 || --ifp->if_timer)
>                                 continue;
>                         if (ifp->if_watchdog)
>                                 (*ifp->if_watchdog)(ifp);
>                 }
>         }
>         VNET_FOREACH_RESTORE(saved_vnet);
>         IFNET_RUNLOCK();
>         timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ);
> }
>\


More information about the freebsd-virtualization mailing list