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:	mlaier (mentor)
MFC after:	3 days
This commit is contained in:
Andrew Thompson 2005-08-18 20:17:00 +00:00
parent 069dfe8315
commit 23e7643185
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149253
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);
@ -1988,9 +1991,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,