MFC: bridgestp.c, r1.6; if_bridge.c, r1.18

> Mark the callouts as MPSAFE as if_bridge has been giant-free since day 1.
>
> Use the SMP friendly callout_init_mtx() while we are here.
>

Approved by:	re (kensmith), mlaier (mentor)
This commit is contained in:
thompsa 2005-08-30 20:26:53 +00:00
parent bef72ac0a1
commit 707f7071f3
2 changed files with 9 additions and 8 deletions

View File

@ -1092,7 +1092,7 @@ bstp_tick(void *arg)
struct bridge_softc *sc = arg;
struct bridge_iflist *bif;
BRIDGE_LOCK(sc);
BRIDGE_LOCK_ASSERT(sc);
#if 0
LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
@ -1141,8 +1141,6 @@ bstp_tick(void *arg)
if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
callout_reset(&sc->sc_bstpcallout, hz, bstp_tick, sc);
BRIDGE_UNLOCK(sc);
}
void

View File

@ -439,8 +439,8 @@ bridge_clone_create(struct if_clone *ifc, int unit)
/* Initialize our routing table. */
bridge_rtable_init(sc);
callout_init(&sc->sc_brcallout, 0);
callout_init(&sc->sc_bstpcallout, 0);
callout_init_mtx(&sc->sc_brcallout, &sc->sc_mtx, 0);
callout_init_mtx(&sc->sc_bstpcallout, &sc->sc_mtx, 0);
LIST_INIT(&sc->sc_iflist);
@ -498,6 +498,9 @@ bridge_clone_destroy(struct ifnet *ifp)
BRIDGE_UNLOCK(sc);
callout_drain(&sc->sc_brcallout);
callout_drain(&sc->sc_bstpcallout);
mtx_lock(&bridge_list_mtx);
LIST_REMOVE(sc, sc_list);
mtx_unlock(&bridge_list_mtx);
@ -1212,10 +1215,10 @@ bridge_init(void *xsc)
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
return;
BRIDGE_LOCK(sc);
callout_reset(&sc->sc_brcallout, bridge_rtable_prune_period * hz,
bridge_timer, sc);
BRIDGE_LOCK(sc);
ifp->if_drv_flags |= IFF_DRV_RUNNING;
bstp_initialization(sc);
BRIDGE_UNLOCK(sc);
@ -1981,9 +1984,9 @@ bridge_timer(void *arg)
{
struct bridge_softc *sc = arg;
BRIDGE_LOCK(sc);
BRIDGE_LOCK_ASSERT(sc);
bridge_rtage(sc);
BRIDGE_UNLOCK(sc);
if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
callout_reset(&sc->sc_brcallout,